Yimaru-BackEnd/internal/domain/transaction.go

77 lines
1.7 KiB
Go

package domain
import "time"
type TransactionType int
const (
TRANSACTION_CASHOUT TransactionType = iota
TRANSACTION_DEPOSIT
)
type PaymentOption int64
const (
CASH_TRANSACTION PaymentOption = iota
TELEBIRR_TRANSACTION
ARIFPAY_TRANSACTION
BANK
)
// Transaction only represents when the user cashes out a bet in the shop
// It probably would be better to call it a CashOut or ShopWithdrawal
type Transaction struct {
ID int64
Amount Currency
BranchID int64
BranchName string
BranchLocation string
CompanyID int64
CashierID int64
CashierName string
BetID int64
NumberOfOutcomes int64
Type TransactionType
PaymentOption PaymentOption
FullName string
PhoneNumber string
// Payment Details for bank
BankCode string
BeneficiaryName string
AccountName string
AccountNumber string
ReferenceNumber string
Verified bool
ApprovedBy ValidInt64
ApproverName ValidString
UpdatedAt time.Time
CreatedAt time.Time
}
type TransactionFilter struct {
CompanyID ValidInt64
BranchID ValidInt64
CashierID ValidInt64
}
type CreateTransaction struct {
Amount Currency
BranchID int64
CashierID int64
BetID int64
NumberOfOutcomes int64
Type TransactionType
PaymentOption PaymentOption
FullName string
PhoneNumber string
// Payment Details for bank
BankCode string
BeneficiaryName string
AccountName string
AccountNumber string
ReferenceNumber string
BranchName string
BranchLocation string
CompanyID int64
CashierName string
}