Add Transaction
This commit is contained in:
@@ -1,23 +1,19 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"furtuna-be/internal/constants/transaction"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Transaction struct {
|
||||
ID int64
|
||||
PartnerID int64
|
||||
Status transaction.PaymentStatus
|
||||
Amount float64
|
||||
OrderID int64
|
||||
PaymentMethod transaction.PaymentMethod
|
||||
CustomerName string
|
||||
CustomerPhone string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
CreatedBy int64
|
||||
UpdatedBy int64
|
||||
ID string `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"`
|
||||
PartnerID int64 `gorm:"not null"`
|
||||
TransactionType string `gorm:"not null"`
|
||||
ReferenceID string `gorm:"size:255"`
|
||||
Status string `gorm:"size:255"`
|
||||
CreatedBy int64 `gorm:"not null"`
|
||||
UpdatedBy int64 `gorm:"not null"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
||||
}
|
||||
|
||||
type TransactionDB struct {
|
||||
@@ -33,3 +29,23 @@ func (b *Transaction) ToTransactionDB() *TransactionDB {
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user