36 lines
631 B
Go
Raw Normal View History

2023-10-08 15:59:42 +07:00
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"
}