36 lines
631 B
Go
36 lines
631 B
Go
|
|
package entity
|
||
|
|
|
||
|
|
import (
|
||
|
|
"furtuna-be/internal/constants/transaction"
|
||
|
|
"time"
|
||
|
|
)
|
||
|
|
|
||
|
|
type Transaction struct {
|
||
|
|
ID int64
|
||
|
|
BranchID 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
|
||
|
|
}
|
||
|
|
|
||
|
|
type TransactionDB struct {
|
||
|
|
Transaction
|
||
|
|
}
|
||
|
|
|
||
|
|
func (b *Transaction) ToTransactionDB() *TransactionDB {
|
||
|
|
return &TransactionDB{
|
||
|
|
Transaction: *b,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (TransactionDB) TableName() string {
|
||
|
|
return "transactions"
|
||
|
|
}
|