package entity import ( "time" ) type Transaction struct { ID string `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` OrderID int64 PartnerID int64 `gorm:"not null"` TransactionType string `gorm:"not null"` Status string `gorm:"size:255"` CreatedBy int64 `gorm:"not null"` UpdatedBy int64 `gorm:"not null"` Amount float64 `gorm:"not null"` CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` PaymentMethod string `json:"payment_method"` Fee float64 Total float64 } type TransactionDB struct { Transaction } func (b *Transaction) ToTransactionDB() *TransactionDB { return &TransactionDB{ Transaction: *b, } } func (TransactionDB) TableName() string { return "transactions" } type TransactionSearch struct { PartnerID *int64 SiteID *int64 Type string Status string Limit int Offset int Date string } type TransactionList struct { ID string TransactionType string Status string CreatedAt time.Time SiteName string PartnerName string Amount int64 Total int64 Fee int64 } type TransactionApproval struct { TransactionID string Status string }