Yimaru-BackEnd/internal/domain/transfer.go

59 lines
1.4 KiB
Go

package domain
import "time"
type TransferType string
const (
DEPOSIT TransferType = "deposit"
WITHDRAW TransferType = "withdraw"
WALLET TransferType = "wallet"
)
type PaymentMethod string
// Info on why the wallet was modified
// If its internal system modification then, its always direct
const (
TRANSFER_DIRECT PaymentMethod = "direct"
TRANSFER_CASH PaymentMethod = "cash"
TRANSFER_BANK PaymentMethod = "bank"
TRANSFER_CHAPA PaymentMethod = "chapa"
TRANSFER_ARIFPAY PaymentMethod = "arifpay"
TRANSFER_SANTIMPAY PaymentMethod = "santimpay"
TRANSFER_ADDISPAY PaymentMethod = "addispay"
TRANSFER_OTHER PaymentMethod = "other"
)
// Info for the payment providers
type PaymentDetails struct {
ReferenceNumber ValidString
BankNumber ValidString
}
// A Transfer is logged for every modification of ALL wallets and wallet types
type Transfer struct {
ID int64
Amount Currency
Verified bool
Type TransferType
PaymentMethod PaymentMethod
ReceiverWalletID ValidInt64
SenderWalletID ValidInt64
ReferenceNumber string
CashierID ValidInt64
CreatedAt time.Time
UpdatedAt time.Time
}
type CreateTransfer struct {
Amount Currency
Verified bool
ReferenceNumber string
ReceiverWalletID ValidInt64
SenderWalletID ValidInt64
CashierID ValidInt64
Type TransferType
PaymentMethod PaymentMethod
}