Documentation ¶
Index ¶
- func CreateTransactionRepo(conn *gorm.DB) transactions.Repository
- func ToListDomain(data []Transaction) (result []transactions.Domain)
- type Transaction
- type TransactionRepo
- func (rep *TransactionRepo) Create(ctx context.Context, transR *transactions.Domain) (transactions.Domain, error)
- func (rep *TransactionRepo) Delete(ctx context.Context, id int) error
- func (rep *TransactionRepo) GetAll(ctx context.Context) ([]transactions.Domain, error)
- func (rep *TransactionRepo) GetById(ctx context.Context, id int) (transactions.Domain, error)
- func (rep *TransactionRepo) GetByUserId(ctx context.Context, id int) ([]transactions.Domain, error)
- func (rep *TransactionRepo) GetByUserIdAndStatus(ctx context.Context, id int, sid int) ([]transactions.Domain, error)
- func (rep *TransactionRepo) Update(ctx context.Context, transU transactions.Domain) (transactions.Domain, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTransactionRepo ¶
func CreateTransactionRepo(conn *gorm.DB) transactions.Repository
func ToListDomain ¶
func ToListDomain(data []Transaction) (result []transactions.Domain)
Types ¶
type Transaction ¶
type Transaction struct { Id int `gorm:"primaryKey"` UserId int User user.User `gorm:"foreignKey:UserId;association_foreignkey:Id"` TransactionDate time.Time Transaction float64 TransactionAttachment string Status int8 Point float64 Description string CreatedAt time.Time UpdatedAt time.Time }
func FromDomain ¶
func FromDomain(domain transactions.Domain) Transaction
func (*Transaction) ToDomain ¶
func (tr *Transaction) ToDomain() transactions.Domain
type TransactionRepo ¶
func (*TransactionRepo) Create ¶
func (rep *TransactionRepo) Create(ctx context.Context, transR *transactions.Domain) (transactions.Domain, error)
func (*TransactionRepo) Delete ¶
func (rep *TransactionRepo) Delete(ctx context.Context, id int) error
func (*TransactionRepo) GetAll ¶
func (rep *TransactionRepo) GetAll(ctx context.Context) ([]transactions.Domain, error)
func (*TransactionRepo) GetById ¶
func (rep *TransactionRepo) GetById(ctx context.Context, id int) (transactions.Domain, error)
func (*TransactionRepo) GetByUserId ¶
func (rep *TransactionRepo) GetByUserId(ctx context.Context, id int) ([]transactions.Domain, error)
func (*TransactionRepo) GetByUserIdAndStatus ¶
func (rep *TransactionRepo) GetByUserIdAndStatus(ctx context.Context, id int, sid int) ([]transactions.Domain, error)
func (*TransactionRepo) Update ¶
func (rep *TransactionRepo) Update(ctx context.Context, transU transactions.Domain) (transactions.Domain, error)
Click to show internal directories.
Click to hide internal directories.