db

package
v1.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 4 Imported by: 26

README

Schema

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignRoleToUserParams

type AssignRoleToUserParams struct {
	UserID int32 `json:"user_id"`
	RoleID int32 `json:"role_id"`
}

type Card

type Card struct {
	CardID       int32        `json:"card_id"`
	UserID       int32        `json:"user_id"`
	CardNumber   string       `json:"card_number"`
	CardType     string       `json:"card_type"`
	ExpireDate   time.Time    `json:"expire_date"`
	Cvv          string       `json:"cvv"`
	CardProvider string       `json:"card_provider"`
	CreatedAt    sql.NullTime `json:"created_at"`
	UpdatedAt    sql.NullTime `json:"updated_at"`
	DeletedAt    sql.NullTime `json:"deleted_at"`
}

type CreateCardParams

type CreateCardParams struct {
	UserID       int32     `json:"user_id"`
	CardNumber   string    `json:"card_number"`
	CardType     string    `json:"card_type"`
	ExpireDate   time.Time `json:"expire_date"`
	Cvv          string    `json:"cvv"`
	CardProvider string    `json:"card_provider"`
}

type CreateMerchantDocumentParams

type CreateMerchantDocumentParams struct {
	MerchantID   int32          `json:"merchant_id"`
	DocumentType string         `json:"document_type"`
	DocumentUrl  string         `json:"document_url"`
	Status       string         `json:"status"`
	Note         sql.NullString `json:"note"`
}

type CreateMerchantParams

type CreateMerchantParams struct {
	Name   string `json:"name"`
	ApiKey string `json:"api_key"`
	UserID int32  `json:"user_id"`
	Status string `json:"status"`
}

type CreateRefreshTokenParams

type CreateRefreshTokenParams struct {
	UserID     int32     `json:"user_id"`
	Token      string    `json:"token"`
	Expiration time.Time `json:"expiration"`
}

type CreateResetTokenParams

type CreateResetTokenParams struct {
	UserID     int64     `json:"user_id"`
	Token      string    `json:"token"`
	ExpiryDate time.Time `json:"expiry_date"`
}

type CreateSaldoParams

type CreateSaldoParams struct {
	CardNumber   string `json:"card_number"`
	TotalBalance int32  `json:"total_balance"`
}

type CreateTopupParams

type CreateTopupParams struct {
	CardNumber  string    `json:"card_number"`
	TopupAmount int32     `json:"topup_amount"`
	TopupMethod string    `json:"topup_method"`
	TopupTime   time.Time `json:"topup_time"`
}

type CreateTransactionParams

type CreateTransactionParams struct {
	CardNumber      string    `json:"card_number"`
	Amount          int32     `json:"amount"`
	PaymentMethod   string    `json:"payment_method"`
	MerchantID      int32     `json:"merchant_id"`
	TransactionTime time.Time `json:"transaction_time"`
}

type CreateTransferParams

type CreateTransferParams struct {
	TransferFrom   string    `json:"transfer_from"`
	TransferTo     string    `json:"transfer_to"`
	TransferAmount int32     `json:"transfer_amount"`
	TransferTime   time.Time `json:"transfer_time"`
	Status         string    `json:"status"`
}

type CreateUserParams

type CreateUserParams struct {
	Firstname        string       `json:"firstname"`
	Lastname         string       `json:"lastname"`
	Email            string       `json:"email"`
	Password         string       `json:"password"`
	VerificationCode string       `json:"verification_code"`
	IsVerified       sql.NullBool `json:"is_verified"`
}

type CreateWithdrawParams

type CreateWithdrawParams struct {
	CardNumber     string       `json:"card_number"`
	WithdrawAmount int32        `json:"withdraw_amount"`
	WithdrawTime   time.Time    `json:"withdraw_time"`
	CreatedAt      sql.NullTime `json:"created_at"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type FindAllTransactionsByApikeyParams

type FindAllTransactionsByApikeyParams struct {
	ApiKey  string `json:"api_key"`
	Column2 string `json:"column_2"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type FindAllTransactionsByApikeyRow

type FindAllTransactionsByApikeyRow struct {
	TransactionID   int32        `json:"transaction_id"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	MerchantName    string       `json:"merchant_name"`
	TransactionTime time.Time    `json:"transaction_time"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
	TotalCount      int64        `json:"total_count"`
}

type FindAllTransactionsByMerchantParams

type FindAllTransactionsByMerchantParams struct {
	MerchantID int32  `json:"merchant_id"`
	Column2    string `json:"column_2"`
	Limit      int32  `json:"limit"`
	Offset     int32  `json:"offset"`
}

type FindAllTransactionsByMerchantRow

type FindAllTransactionsByMerchantRow struct {
	TransactionID   int32        `json:"transaction_id"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	MerchantName    string       `json:"merchant_name"`
	TransactionTime time.Time    `json:"transaction_time"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
	TotalCount      int64        `json:"total_count"`
}

type FindAllTransactionsParams

type FindAllTransactionsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type FindAllTransactionsRow

type FindAllTransactionsRow struct {
	TransactionID   int32        `json:"transaction_id"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	MerchantName    string       `json:"merchant_name"`
	TransactionTime time.Time    `json:"transaction_time"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
	TotalCount      int64        `json:"total_count"`
}

type FindAllTransfersByCardNumberAsReceiverRow

type FindAllTransfersByCardNumberAsReceiverRow struct {
	TransferID     int32        `json:"transfer_id"`
	TransferFrom   string       `json:"transfer_from"`
	TransferTo     string       `json:"transfer_to"`
	TransferAmount int32        `json:"transfer_amount"`
	TransferTime   time.Time    `json:"transfer_time"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
}

type FindAllTransfersByCardNumberAsSenderRow

type FindAllTransfersByCardNumberAsSenderRow struct {
	TransferID     int32        `json:"transfer_id"`
	TransferFrom   string       `json:"transfer_from"`
	TransferTo     string       `json:"transfer_to"`
	TransferAmount int32        `json:"transfer_amount"`
	TransferTime   time.Time    `json:"transfer_time"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
}

type FindAllWithdrawsByCardNumberRow

type FindAllWithdrawsByCardNumberRow struct {
	WithdrawID     int32        `json:"withdraw_id"`
	CardNumber     string       `json:"card_number"`
	WithdrawAmount int32        `json:"withdraw_amount"`
	WithdrawTime   time.Time    `json:"withdraw_time"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
}

type GetActiveCardsWithCountParams

type GetActiveCardsWithCountParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveCardsWithCountRow

type GetActiveCardsWithCountRow struct {
	CardID       int32        `json:"card_id"`
	UserID       int32        `json:"user_id"`
	CardNumber   string       `json:"card_number"`
	CardType     string       `json:"card_type"`
	ExpireDate   time.Time    `json:"expire_date"`
	Cvv          string       `json:"cvv"`
	CardProvider string       `json:"card_provider"`
	CreatedAt    sql.NullTime `json:"created_at"`
	UpdatedAt    sql.NullTime `json:"updated_at"`
	DeletedAt    sql.NullTime `json:"deleted_at"`
	TotalCount   int64        `json:"total_count"`
}

type GetActiveMerchantDocumentsParams

type GetActiveMerchantDocumentsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveMerchantDocumentsRow

type GetActiveMerchantDocumentsRow struct {
	DocumentID   int32          `json:"document_id"`
	MerchantID   int32          `json:"merchant_id"`
	DocumentType string         `json:"document_type"`
	DocumentUrl  string         `json:"document_url"`
	Status       string         `json:"status"`
	Note         sql.NullString `json:"note"`
	UploadedAt   sql.NullTime   `json:"uploaded_at"`
	CreatedAt    sql.NullTime   `json:"created_at"`
	UpdatedAt    sql.NullTime   `json:"updated_at"`
	DeletedAt    sql.NullTime   `json:"deleted_at"`
	TotalCount   int64          `json:"total_count"`
}

type GetActiveMerchantsParams

type GetActiveMerchantsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveMerchantsRow

type GetActiveMerchantsRow struct {
	MerchantID int32        `json:"merchant_id"`
	MerchantNo uuid.UUID    `json:"merchant_no"`
	Name       string       `json:"name"`
	ApiKey     string       `json:"api_key"`
	UserID     int32        `json:"user_id"`
	Status     string       `json:"status"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
	TotalCount int64        `json:"total_count"`
}

type GetActiveRolesParams

type GetActiveRolesParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveRolesRow

type GetActiveRolesRow struct {
	RoleID     int32        `json:"role_id"`
	RoleName   string       `json:"role_name"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
	TotalCount int64        `json:"total_count"`
}

type GetActiveSaldosParams

type GetActiveSaldosParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveSaldosRow

type GetActiveSaldosRow struct {
	SaldoID        int32         `json:"saldo_id"`
	CardNumber     string        `json:"card_number"`
	TotalBalance   int32         `json:"total_balance"`
	WithdrawAmount sql.NullInt32 `json:"withdraw_amount"`
	WithdrawTime   sql.NullTime  `json:"withdraw_time"`
	CreatedAt      sql.NullTime  `json:"created_at"`
	UpdatedAt      sql.NullTime  `json:"updated_at"`
	DeletedAt      sql.NullTime  `json:"deleted_at"`
	TotalCount     int64         `json:"total_count"`
}

type GetActiveTopupsParams

type GetActiveTopupsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveTopupsRow

type GetActiveTopupsRow struct {
	TopupID     int32        `json:"topup_id"`
	TopupNo     uuid.UUID    `json:"topup_no"`
	CardNumber  string       `json:"card_number"`
	TopupAmount int32        `json:"topup_amount"`
	TopupMethod string       `json:"topup_method"`
	TopupTime   time.Time    `json:"topup_time"`
	Status      string       `json:"status"`
	CreatedAt   sql.NullTime `json:"created_at"`
	UpdatedAt   sql.NullTime `json:"updated_at"`
	DeletedAt   sql.NullTime `json:"deleted_at"`
	TotalCount  int64        `json:"total_count"`
}

type GetActiveTransactionsParams

type GetActiveTransactionsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveTransactionsRow

type GetActiveTransactionsRow struct {
	TransactionID   int32        `json:"transaction_id"`
	TransactionNo   uuid.UUID    `json:"transaction_no"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	TransactionTime time.Time    `json:"transaction_time"`
	Status          string       `json:"status"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
	TotalCount      int64        `json:"total_count"`
}

type GetActiveTransfersParams

type GetActiveTransfersParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveTransfersRow

type GetActiveTransfersRow struct {
	TransferID     int32        `json:"transfer_id"`
	TransferNo     uuid.UUID    `json:"transfer_no"`
	TransferFrom   string       `json:"transfer_from"`
	TransferTo     string       `json:"transfer_to"`
	TransferAmount int32        `json:"transfer_amount"`
	TransferTime   time.Time    `json:"transfer_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
	TotalCount     int64        `json:"total_count"`
}

type GetActiveUsersWithPaginationParams

type GetActiveUsersWithPaginationParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveUsersWithPaginationRow

type GetActiveUsersWithPaginationRow struct {
	UserID           int32        `json:"user_id"`
	Firstname        string       `json:"firstname"`
	Lastname         string       `json:"lastname"`
	Email            string       `json:"email"`
	Password         string       `json:"password"`
	VerificationCode string       `json:"verification_code"`
	IsVerified       sql.NullBool `json:"is_verified"`
	CreatedAt        sql.NullTime `json:"created_at"`
	UpdatedAt        sql.NullTime `json:"updated_at"`
	DeletedAt        sql.NullTime `json:"deleted_at"`
	TotalCount       int64        `json:"total_count"`
}

type GetActiveWithdrawsParams

type GetActiveWithdrawsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetActiveWithdrawsRow

type GetActiveWithdrawsRow struct {
	WithdrawID     int32        `json:"withdraw_id"`
	WithdrawNo     uuid.UUID    `json:"withdraw_no"`
	CardNumber     string       `json:"card_number"`
	WithdrawAmount int32        `json:"withdraw_amount"`
	WithdrawTime   time.Time    `json:"withdraw_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
	TotalCount     int64        `json:"total_count"`
}

type GetCardsParams

type GetCardsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetCardsRow

type GetCardsRow struct {
	CardID       int32        `json:"card_id"`
	UserID       int32        `json:"user_id"`
	CardNumber   string       `json:"card_number"`
	CardType     string       `json:"card_type"`
	ExpireDate   time.Time    `json:"expire_date"`
	Cvv          string       `json:"cvv"`
	CardProvider string       `json:"card_provider"`
	CreatedAt    sql.NullTime `json:"created_at"`
	UpdatedAt    sql.NullTime `json:"updated_at"`
	DeletedAt    sql.NullTime `json:"deleted_at"`
	TotalCount   int64        `json:"total_count"`
}

type GetMerchantDocumentsParams

type GetMerchantDocumentsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetMerchantDocumentsRow

type GetMerchantDocumentsRow struct {
	DocumentID   int32          `json:"document_id"`
	MerchantID   int32          `json:"merchant_id"`
	DocumentType string         `json:"document_type"`
	DocumentUrl  string         `json:"document_url"`
	Status       string         `json:"status"`
	Note         sql.NullString `json:"note"`
	UploadedAt   sql.NullTime   `json:"uploaded_at"`
	CreatedAt    sql.NullTime   `json:"created_at"`
	UpdatedAt    sql.NullTime   `json:"updated_at"`
	DeletedAt    sql.NullTime   `json:"deleted_at"`
	TotalCount   int64          `json:"total_count"`
}

type GetMerchantsParams

type GetMerchantsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetMerchantsRow

type GetMerchantsRow struct {
	MerchantID int32        `json:"merchant_id"`
	MerchantNo uuid.UUID    `json:"merchant_no"`
	Name       string       `json:"name"`
	ApiKey     string       `json:"api_key"`
	UserID     int32        `json:"user_id"`
	Status     string       `json:"status"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
	TotalCount int64        `json:"total_count"`
}

type GetMonthTopupStatusFailedCardNumberParams

type GetMonthTopupStatusFailedCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
	Column3    time.Time `json:"column_3"`
	Column4    time.Time `json:"column_4"`
	Column5    time.Time `json:"column_5"`
}

type GetMonthTopupStatusFailedCardNumberRow

type GetMonthTopupStatusFailedCardNumberRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalFailed int64  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthTopupStatusFailedParams

type GetMonthTopupStatusFailedParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthTopupStatusFailedRow

type GetMonthTopupStatusFailedRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalFailed int64  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthTopupStatusSuccessCardNumberParams

type GetMonthTopupStatusSuccessCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
	Column3    time.Time `json:"column_3"`
	Column4    time.Time `json:"column_4"`
	Column5    time.Time `json:"column_5"`
}

type GetMonthTopupStatusSuccessCardNumberRow

type GetMonthTopupStatusSuccessCardNumberRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalSuccess int64  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetMonthTopupStatusSuccessParams

type GetMonthTopupStatusSuccessParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthTopupStatusSuccessRow

type GetMonthTopupStatusSuccessRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalSuccess int64  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetMonthTransactionStatusFailedCardNumberParams

type GetMonthTransactionStatusFailedCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
	Column3    time.Time `json:"column_3"`
	Column4    time.Time `json:"column_4"`
	Column5    time.Time `json:"column_5"`
}

type GetMonthTransactionStatusFailedCardNumberRow

type GetMonthTransactionStatusFailedCardNumberRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalFailed int64  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthTransactionStatusFailedParams

type GetMonthTransactionStatusFailedParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthTransactionStatusFailedRow

type GetMonthTransactionStatusFailedRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalFailed int64  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthTransactionStatusSuccessCardNumberParams

type GetMonthTransactionStatusSuccessCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
	Column3    time.Time `json:"column_3"`
	Column4    time.Time `json:"column_4"`
	Column5    time.Time `json:"column_5"`
}

type GetMonthTransactionStatusSuccessCardNumberRow

type GetMonthTransactionStatusSuccessCardNumberRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalSuccess int64  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetMonthTransactionStatusSuccessParams

type GetMonthTransactionStatusSuccessParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthTransactionStatusSuccessRow

type GetMonthTransactionStatusSuccessRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalSuccess int64  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetMonthTransferStatusFailedCardNumberParams

type GetMonthTransferStatusFailedCardNumberParams struct {
	TransferFrom string    `json:"transfer_from"`
	Column2      time.Time `json:"column_2"`
	Column3      time.Time `json:"column_3"`
	Column4      time.Time `json:"column_4"`
	Column5      time.Time `json:"column_5"`
}

type GetMonthTransferStatusFailedCardNumberRow

type GetMonthTransferStatusFailedCardNumberRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalFailed int64  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthTransferStatusFailedParams

type GetMonthTransferStatusFailedParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthTransferStatusFailedRow

type GetMonthTransferStatusFailedRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalFailed int64  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthTransferStatusSuccessCardNumberParams

type GetMonthTransferStatusSuccessCardNumberParams struct {
	TransferFrom string    `json:"transfer_from"`
	Column2      time.Time `json:"column_2"`
	Column3      time.Time `json:"column_3"`
	Column4      time.Time `json:"column_4"`
	Column5      time.Time `json:"column_5"`
}

type GetMonthTransferStatusSuccessCardNumberRow

type GetMonthTransferStatusSuccessCardNumberRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalSuccess int64  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetMonthTransferStatusSuccessParams

type GetMonthTransferStatusSuccessParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthTransferStatusSuccessRow

type GetMonthTransferStatusSuccessRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalSuccess int64  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetMonthWithdrawStatusFailedCardNumberParams

type GetMonthWithdrawStatusFailedCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
	Column3    time.Time `json:"column_3"`
	Column4    time.Time `json:"column_4"`
	Column5    time.Time `json:"column_5"`
}

type GetMonthWithdrawStatusFailedCardNumberRow

type GetMonthWithdrawStatusFailedCardNumberRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalFailed int64  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthWithdrawStatusFailedParams

type GetMonthWithdrawStatusFailedParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthWithdrawStatusFailedRow

type GetMonthWithdrawStatusFailedRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalFailed int64  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthWithdrawStatusSuccessCardNumberParams

type GetMonthWithdrawStatusSuccessCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
	Column3    time.Time `json:"column_3"`
	Column4    time.Time `json:"column_4"`
	Column5    time.Time `json:"column_5"`
}

type GetMonthWithdrawStatusSuccessCardNumberRow

type GetMonthWithdrawStatusSuccessCardNumberRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalSuccess int64  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetMonthWithdrawStatusSuccessParams

type GetMonthWithdrawStatusSuccessParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthWithdrawStatusSuccessRow

type GetMonthWithdrawStatusSuccessRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalSuccess int64  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetMonthlyAmountByApikeyParams

type GetMonthlyAmountByApikeyParams struct {
	Column1 time.Time `json:"column_1"`
	ApiKey  string    `json:"api_key"`
}

type GetMonthlyAmountByApikeyRow

type GetMonthlyAmountByApikeyRow struct {
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyAmountByMerchantsParams

type GetMonthlyAmountByMerchantsParams struct {
	Column1    time.Time `json:"column_1"`
	MerchantID int32     `json:"merchant_id"`
}

type GetMonthlyAmountByMerchantsRow

type GetMonthlyAmountByMerchantsRow struct {
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyAmountMerchantRow

type GetMonthlyAmountMerchantRow struct {
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyAmountsByCardNumberParams

type GetMonthlyAmountsByCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyAmountsByCardNumberRow

type GetMonthlyAmountsByCardNumberRow struct {
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyAmountsRow

type GetMonthlyAmountsRow struct {
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyBalancesByCardNumberParams

type GetMonthlyBalancesByCardNumberParams struct {
	Column1    time.Time `json:"column_1"`
	CardNumber string    `json:"card_number"`
}

type GetMonthlyBalancesByCardNumberRow

type GetMonthlyBalancesByCardNumberRow struct {
	Month        string `json:"month"`
	TotalBalance int32  `json:"total_balance"`
}

type GetMonthlyBalancesRow

type GetMonthlyBalancesRow struct {
	Month        string `json:"month"`
	TotalBalance int32  `json:"total_balance"`
}

type GetMonthlyPaymentMethodByApikeyParams

type GetMonthlyPaymentMethodByApikeyParams struct {
	Column1 time.Time `json:"column_1"`
	ApiKey  string    `json:"api_key"`
}

type GetMonthlyPaymentMethodByApikeyRow

type GetMonthlyPaymentMethodByApikeyRow struct {
	Month         string `json:"month"`
	PaymentMethod string `json:"payment_method"`
	TotalAmount   int32  `json:"total_amount"`
}

type GetMonthlyPaymentMethodByMerchantsParams

type GetMonthlyPaymentMethodByMerchantsParams struct {
	Column1    time.Time `json:"column_1"`
	MerchantID int32     `json:"merchant_id"`
}

type GetMonthlyPaymentMethodByMerchantsRow

type GetMonthlyPaymentMethodByMerchantsRow struct {
	Month         string `json:"month"`
	PaymentMethod string `json:"payment_method"`
	TotalAmount   int32  `json:"total_amount"`
}

type GetMonthlyPaymentMethodsByCardNumberParams

type GetMonthlyPaymentMethodsByCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyPaymentMethodsByCardNumberRow

type GetMonthlyPaymentMethodsByCardNumberRow struct {
	Month             string `json:"month"`
	PaymentMethod     string `json:"payment_method"`
	TotalTransactions int32  `json:"total_transactions"`
	TotalAmount       int32  `json:"total_amount"`
}

type GetMonthlyPaymentMethodsMerchantRow

type GetMonthlyPaymentMethodsMerchantRow struct {
	Month         string `json:"month"`
	PaymentMethod string `json:"payment_method"`
	TotalAmount   int32  `json:"total_amount"`
}

type GetMonthlyPaymentMethodsRow

type GetMonthlyPaymentMethodsRow struct {
	Month             string `json:"month"`
	PaymentMethod     string `json:"payment_method"`
	TotalTransactions int32  `json:"total_transactions"`
	TotalAmount       int32  `json:"total_amount"`
}

type GetMonthlySaldoBalancesRow

type GetMonthlySaldoBalancesRow struct {
	Month        string `json:"month"`
	TotalBalance int32  `json:"total_balance"`
}

type GetMonthlyTopupAmountByCardNumberParams

type GetMonthlyTopupAmountByCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyTopupAmountByCardNumberRow

type GetMonthlyTopupAmountByCardNumberRow struct {
	Month            string `json:"month"`
	TotalTopupAmount int32  `json:"total_topup_amount"`
}

type GetMonthlyTopupAmountRow

type GetMonthlyTopupAmountRow struct {
	Month            string `json:"month"`
	TotalTopupAmount int32  `json:"total_topup_amount"`
}

type GetMonthlyTopupAmountsByCardNumberParams

type GetMonthlyTopupAmountsByCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyTopupAmountsByCardNumberRow

type GetMonthlyTopupAmountsByCardNumberRow struct {
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyTopupAmountsRow

type GetMonthlyTopupAmountsRow struct {
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyTopupMethodsByCardNumberParams

type GetMonthlyTopupMethodsByCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyTopupMethodsByCardNumberRow

type GetMonthlyTopupMethodsByCardNumberRow struct {
	Month       string `json:"month"`
	TopupMethod string `json:"topup_method"`
	TotalTopups int32  `json:"total_topups"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyTopupMethodsRow

type GetMonthlyTopupMethodsRow struct {
	Month       string `json:"month"`
	TopupMethod string `json:"topup_method"`
	TotalTopups int32  `json:"total_topups"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyTotalAmountByApikeyParams

type GetMonthlyTotalAmountByApikeyParams struct {
	Column1 time.Time `json:"column_1"`
	ApiKey  string    `json:"api_key"`
}

type GetMonthlyTotalAmountByApikeyRow

type GetMonthlyTotalAmountByApikeyRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyTotalAmountByMerchantParams

type GetMonthlyTotalAmountByMerchantParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 int32     `json:"column_2"`
}

type GetMonthlyTotalAmountByMerchantRow

type GetMonthlyTotalAmountByMerchantRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyTotalAmountMerchantRow

type GetMonthlyTotalAmountMerchantRow struct {
	Year        string `json:"year"`
	Month       string `json:"month"`
	TotalAmount int32  `json:"total_amount"`
}

type GetMonthlyTotalSaldoBalanceParams

type GetMonthlyTotalSaldoBalanceParams struct {
	Column1 time.Time `json:"column_1"`
	Column2 time.Time `json:"column_2"`
	Column3 time.Time `json:"column_3"`
	Column4 time.Time `json:"column_4"`
}

type GetMonthlyTotalSaldoBalanceRow

type GetMonthlyTotalSaldoBalanceRow struct {
	Year         string `json:"year"`
	Month        string `json:"month"`
	TotalBalance int32  `json:"total_balance"`
}

type GetMonthlyTransactionAmountByCardNumberParams

type GetMonthlyTransactionAmountByCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyTransactionAmountByCardNumberRow

type GetMonthlyTransactionAmountByCardNumberRow struct {
	Month                  string `json:"month"`
	TotalTransactionAmount int32  `json:"total_transaction_amount"`
}

type GetMonthlyTransactionAmountRow

type GetMonthlyTransactionAmountRow struct {
	Month                  string `json:"month"`
	TotalTransactionAmount int32  `json:"total_transaction_amount"`
}

type GetMonthlyTransferAmountByReceiverParams

type GetMonthlyTransferAmountByReceiverParams struct {
	TransferTo string    `json:"transfer_to"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyTransferAmountByReceiverRow

type GetMonthlyTransferAmountByReceiverRow struct {
	Month               string `json:"month"`
	TotalReceivedAmount int32  `json:"total_received_amount"`
}

type GetMonthlyTransferAmountBySenderParams

type GetMonthlyTransferAmountBySenderParams struct {
	TransferFrom string    `json:"transfer_from"`
	Column2      time.Time `json:"column_2"`
}

type GetMonthlyTransferAmountBySenderRow

type GetMonthlyTransferAmountBySenderRow struct {
	Month           string `json:"month"`
	TotalSentAmount int32  `json:"total_sent_amount"`
}

type GetMonthlyTransferAmountReceiverRow

type GetMonthlyTransferAmountReceiverRow struct {
	Month               string `json:"month"`
	TotalReceivedAmount int32  `json:"total_received_amount"`
}

type GetMonthlyTransferAmountSenderRow

type GetMonthlyTransferAmountSenderRow struct {
	Month           string `json:"month"`
	TotalSentAmount int32  `json:"total_sent_amount"`
}

type GetMonthlyTransferAmountsByReceiverCardNumberParams

type GetMonthlyTransferAmountsByReceiverCardNumberParams struct {
	TransferTo string    `json:"transfer_to"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyTransferAmountsByReceiverCardNumberRow

type GetMonthlyTransferAmountsByReceiverCardNumberRow struct {
	Month               string `json:"month"`
	TotalTransferAmount int32  `json:"total_transfer_amount"`
}

type GetMonthlyTransferAmountsBySenderCardNumberParams

type GetMonthlyTransferAmountsBySenderCardNumberParams struct {
	TransferFrom string    `json:"transfer_from"`
	Column2      time.Time `json:"column_2"`
}

type GetMonthlyTransferAmountsBySenderCardNumberRow

type GetMonthlyTransferAmountsBySenderCardNumberRow struct {
	Month               string `json:"month"`
	TotalTransferAmount int32  `json:"total_transfer_amount"`
}

type GetMonthlyTransferAmountsRow

type GetMonthlyTransferAmountsRow struct {
	Month               string `json:"month"`
	TotalTransferAmount int32  `json:"total_transfer_amount"`
}

type GetMonthlyWithdrawAmountByCardNumberParams

type GetMonthlyWithdrawAmountByCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyWithdrawAmountByCardNumberRow

type GetMonthlyWithdrawAmountByCardNumberRow struct {
	Month               string `json:"month"`
	TotalWithdrawAmount int32  `json:"total_withdraw_amount"`
}

type GetMonthlyWithdrawAmountRow

type GetMonthlyWithdrawAmountRow struct {
	Month               string `json:"month"`
	TotalWithdrawAmount int32  `json:"total_withdraw_amount"`
}

type GetMonthlyWithdrawsByCardNumberParams

type GetMonthlyWithdrawsByCardNumberParams struct {
	CardNumber string    `json:"card_number"`
	Column2    time.Time `json:"column_2"`
}

type GetMonthlyWithdrawsByCardNumberRow

type GetMonthlyWithdrawsByCardNumberRow struct {
	Month               string `json:"month"`
	TotalWithdrawAmount int32  `json:"total_withdraw_amount"`
}

type GetMonthlyWithdrawsRow

type GetMonthlyWithdrawsRow struct {
	Month               string `json:"month"`
	TotalWithdrawAmount int32  `json:"total_withdraw_amount"`
}

type GetRolesParams

type GetRolesParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetRolesRow

type GetRolesRow struct {
	RoleID     int32        `json:"role_id"`
	RoleName   string       `json:"role_name"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
	TotalCount int64        `json:"total_count"`
}

type GetSaldosParams

type GetSaldosParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetSaldosRow

type GetSaldosRow struct {
	SaldoID        int32         `json:"saldo_id"`
	CardNumber     string        `json:"card_number"`
	TotalBalance   int32         `json:"total_balance"`
	WithdrawAmount sql.NullInt32 `json:"withdraw_amount"`
	WithdrawTime   sql.NullTime  `json:"withdraw_time"`
	CreatedAt      sql.NullTime  `json:"created_at"`
	UpdatedAt      sql.NullTime  `json:"updated_at"`
	DeletedAt      sql.NullTime  `json:"deleted_at"`
	TotalCount     int64         `json:"total_count"`
}

type GetTopupsByCardNumberParams

type GetTopupsByCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    string `json:"column_2"`
	Limit      int32  `json:"limit"`
	Offset     int32  `json:"offset"`
}

type GetTopupsByCardNumberRow

type GetTopupsByCardNumberRow struct {
	TopupID     int32        `json:"topup_id"`
	TopupNo     uuid.UUID    `json:"topup_no"`
	CardNumber  string       `json:"card_number"`
	TopupAmount int32        `json:"topup_amount"`
	TopupMethod string       `json:"topup_method"`
	TopupTime   time.Time    `json:"topup_time"`
	Status      string       `json:"status"`
	CreatedAt   sql.NullTime `json:"created_at"`
	UpdatedAt   sql.NullTime `json:"updated_at"`
	DeletedAt   sql.NullTime `json:"deleted_at"`
	TotalCount  int64        `json:"total_count"`
}

type GetTopupsParams

type GetTopupsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTopupsRow

type GetTopupsRow struct {
	TopupID     int32        `json:"topup_id"`
	TopupNo     uuid.UUID    `json:"topup_no"`
	CardNumber  string       `json:"card_number"`
	TopupAmount int32        `json:"topup_amount"`
	TopupMethod string       `json:"topup_method"`
	TopupTime   time.Time    `json:"topup_time"`
	Status      string       `json:"status"`
	CreatedAt   sql.NullTime `json:"created_at"`
	UpdatedAt   sql.NullTime `json:"updated_at"`
	DeletedAt   sql.NullTime `json:"deleted_at"`
	TotalCount  int64        `json:"total_count"`
}

type GetTransactionByCardNumberParams

type GetTransactionByCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    string `json:"column_2"`
	Limit      int32  `json:"limit"`
	Offset     int32  `json:"offset"`
}

type GetTransactionByCardNumberRow

type GetTransactionByCardNumberRow struct {
	TransactionID   int32        `json:"transaction_id"`
	TransactionNo   uuid.UUID    `json:"transaction_no"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	TransactionTime time.Time    `json:"transaction_time"`
	Status          string       `json:"status"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
	TotalCount      int64        `json:"total_count"`
}

type GetTransactionsByCardNumberParams

type GetTransactionsByCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    string `json:"column_2"`
	Limit      int32  `json:"limit"`
	Offset     int32  `json:"offset"`
}

type GetTransactionsByCardNumberRow

type GetTransactionsByCardNumberRow struct {
	TransactionID   int32        `json:"transaction_id"`
	TransactionNo   uuid.UUID    `json:"transaction_no"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	TransactionTime time.Time    `json:"transaction_time"`
	Status          string       `json:"status"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
	TotalCount      int64        `json:"total_count"`
}

type GetTransactionsParams

type GetTransactionsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTransactionsRow

type GetTransactionsRow struct {
	TransactionID   int32        `json:"transaction_id"`
	TransactionNo   uuid.UUID    `json:"transaction_no"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	TransactionTime time.Time    `json:"transaction_time"`
	Status          string       `json:"status"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
	TotalCount      int64        `json:"total_count"`
}

type GetTransfersParams

type GetTransfersParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTransfersRow

type GetTransfersRow struct {
	TransferID     int32        `json:"transfer_id"`
	TransferNo     uuid.UUID    `json:"transfer_no"`
	TransferFrom   string       `json:"transfer_from"`
	TransferTo     string       `json:"transfer_to"`
	TransferAmount int32        `json:"transfer_amount"`
	TransferTime   time.Time    `json:"transfer_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
	TotalCount     int64        `json:"total_count"`
}

type GetTrashedCardsWithCountParams

type GetTrashedCardsWithCountParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedCardsWithCountRow

type GetTrashedCardsWithCountRow struct {
	CardID       int32        `json:"card_id"`
	UserID       int32        `json:"user_id"`
	CardNumber   string       `json:"card_number"`
	CardType     string       `json:"card_type"`
	ExpireDate   time.Time    `json:"expire_date"`
	Cvv          string       `json:"cvv"`
	CardProvider string       `json:"card_provider"`
	CreatedAt    sql.NullTime `json:"created_at"`
	UpdatedAt    sql.NullTime `json:"updated_at"`
	DeletedAt    sql.NullTime `json:"deleted_at"`
	TotalCount   int64        `json:"total_count"`
}

type GetTrashedMerchantDocumentsParams

type GetTrashedMerchantDocumentsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedMerchantDocumentsRow

type GetTrashedMerchantDocumentsRow struct {
	DocumentID   int32          `json:"document_id"`
	MerchantID   int32          `json:"merchant_id"`
	DocumentType string         `json:"document_type"`
	DocumentUrl  string         `json:"document_url"`
	Status       string         `json:"status"`
	Note         sql.NullString `json:"note"`
	UploadedAt   sql.NullTime   `json:"uploaded_at"`
	CreatedAt    sql.NullTime   `json:"created_at"`
	UpdatedAt    sql.NullTime   `json:"updated_at"`
	DeletedAt    sql.NullTime   `json:"deleted_at"`
	TotalCount   int64          `json:"total_count"`
}

type GetTrashedMerchantsParams

type GetTrashedMerchantsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedMerchantsRow

type GetTrashedMerchantsRow struct {
	MerchantID int32        `json:"merchant_id"`
	MerchantNo uuid.UUID    `json:"merchant_no"`
	Name       string       `json:"name"`
	ApiKey     string       `json:"api_key"`
	UserID     int32        `json:"user_id"`
	Status     string       `json:"status"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
	TotalCount int64        `json:"total_count"`
}

type GetTrashedRolesParams

type GetTrashedRolesParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedRolesRow

type GetTrashedRolesRow struct {
	RoleID     int32        `json:"role_id"`
	RoleName   string       `json:"role_name"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
	TotalCount int64        `json:"total_count"`
}

type GetTrashedSaldosParams

type GetTrashedSaldosParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedSaldosRow

type GetTrashedSaldosRow struct {
	SaldoID        int32         `json:"saldo_id"`
	CardNumber     string        `json:"card_number"`
	TotalBalance   int32         `json:"total_balance"`
	WithdrawAmount sql.NullInt32 `json:"withdraw_amount"`
	WithdrawTime   sql.NullTime  `json:"withdraw_time"`
	CreatedAt      sql.NullTime  `json:"created_at"`
	UpdatedAt      sql.NullTime  `json:"updated_at"`
	DeletedAt      sql.NullTime  `json:"deleted_at"`
	TotalCount     int64         `json:"total_count"`
}

type GetTrashedTopupsParams

type GetTrashedTopupsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedTopupsRow

type GetTrashedTopupsRow struct {
	TopupID     int32        `json:"topup_id"`
	TopupNo     uuid.UUID    `json:"topup_no"`
	CardNumber  string       `json:"card_number"`
	TopupAmount int32        `json:"topup_amount"`
	TopupMethod string       `json:"topup_method"`
	TopupTime   time.Time    `json:"topup_time"`
	Status      string       `json:"status"`
	CreatedAt   sql.NullTime `json:"created_at"`
	UpdatedAt   sql.NullTime `json:"updated_at"`
	DeletedAt   sql.NullTime `json:"deleted_at"`
	TotalCount  int64        `json:"total_count"`
}

type GetTrashedTransactionsParams

type GetTrashedTransactionsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedTransactionsRow

type GetTrashedTransactionsRow struct {
	TransactionID   int32        `json:"transaction_id"`
	TransactionNo   uuid.UUID    `json:"transaction_no"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	TransactionTime time.Time    `json:"transaction_time"`
	Status          string       `json:"status"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
	TotalCount      int64        `json:"total_count"`
}

type GetTrashedTransfersParams

type GetTrashedTransfersParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedTransfersRow

type GetTrashedTransfersRow struct {
	TransferID     int32        `json:"transfer_id"`
	TransferNo     uuid.UUID    `json:"transfer_no"`
	TransferFrom   string       `json:"transfer_from"`
	TransferTo     string       `json:"transfer_to"`
	TransferAmount int32        `json:"transfer_amount"`
	TransferTime   time.Time    `json:"transfer_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
	TotalCount     int64        `json:"total_count"`
}

type GetTrashedUserRolesRow

type GetTrashedUserRolesRow struct {
	UserRoleID int32        `json:"user_role_id"`
	UserID     int32        `json:"user_id"`
	RoleID     int32        `json:"role_id"`
	RoleName   string       `json:"role_name"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
}

type GetTrashedUsersWithPaginationParams

type GetTrashedUsersWithPaginationParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedUsersWithPaginationRow

type GetTrashedUsersWithPaginationRow struct {
	UserID           int32        `json:"user_id"`
	Firstname        string       `json:"firstname"`
	Lastname         string       `json:"lastname"`
	Email            string       `json:"email"`
	Password         string       `json:"password"`
	VerificationCode string       `json:"verification_code"`
	IsVerified       sql.NullBool `json:"is_verified"`
	CreatedAt        sql.NullTime `json:"created_at"`
	UpdatedAt        sql.NullTime `json:"updated_at"`
	DeletedAt        sql.NullTime `json:"deleted_at"`
	TotalCount       int64        `json:"total_count"`
}

type GetTrashedWithdrawsParams

type GetTrashedWithdrawsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetTrashedWithdrawsRow

type GetTrashedWithdrawsRow struct {
	WithdrawID     int32        `json:"withdraw_id"`
	WithdrawNo     uuid.UUID    `json:"withdraw_no"`
	CardNumber     string       `json:"card_number"`
	WithdrawAmount int32        `json:"withdraw_amount"`
	WithdrawTime   time.Time    `json:"withdraw_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
	TotalCount     int64        `json:"total_count"`
}

type GetUserEmailByCardNumberRow

type GetUserEmailByCardNumberRow struct {
	CardID       int32        `json:"card_id"`
	Email        string       `json:"email"`
	UserID       int32        `json:"user_id"`
	CardNumber   string       `json:"card_number"`
	CardType     string       `json:"card_type"`
	ExpireDate   time.Time    `json:"expire_date"`
	Cvv          string       `json:"cvv"`
	CardProvider string       `json:"card_provider"`
	CreatedAt    sql.NullTime `json:"created_at"`
	UpdatedAt    sql.NullTime `json:"updated_at"`
}

type GetUsersWithPaginationParams

type GetUsersWithPaginationParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetUsersWithPaginationRow

type GetUsersWithPaginationRow struct {
	UserID           int32        `json:"user_id"`
	Firstname        string       `json:"firstname"`
	Lastname         string       `json:"lastname"`
	Email            string       `json:"email"`
	Password         string       `json:"password"`
	VerificationCode string       `json:"verification_code"`
	IsVerified       sql.NullBool `json:"is_verified"`
	CreatedAt        sql.NullTime `json:"created_at"`
	UpdatedAt        sql.NullTime `json:"updated_at"`
	DeletedAt        sql.NullTime `json:"deleted_at"`
	TotalCount       int64        `json:"total_count"`
}

type GetWithdrawsByCardNumberParams

type GetWithdrawsByCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    string `json:"column_2"`
	Limit      int32  `json:"limit"`
	Offset     int32  `json:"offset"`
}

type GetWithdrawsByCardNumberRow

type GetWithdrawsByCardNumberRow struct {
	WithdrawID     int32        `json:"withdraw_id"`
	WithdrawNo     uuid.UUID    `json:"withdraw_no"`
	CardNumber     string       `json:"card_number"`
	WithdrawAmount int32        `json:"withdraw_amount"`
	WithdrawTime   time.Time    `json:"withdraw_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
	TotalCount     int64        `json:"total_count"`
}

type GetWithdrawsParams

type GetWithdrawsParams struct {
	Column1 string `json:"column_1"`
	Limit   int32  `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetWithdrawsRow

type GetWithdrawsRow struct {
	WithdrawID     int32        `json:"withdraw_id"`
	WithdrawNo     uuid.UUID    `json:"withdraw_no"`
	CardNumber     string       `json:"card_number"`
	WithdrawAmount int32        `json:"withdraw_amount"`
	WithdrawTime   time.Time    `json:"withdraw_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
	TotalCount     int64        `json:"total_count"`
}

type GetYearlyAmountByApikeyParams

type GetYearlyAmountByApikeyParams struct {
	ApiKey  string      `json:"api_key"`
	Column2 interface{} `json:"column_2"`
}

type GetYearlyAmountByApikeyRow

type GetYearlyAmountByApikeyRow struct {
	Year        string `json:"year"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyAmountByMerchantsParams

type GetYearlyAmountByMerchantsParams struct {
	MerchantID int32       `json:"merchant_id"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyAmountByMerchantsRow

type GetYearlyAmountByMerchantsRow struct {
	Year        string `json:"year"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyAmountMerchantRow

type GetYearlyAmountMerchantRow struct {
	Year        string `json:"year"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyAmountsByCardNumberParams

type GetYearlyAmountsByCardNumberParams struct {
	CardNumber string      `json:"card_number"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyAmountsByCardNumberRow

type GetYearlyAmountsByCardNumberRow struct {
	Year        string `json:"year"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyAmountsRow

type GetYearlyAmountsRow struct {
	Year        string `json:"year"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyBalancesByCardNumberParams

type GetYearlyBalancesByCardNumberParams struct {
	Column1    interface{} `json:"column_1"`
	CardNumber string      `json:"card_number"`
}

type GetYearlyBalancesByCardNumberRow

type GetYearlyBalancesByCardNumberRow struct {
	Year         string `json:"year"`
	TotalBalance int64  `json:"total_balance"`
}

type GetYearlyBalancesRow

type GetYearlyBalancesRow struct {
	Year         string `json:"year"`
	TotalBalance int64  `json:"total_balance"`
}

type GetYearlyPaymentMethodByApikeyParams

type GetYearlyPaymentMethodByApikeyParams struct {
	ApiKey  string      `json:"api_key"`
	Column2 interface{} `json:"column_2"`
}

type GetYearlyPaymentMethodByApikeyRow

type GetYearlyPaymentMethodByApikeyRow struct {
	Year          string `json:"year"`
	PaymentMethod string `json:"payment_method"`
	TotalAmount   int64  `json:"total_amount"`
}

type GetYearlyPaymentMethodByMerchantsParams

type GetYearlyPaymentMethodByMerchantsParams struct {
	MerchantID int32       `json:"merchant_id"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyPaymentMethodByMerchantsRow

type GetYearlyPaymentMethodByMerchantsRow struct {
	Year          string `json:"year"`
	PaymentMethod string `json:"payment_method"`
	TotalAmount   int64  `json:"total_amount"`
}

type GetYearlyPaymentMethodMerchantRow

type GetYearlyPaymentMethodMerchantRow struct {
	Year          string `json:"year"`
	PaymentMethod string `json:"payment_method"`
	TotalAmount   int64  `json:"total_amount"`
}

type GetYearlyPaymentMethodsByCardNumberParams

type GetYearlyPaymentMethodsByCardNumberParams struct {
	CardNumber string      `json:"card_number"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyPaymentMethodsByCardNumberRow

type GetYearlyPaymentMethodsByCardNumberRow struct {
	Year              string `json:"year"`
	PaymentMethod     string `json:"payment_method"`
	TotalTransactions int64  `json:"total_transactions"`
	TotalAmount       int64  `json:"total_amount"`
}

type GetYearlyPaymentMethodsRow

type GetYearlyPaymentMethodsRow struct {
	Year              string `json:"year"`
	PaymentMethod     string `json:"payment_method"`
	TotalTransactions int64  `json:"total_transactions"`
	TotalAmount       int64  `json:"total_amount"`
}

type GetYearlySaldoBalancesRow

type GetYearlySaldoBalancesRow struct {
	Year         string `json:"year"`
	TotalBalance int64  `json:"total_balance"`
}

type GetYearlyTopupAmountByCardNumberParams

type GetYearlyTopupAmountByCardNumberParams struct {
	CardNumber string      `json:"card_number"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyTopupAmountByCardNumberRow

type GetYearlyTopupAmountByCardNumberRow struct {
	Year             string `json:"year"`
	TotalTopupAmount int64  `json:"total_topup_amount"`
}

type GetYearlyTopupAmountRow

type GetYearlyTopupAmountRow struct {
	Year             string `json:"year"`
	TotalTopupAmount int64  `json:"total_topup_amount"`
}

type GetYearlyTopupAmountsByCardNumberParams

type GetYearlyTopupAmountsByCardNumberParams struct {
	CardNumber string      `json:"card_number"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyTopupAmountsByCardNumberRow

type GetYearlyTopupAmountsByCardNumberRow struct {
	Year        string `json:"year"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyTopupAmountsRow

type GetYearlyTopupAmountsRow struct {
	Year        string `json:"year"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyTopupMethodsByCardNumberParams

type GetYearlyTopupMethodsByCardNumberParams struct {
	CardNumber string      `json:"card_number"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyTopupMethodsByCardNumberRow

type GetYearlyTopupMethodsByCardNumberRow struct {
	Year        string `json:"year"`
	TopupMethod string `json:"topup_method"`
	TotalTopups int64  `json:"total_topups"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyTopupMethodsRow

type GetYearlyTopupMethodsRow struct {
	Year        string `json:"year"`
	TopupMethod string `json:"topup_method"`
	TotalTopups int64  `json:"total_topups"`
	TotalAmount int64  `json:"total_amount"`
}

type GetYearlyTopupStatusFailedCardNumberParams

type GetYearlyTopupStatusFailedCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    int32  `json:"column_2"`
}

type GetYearlyTopupStatusFailedCardNumberRow

type GetYearlyTopupStatusFailedCardNumberRow struct {
	Year        string `json:"year"`
	TotalFailed int32  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTopupStatusFailedRow

type GetYearlyTopupStatusFailedRow struct {
	Year        string `json:"year"`
	TotalFailed int32  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTopupStatusSuccessCardNumberParams

type GetYearlyTopupStatusSuccessCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    int32  `json:"column_2"`
}

type GetYearlyTopupStatusSuccessCardNumberRow

type GetYearlyTopupStatusSuccessCardNumberRow struct {
	Year         string `json:"year"`
	TotalSuccess int32  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetYearlyTopupStatusSuccessRow

type GetYearlyTopupStatusSuccessRow struct {
	Year         string `json:"year"`
	TotalSuccess int32  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetYearlyTotalAmountByApikeyParams

type GetYearlyTotalAmountByApikeyParams struct {
	Column1 int32  `json:"column_1"`
	ApiKey  string `json:"api_key"`
}

type GetYearlyTotalAmountByApikeyRow

type GetYearlyTotalAmountByApikeyRow struct {
	Year        string `json:"year"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTotalAmountByMerchantParams

type GetYearlyTotalAmountByMerchantParams struct {
	Column1 int32 `json:"column_1"`
	Column2 int32 `json:"column_2"`
}

type GetYearlyTotalAmountByMerchantRow

type GetYearlyTotalAmountByMerchantRow struct {
	Year        string `json:"year"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTotalAmountMerchantRow

type GetYearlyTotalAmountMerchantRow struct {
	Year        string `json:"year"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTotalSaldoBalancesRow

type GetYearlyTotalSaldoBalancesRow struct {
	Year         string `json:"year"`
	TotalBalance int32  `json:"total_balance"`
}

type GetYearlyTransactionAmountByCardNumberParams

type GetYearlyTransactionAmountByCardNumberParams struct {
	CardNumber string      `json:"card_number"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyTransactionAmountByCardNumberRow

type GetYearlyTransactionAmountByCardNumberRow struct {
	Year                   string `json:"year"`
	TotalTransactionAmount int64  `json:"total_transaction_amount"`
}

type GetYearlyTransactionAmountRow

type GetYearlyTransactionAmountRow struct {
	Year                   string `json:"year"`
	TotalTransactionAmount int64  `json:"total_transaction_amount"`
}

type GetYearlyTransactionStatusFailedCardNumberParams

type GetYearlyTransactionStatusFailedCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    int32  `json:"column_2"`
}

type GetYearlyTransactionStatusFailedCardNumberRow

type GetYearlyTransactionStatusFailedCardNumberRow struct {
	Year        string `json:"year"`
	TotalFailed int32  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTransactionStatusFailedRow

type GetYearlyTransactionStatusFailedRow struct {
	Year        string `json:"year"`
	TotalFailed int32  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTransactionStatusSuccessCardNumberParams

type GetYearlyTransactionStatusSuccessCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    int32  `json:"column_2"`
}

type GetYearlyTransactionStatusSuccessCardNumberRow

type GetYearlyTransactionStatusSuccessCardNumberRow struct {
	Year         string `json:"year"`
	TotalSuccess int32  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetYearlyTransactionStatusSuccessRow

type GetYearlyTransactionStatusSuccessRow struct {
	Year         string `json:"year"`
	TotalSuccess int32  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetYearlyTransferAmountByReceiverParams

type GetYearlyTransferAmountByReceiverParams struct {
	TransferTo string      `json:"transfer_to"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyTransferAmountByReceiverRow

type GetYearlyTransferAmountByReceiverRow struct {
	Year                string `json:"year"`
	TotalReceivedAmount int64  `json:"total_received_amount"`
}

type GetYearlyTransferAmountBySenderParams

type GetYearlyTransferAmountBySenderParams struct {
	TransferFrom string      `json:"transfer_from"`
	Column2      interface{} `json:"column_2"`
}

type GetYearlyTransferAmountBySenderRow

type GetYearlyTransferAmountBySenderRow struct {
	Year            string `json:"year"`
	TotalSentAmount int64  `json:"total_sent_amount"`
}

type GetYearlyTransferAmountReceiverRow

type GetYearlyTransferAmountReceiverRow struct {
	Year                string `json:"year"`
	TotalReceivedAmount int64  `json:"total_received_amount"`
}

type GetYearlyTransferAmountSenderRow

type GetYearlyTransferAmountSenderRow struct {
	Year            string `json:"year"`
	TotalSentAmount int64  `json:"total_sent_amount"`
}

type GetYearlyTransferAmountsByReceiverCardNumberParams

type GetYearlyTransferAmountsByReceiverCardNumberParams struct {
	TransferTo string      `json:"transfer_to"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyTransferAmountsByReceiverCardNumberRow

type GetYearlyTransferAmountsByReceiverCardNumberRow struct {
	Year                string `json:"year"`
	TotalTransferAmount int64  `json:"total_transfer_amount"`
}

type GetYearlyTransferAmountsBySenderCardNumberParams

type GetYearlyTransferAmountsBySenderCardNumberParams struct {
	TransferFrom string      `json:"transfer_from"`
	Column2      interface{} `json:"column_2"`
}

type GetYearlyTransferAmountsBySenderCardNumberRow

type GetYearlyTransferAmountsBySenderCardNumberRow struct {
	Year                string `json:"year"`
	TotalTransferAmount int64  `json:"total_transfer_amount"`
}

type GetYearlyTransferAmountsRow

type GetYearlyTransferAmountsRow struct {
	Year                string `json:"year"`
	TotalTransferAmount int64  `json:"total_transfer_amount"`
}

type GetYearlyTransferStatusFailedCardNumberParams

type GetYearlyTransferStatusFailedCardNumberParams struct {
	TransferFrom string `json:"transfer_from"`
	Column2      int32  `json:"column_2"`
}

type GetYearlyTransferStatusFailedCardNumberRow

type GetYearlyTransferStatusFailedCardNumberRow struct {
	Year        string `json:"year"`
	TotalFailed int32  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTransferStatusFailedRow

type GetYearlyTransferStatusFailedRow struct {
	Year        string `json:"year"`
	TotalFailed int32  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyTransferStatusSuccessCardNumberParams

type GetYearlyTransferStatusSuccessCardNumberParams struct {
	TransferFrom string `json:"transfer_from"`
	Column2      int32  `json:"column_2"`
}

type GetYearlyTransferStatusSuccessCardNumberRow

type GetYearlyTransferStatusSuccessCardNumberRow struct {
	Year         string `json:"year"`
	TotalSuccess int32  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetYearlyTransferStatusSuccessRow

type GetYearlyTransferStatusSuccessRow struct {
	Year         string `json:"year"`
	TotalSuccess int32  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetYearlyWithdrawAmountByCardNumberParams

type GetYearlyWithdrawAmountByCardNumberParams struct {
	CardNumber string      `json:"card_number"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyWithdrawAmountByCardNumberRow

type GetYearlyWithdrawAmountByCardNumberRow struct {
	Year                string `json:"year"`
	TotalWithdrawAmount int64  `json:"total_withdraw_amount"`
}

type GetYearlyWithdrawAmountRow

type GetYearlyWithdrawAmountRow struct {
	Year                string `json:"year"`
	TotalWithdrawAmount int64  `json:"total_withdraw_amount"`
}

type GetYearlyWithdrawStatusFailedCardNumberParams

type GetYearlyWithdrawStatusFailedCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    int32  `json:"column_2"`
}

type GetYearlyWithdrawStatusFailedCardNumberRow

type GetYearlyWithdrawStatusFailedCardNumberRow struct {
	Year        string `json:"year"`
	TotalFailed int32  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyWithdrawStatusFailedRow

type GetYearlyWithdrawStatusFailedRow struct {
	Year        string `json:"year"`
	TotalFailed int32  `json:"total_failed"`
	TotalAmount int32  `json:"total_amount"`
}

type GetYearlyWithdrawStatusSuccessCardNumberParams

type GetYearlyWithdrawStatusSuccessCardNumberParams struct {
	CardNumber string `json:"card_number"`
	Column2    int32  `json:"column_2"`
}

type GetYearlyWithdrawStatusSuccessCardNumberRow

type GetYearlyWithdrawStatusSuccessCardNumberRow struct {
	Year         string `json:"year"`
	TotalSuccess int32  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetYearlyWithdrawStatusSuccessRow

type GetYearlyWithdrawStatusSuccessRow struct {
	Year         string `json:"year"`
	TotalSuccess int32  `json:"total_success"`
	TotalAmount  int32  `json:"total_amount"`
}

type GetYearlyWithdrawsByCardNumberParams

type GetYearlyWithdrawsByCardNumberParams struct {
	CardNumber string      `json:"card_number"`
	Column2    interface{} `json:"column_2"`
}

type GetYearlyWithdrawsByCardNumberRow

type GetYearlyWithdrawsByCardNumberRow struct {
	Year                string `json:"year"`
	TotalWithdrawAmount int64  `json:"total_withdraw_amount"`
}

type GetYearlyWithdrawsRow

type GetYearlyWithdrawsRow struct {
	Year                string `json:"year"`
	TotalWithdrawAmount int64  `json:"total_withdraw_amount"`
}

type Merchant

type Merchant struct {
	MerchantID int32        `json:"merchant_id"`
	MerchantNo uuid.UUID    `json:"merchant_no"`
	Name       string       `json:"name"`
	ApiKey     string       `json:"api_key"`
	UserID     int32        `json:"user_id"`
	Status     string       `json:"status"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
}

type MerchantDocument

type MerchantDocument struct {
	DocumentID   int32          `json:"document_id"`
	MerchantID   int32          `json:"merchant_id"`
	DocumentType string         `json:"document_type"`
	DocumentUrl  string         `json:"document_url"`
	Status       string         `json:"status"`
	Note         sql.NullString `json:"note"`
	UploadedAt   sql.NullTime   `json:"uploaded_at"`
	CreatedAt    sql.NullTime   `json:"created_at"`
	UpdatedAt    sql.NullTime   `json:"updated_at"`
	DeletedAt    sql.NullTime   `json:"deleted_at"`
}

type Querier

type Querier interface {
	// AssignRoleToUser: Assigns a role to a user (creates a user-role relation)
	// Purpose: Role management for user access control
	// Parameters:
	//   $1: User ID
	//   $2: Role ID
	// Returns:
	//   user_role_id, user_id, role_id, timestamps (incl. deleted_at for future status check)
	// Business Logic:
	//   - Adds a new entry in the user_roles mapping table
	//   - Timestamps created_at and updated_at auto-set to current
	AssignRoleToUser(ctx context.Context, arg AssignRoleToUserParams) (*UserRole, error)
	// CreateCard: Creates a new card record
	// Purpose: Add a new card to the system for a specific user
	// Parameters:
	//   $1: user_id - Owner of the card
	//   $2: card_number - Unique number of the card
	//   $3: card_type - Type of the card (e.g., debit, credit)
	//   $4: expire_date - Expiration date of the card
	//   $5: cvv - Card verification value
	//   $6: card_provider - Provider/issuer of the card
	// Returns: Complete created card record
	// Business Logic:
	//   - Automatically sets created_at and updated_at timestamps
	//   - Requires all fields to be provided
	CreateCard(ctx context.Context, arg CreateCardParams) (*Card, error)
	// Create Merchant
	// Purpose: Insert a new merchant record into the database
	// Parameters:
	//   $1: name - The name of the merchant
	//   $2: api_key - Unique API key for the merchant
	//   $3: user_id - ID of the user associated with the merchant
	//   $4: status - Current status of the merchant (e.g., active, inactive)
	// Returns:
	//   - The newly created merchant record
	// Business Logic:
	//   - Inserts a new merchant with the provided details.
	//   - Sets the created_at and updated_at timestamps to the current time.
	//   - Returns the created merchant's data using the RETURNING clause.
	CreateMerchant(ctx context.Context, arg CreateMerchantParams) (*Merchant, error)
	CreateMerchantDocument(ctx context.Context, arg CreateMerchantDocumentParams) (*MerchantDocument, error)
	// CreateRefreshToken: Creates a new refresh token
	// Purpose: Generate a refresh token for user authentication
	// Parameters:
	//   $1: user_id - ID of the user this token belongs to
	//   $2: token - The actual refresh token string
	//   $3: expiration - Expiration timestamp of the token
	// Returns: The created refresh token record (excluding sensitive fields if any)
	// Business Logic:
	//   - Sets both created_at and updated_at to current timestamp
	//   - Used in JWT refresh token rotation
	//   - Typically created during login/auth flows
	CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (*RefreshToken, error)
	CreateResetToken(ctx context.Context, arg CreateResetTokenParams) (*ResetToken, error)
	// CreateRole: Inserts a new role into the system
	// Purpose: Add new role definitions (e.g., Admin, Cashier, etc.)
	// Parameters:
	//   $1: Role name
	// Returns:
	//   Newly created role's full data (including timestamps)
	CreateRole(ctx context.Context, roleName string) (*Role, error)
	// CreateSaldo: Creates a new saldo record
	// Purpose: Initialize a balance record for a new card
	// Parameters:
	//   $1: card_number - The card number to associate with this saldo
	//   $2: total_balance - The initial balance amount
	// Returns:
	//   The newly created saldo record
	// Business Logic:
	//   - Sets creation and update timestamps automatically
	//   - Used when issuing new cards
	CreateSaldo(ctx context.Context, arg CreateSaldoParams) (*Saldo, error)
	// CreateTopup: Inserts a new topup transaction into the topups table
	// Purpose: Used when a user performs a topup action
	// Parameters:
	//   $1: card_number - The card number receiving the topup
	//   $2: topup_amount - Amount of the topup
	//   $3: topup_method - Payment method used (e.g., 'e-wallet', 'bank_transfer')
	//   $4: topup_time - Timestamp of the actual topup transaction
	// Returns:
	//   Full topup record including auto-generated fields
	// Business Logic:
	//   - Automatically sets created_at and updated_at to current timestamp
	CreateTopup(ctx context.Context, arg CreateTopupParams) (*Topup, error)
	// CreateTransaction: Creates a new transaction record
	// Purpose: Record a financial transaction in the system
	// Parameters:
	//   $1: card_number - The card used for the transaction
	//   $2: amount - The transaction amount
	//   $3: payment_method - Payment method used (e.g., 'credit', 'debit')
	//   $4: merchant_id - ID of the merchant where transaction occurred
	//   $5: transaction_time - Timestamp of when transaction occurred
	// Returns:
	//   The newly created transaction record with all fields
	// Business Logic:
	//   - Sets creation and update timestamps automatically
	//   - Used for recording purchases, payments, and other financial activities
	CreateTransaction(ctx context.Context, arg CreateTransactionParams) (*Transaction, error)
	// CreateTransfer: Records a new transfer transaction
	// Purpose: Create a transfer between accounts/cards
	// Parameters:
	//   $1: transfer_from - Source account/card number
	//   $2: transfer_to - Destination account/card number
	//   $3: transfer_amount - Amount transferred
	//   $4: transfer_time - When the transfer occurred
	//   $5: status - Initial status of the transfer
	// Returns:
	//   The newly created transfer record
	// Business Logic:
	//   - Sets creation and update timestamps automatically
	//   - Used for recording money movements between accounts
	CreateTransfer(ctx context.Context, arg CreateTransferParams) (*Transfer, error)
	// CreateUser: Insert a new user into the users table
	// Purpose: Add a new user to the system.
	// Parameters:
	//   $1: firstname - The first name of the user.
	//   $2: lastname - The last name of the user.
	//   $3: email - The email address of the user.
	//   $4: password - The password of the user (hashed).
	// Returns:
	//   - The newly created user record.
	// Business Logic:
	//   - Inserts a new user record into the `users` table with the current timestamp for `created_at` and `updated_at`.
	CreateUser(ctx context.Context, arg CreateUserParams) (*User, error)
	// CreateWithdraw: Records a new cash withdrawal
	// Purpose: Create a withdrawal transaction in the system
	// Parameters:
	//   $1: card_number - The card used for withdrawal
	//   $2: withdraw_amount - The amount withdrawn
	//   $3: withdraw_time - When the withdrawal occurred
	//   $4: created_at - Timestamp of record creation
	// Returns:
	//   The newly created withdrawal record with all fields
	// Business Logic:
	//   - Sets creation and update timestamps automatically
	//   - Used for recording ATM/branch cash withdrawals
	//   - Typically triggered after successful cash dispense
	CreateWithdraw(ctx context.Context, arg CreateWithdrawParams) (*Withdraw, error)
	// DeleteAllPermanentCards: Permanently deletes all trashed cards
	// Purpose: Bulk-delete all cards that have been soft-deleted
	// Parameters: None
	// Returns: Nothing
	// Business Logic:
	//   - Deletes only cards with deleted_at set
	DeleteAllPermanentCards(ctx context.Context) error
	DeleteAllPermanentMerchantDocuments(ctx context.Context) error
	// Delete All Trashed Merchants Permanently
	// Purpose: Permanently delete all merchants that are soft deleted
	// Business Logic:
	//   - Permanently deletes all merchants that have been soft deleted (i.e., deleted_at is not NULL).
	//   - Removes these merchants completely from the database.
	DeleteAllPermanentMerchants(ctx context.Context) error
	// DeleteAllPermanentRoles: Permanently deletes all soft-deleted roles
	// Purpose: Bulk cleanup of trashed roles
	// Parameters: None
	DeleteAllPermanentRoles(ctx context.Context) error
	// DeleteAllPermanentSaldos: Permanently removes all trashed saldos
	// Purpose: Clean up all soft-deleted records
	// Business Logic:
	//   - Irreversible bulk deletion
	//   - Only affects records marked as deleted
	//   - Frees database space from old records
	DeleteAllPermanentSaldos(ctx context.Context) error
	// DeleteAllPermanentTopups: Permanently deletes all soft-deleted topups
	// Purpose: Bulk cleanup of trashed topup records
	// Business Logic:
	//   - Cannot be undone; this is a hard delete
	//   - Use for permanent data purging
	DeleteAllPermanentTopups(ctx context.Context) error
	// DeleteAllPermanentTransactions: Permanently removes all trashed transactions
	// Purpose: Clean up all soft-deleted transaction records
	// Business Logic:
	//   - Irreversible bulk deletion
	//   - Only affects records marked as deleted
	//   - Frees database space from old records
	//   - Typically used during maintenance periods
	DeleteAllPermanentTransactions(ctx context.Context) error
	// DeleteAllPermanentTransfers: Permanently removes all trashed transfers
	// Purpose: Clean up all soft-deleted transfers
	// Business Logic:
	//   - Irreversible bulk deletion
	//   - Only affects trashed records
	//   - Frees database space
	DeleteAllPermanentTransfers(ctx context.Context) error
	// DeleteAllPermanentUsers: Permanently delete all trashed users
	// Purpose: Permanently delete all trashed user records from the database.
	// Business Logic:
	//   - Deletes all users who have been trashed (soft-deleted), i.e., where `deleted_at` is not NULL.
	DeleteAllPermanentUsers(ctx context.Context) error
	// DeleteAllPermanentWithdraws: Permanently removes all trashed withdrawals
	// Purpose: Clean up all soft-deleted withdrawal records
	// Business Logic:
	//   - Irreversible bulk deletion
	//   - Only affects records marked as deleted
	//   - Frees database space from old records
	//   - Typically used during maintenance periods
	//   - Requires admin privileges
	DeleteAllPermanentWithdraws(ctx context.Context) error
	// DeleteCardPermanently: Removes a trashed card from the database
	// Purpose: Permanently delete a card that has been soft-deleted
	// Parameters:
	//   $1: card_id - Identifier of the card to permanently delete
	// Returns: Nothing
	// Business Logic:
	//   - Only deletes cards that are currently trashed
	DeleteCardPermanently(ctx context.Context, cardID int32) error
	DeleteMerchantDocumentPermanently(ctx context.Context, documentID int32) error
	// Delete Merchant Permanently
	// Purpose: Permanently delete a merchant from the database
	// Parameters:
	//   $1: merchant_id - ID of the merchant to be permanently deleted
	// Business Logic:
	//   - Deletes the specified merchant from the database.
	//   - Ensures the merchant is marked as deleted (deleted_at is not NULL).
	DeleteMerchantPermanently(ctx context.Context, merchantID int32) error
	// DeletePermanentRole: Permanently deletes a trashed role
	// Purpose: Remove role from DB after soft delete
	// Parameters:
	//   $1: Role ID
	DeletePermanentRole(ctx context.Context, roleID int32) error
	// DeleteRefreshToken: Permanently deletes a refresh token
	// Purpose: Invalidate a specific refresh token
	// Parameters:
	//   $1: token - The token string to delete
	// Business Logic:
	//   - Hard deletes the token record
	//   - Used during logout/token invalidation
	//   - Prevents token reuse after deletion
	DeleteRefreshToken(ctx context.Context, token string) error
	// DeleteRefreshTokenByUserId: Permanently deletes all tokens for a user
	// Purpose: Invalidate all refresh tokens for a user
	// Parameters:
	//   $1: user_id - ID of the user whose tokens to delete
	// Business Logic:
	//   - Hard deletes all tokens for the user
	//   - Used during password reset or account lock
	//   - Ensures complete session invalidation
	DeleteRefreshTokenByUserId(ctx context.Context, userID int32) error
	DeleteResetToken(ctx context.Context, userID int64) error
	// DeleteSaldoPermanently: Hard-deletes a trashed saldo
	// Purpose: Permanently remove a previously soft-deleted record
	// Parameters:
	//   $1: saldo_id - The ID of the saldo to delete
	// Business Logic:
	//   - Physical deletion from database
	//   - Only works on already trashed records
	//   - Irreversible operation
	DeleteSaldoPermanently(ctx context.Context, saldoID int32) error
	// DeleteTopupPermanently: Permanently deletes a topup record from the database
	// Purpose: Irrecoverably removes topup data
	// Parameters:
	//   $1: topup_id - ID of the topup to delete
	// Business Logic:
	//   - No soft-delete; data is permanently erased
	//   - Use with caution
	DeleteTopupPermanently(ctx context.Context, topupID int32) error
	// DeleteTransactionPermanently: Hard-deletes a trashed transaction
	// Purpose: Permanently remove a transaction from the system
	// Parameters:
	//   $1: transaction_id - ID of transaction to delete
	// Business Logic:
	//   - Physical deletion from database
	//   - Only works on already trashed records
	//   - Irreversible operation
	//   - Used for data cleanup after retention period
	DeleteTransactionPermanently(ctx context.Context, transactionID int32) error
	// DeleteTransferPermanently: Hard-deletes a transfer
	// Purpose: Permanently remove a transfer record
	// Parameters:
	//   $1: transfer_id - ID of transfer to delete
	// Business Logic:
	//   - Physical deletion from database
	//   - Only works on already trashed transfers
	//   - Irreversible operation
	DeleteTransferPermanently(ctx context.Context, transferID int32) error
	// DeleteUserPermanently: Permanently delete a trashed user from the system
	// Purpose: Permanently delete a trashed user record.
	// Parameters:
	//   $1: user_id - The ID of the trashed user to delete permanently.
	// Business Logic:
	//   - Deletes the user record from the `users` table permanently.
	//   - Only deletes users who have been trashed (`deleted_at IS NOT NULL`).
	DeleteUserPermanently(ctx context.Context, userID int32) error
	// DeleteWithdrawPermanently: Hard-deletes a withdrawal
	// Purpose: Permanently remove a withdrawal from the system
	// Parameters:
	//   $1: withdraw_id - ID of withdrawal to delete
	// Business Logic:
	//   - Physical deletion from database
	//   - Only works on already trashed withdrawals
	//   - Irreversible operation
	//   - Used after retention period expires
	DeleteWithdrawPermanently(ctx context.Context, withdrawID int32) error
	// FindAllTransactions: Retrieves a paginated list of active transactions with optional search
	// Purpose: Display transaction list with merchant info, filtered by card number or payment method
	// Parameters:
	//   $1: search_query (TEXT, nullable) - Optional search string to match card_number or payment_method
	//   $2: limit (INTEGER) - Maximum number of records to return (pagination)
	//   $3: offset (INTEGER) - Number of records to skip (pagination)
	// Returns:
	//   - transaction_id
	//   - card_number
	//   - amount
	//   - payment_method
	//   - merchant_id
	//   - merchant_name (from join with merchants table)
	//   - transaction_time
	//   - created_at, updated_at, deleted_at (for audit purposes)
	//   - total_count: Total number of records matching the filter (useful for pagination metadata)
	// Business Logic:
	//   - Joins `transactions` with `merchants` to retrieve merchant name
	//   - Filters out soft-deleted transactions (where deleted_at IS NOT NULL)
	//   - Applies case-insensitive partial match on card_number or payment_method if search query is provided
	//   - Uses `COUNT(*) OVER()` to include total matching count for pagination without a separate query
	//   - Results are ordered by `transaction_time` descending
	FindAllTransactions(ctx context.Context, arg FindAllTransactionsParams) ([]*FindAllTransactionsRow, error)
	// FindAllTransactions: Retrieves a paginated list of active transactions with optional search
	// Purpose: Display transaction list with merchant info, filtered by card number or payment method
	// Parameters:
	//   $1: api-key - The merchant to filter transactions
	//   $2: search_query (TEXT, nullable) - Optional search string to match card_number or payment_method
	//   $3: limit (INTEGER) - Maximum number of records to return (pagination)
	//   $4: offset (INTEGER) - Number of records to skip (pagination)
	// Returns:
	//   - transaction_id
	//   - card_number
	//   - amount
	//   - payment_method
	//   - merchant_id
	//   - merchant_name (from join with merchants table)
	//   - transaction_time
	//   - created_at, updated_at, deleted_at (for audit purposes)
	//   - total_count: Total number of records matching the filter (useful for pagination metadata)
	// Business Logic:
	//   - Joins `transactions` with `merchants` to retrieve merchant name
	//   - Filters out soft-deleted transactions (where deleted_at IS NOT NULL)
	//   - Applies case-insensitive partial match on card_number or payment_method if search query is provided
	//   - Uses `COUNT(*) OVER()` to include total matching count for pagination without a separate query
	//   - Results are ordered by `transaction_time` descending
	FindAllTransactionsByApikey(ctx context.Context, arg FindAllTransactionsByApikeyParams) ([]*FindAllTransactionsByApikeyRow, error)
	// FindAllTransactions: Retrieves a paginated list of active transactions with optional search
	// Purpose: Display transaction list with merchant info, filtered by card number or payment method
	// Parameters:
	//   $1: merchant_id - The merchant to filter transactions
	//   $2: search_query (TEXT, nullable) - Optional search string to match card_number or payment_method
	//   $3: limit (INTEGER) - Maximum number of records to return (pagination)
	//   $4: offset (INTEGER) - Number of records to skip (pagination)
	// Returns:
	//   - transaction_id
	//   - card_number
	//   - amount
	//   - payment_method
	//   - merchant_id
	//   - merchant_name (from join with merchants table)
	//   - transaction_time
	//   - created_at, updated_at, deleted_at (for audit purposes)
	//   - total_count: Total number of records matching the filter (useful for pagination metadata)
	// Business Logic:
	//   - Joins `transactions` with `merchants` to retrieve merchant name
	//   - Filters out soft-deleted transactions (where deleted_at IS NOT NULL)
	//   - Applies case-insensitive partial match on card_number or payment_method if search query is provided
	//   - Uses `COUNT(*) OVER()` to include total matching count for pagination without a separate query
	//   - Results are ordered by `transaction_time` descending
	FindAllTransactionsByMerchant(ctx context.Context, arg FindAllTransactionsByMerchantParams) ([]*FindAllTransactionsByMerchantRow, error)
	// FindAllTransfersByCardNumberAsReceiver: Retrieves all transfers where the card was the receiver
	// Purpose: View incoming transfer history for a specific card
	// Parameters:
	//   $1: card_number - The card number that received the transfers
	// Returns:
	//   All transfer fields for incoming transfers (transfer_to = card_number)
	// Business Logic:
	//   - Only includes active transfers (non-deleted)
	//   - Orders by transfer_time (newest first)
	//   - Useful for tracking money received by a cardholder
	FindAllTransfersByCardNumberAsReceiver(ctx context.Context, transferTo string) ([]*FindAllTransfersByCardNumberAsReceiverRow, error)
	// FindAllTransfersByCardNumberAsSender: Retrieves all transfers where the card was the sender
	// Purpose: View outgoing transfer history for a specific card
	// Parameters:
	//   $1: card_number - The card number that initiated the transfers
	// Returns:
	//   All transfer fields for outgoing transfers (transfer_from = card_number)
	// Business Logic:
	//   - Only includes active transfers (non-deleted)
	//   - Orders by transfer_time (newest first)
	//   - Useful for tracking money sent by a cardholder
	FindAllTransfersByCardNumberAsSender(ctx context.Context, transferFrom string) ([]*FindAllTransfersByCardNumberAsSenderRow, error)
	// FindAllWithdrawsByCardNumber: Retrieves all withdrawals for a specific card
	// Purpose: Get complete withdrawal history for a card
	// Parameters:
	//   $1: card_number - The card number to filter withdrawals
	// Returns:
	//   Selected withdrawal fields for all matching records
	// Business Logic:
	//   - Only includes active withdrawals (deleted_at IS NULL)
	//   - Returns all withdrawals without pagination
	//   - Orders by withdraw_time (newest first)
	//   - Useful for complete withdrawal history exports
	FindAllWithdrawsByCardNumber(ctx context.Context, cardNumber string) ([]*FindAllWithdrawsByCardNumberRow, error)
	// FindRefreshTokenByToken: Retrieves active refresh token by token string
	// Purpose: Validate and lookup refresh token
	// Parameters:
	//   $1: token - The refresh token string to find
	// Returns: The refresh token record if found and active
	// Business Logic:
	//   - Only returns non-deleted tokens
	//   - Used during token refresh operations
	//   - Helps prevent token reuse
	FindRefreshTokenByToken(ctx context.Context, token string) (*RefreshToken, error)
	// FindRefreshTokenByUserId: Retrieves latest active refresh token for user
	// Purpose: Get current valid refresh token for a user
	// Parameters:
	//   $1: user_id - ID of the user to find token for
	// Returns: The most recent refresh token for the user
	// Business Logic:
	//   - Returns only active (non-deleted) tokens
	//   - Orders by creation date (newest first)
	//   - Used for token management and validation
	//   - Limits to 1 result to get latest token
	FindRefreshTokenByUserId(ctx context.Context, userID int32) (*RefreshToken, error)
	// GetActiveCardsWithCount: Retrieves paginated list of active cards with search capability
	// Purpose: List all active cards for management UI (alternative to GetCards with same functionality)
	// Parameters:
	//   $1: search_term - Optional text to filter cards by number, type or provider (NULL for no filter)
	//   $2: limit - Maximum number of records to return
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All card fields plus total_count of matching records
	// Business Logic:
	//   - Excludes soft-deleted cards (deleted_at IS NULL)
	//   - Supports partial text matching on card_number, card_type and card_provider fields (case-insensitive)
	//   - Returns cards ordered by card_id
	//   - Provides total_count for pagination calculations
	GetActiveCardsWithCount(ctx context.Context, arg GetActiveCardsWithCountParams) ([]*GetActiveCardsWithCountRow, error)
	GetActiveMerchantDocuments(ctx context.Context, arg GetActiveMerchantDocumentsParams) ([]*GetActiveMerchantDocumentsRow, error)
	// GetActiveMerchants: Retrieves paginated list of active merchants with search capability
	// Purpose: List currently active merchants (same as GetMerchants)
	// Parameters:
	//   $1: search_term - Optional text to filter by name, api_key, or status (NULL for no filter)
	//   $2: limit - Maximum number of records to return
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All merchant fields plus total_count of matching records
	// Business Logic:
	//   - Excludes soft-deleted merchants (deleted_at IS NULL)
	//   - Supports case-insensitive partial matching on name, api_key, and status
	//   - Returns results ordered by merchant_id
	//   - Provides total_count for pagination calculations
	GetActiveMerchants(ctx context.Context, arg GetActiveMerchantsParams) ([]*GetActiveMerchantsRow, error)
	// GetActiveRoles: Retrieves only active (non-deleted) roles with optional search and pagination
	// Purpose: Display roles that are currently usable in the system
	// Parameters:
	//   $1: Search query (nullable)
	//   $2: Limit
	//   $3: Offset
	// Returns:
	//   role_id, role_name, timestamps, and total_count
	GetActiveRoles(ctx context.Context, arg GetActiveRolesParams) ([]*GetActiveRolesRow, error)
	// GetActiveSaldos: Retrieves active saldos with pagination and optional search
	// Purpose: List all non-deleted saldos with optional filtering for administrative views
	// Parameters:
	//   $1: search_term - Optional filter by card_number (case-insensitive, NULL for no filter)
	//   $2: limit - Number of records to retrieve
	//   $3: offset - Records to skip (pagination)
	// Returns:
	//   Active saldo records with total_count for pagination
	// Business Logic:
	//   - Filters out trashed saldos (deleted_at IS NULL)
	//   - Supports partial matching on card_number
	//   - Results ordered by saldo_id
	GetActiveSaldos(ctx context.Context, arg GetActiveSaldosParams) ([]*GetActiveSaldosRow, error)
	// GetActiveTopups: Retrieves paginated list of active (non-deleted) topups with search
	// Purpose: Display only active topups for admin or user dashboards
	// Parameters:
	//   $1: search_term - Optional text to filter by card_number, topup_no, or topup_method
	//   $2: limit - Max records to return
	//   $3: offset - Number of rows to skip
	// Returns:
	//   All active topup fields and total_count
	// Business Logic:
	//   - Filters out soft-deleted topups (deleted_at IS NULL)
	//   - Supports partial, case-insensitive search across multiple fields
	//   - Results sorted by topup_time (most recent first)
	//   - total_count is used for frontend pagination
	GetActiveTopups(ctx context.Context, arg GetActiveTopupsParams) ([]*GetActiveTopupsRow, error)
	// GetActiveTransactions: Retrieves paginated active transactions with search
	// Purpose: List all non-deleted transactions with filtering options
	// Parameters:
	//   $1: search_term - Optional text to filter by card number or payment method
	//   $2: limit - Maximum records to return
	//   $3: offset - Records to skip for pagination
	// Returns:
	//   All transaction fields plus total_count of matching active records
	// Business Logic:
	//   - Only includes active transactions (deleted_at IS NULL)
	//   - Filters on card_number and payment_method fields
	//   - Orders by transaction_time (newest first)
	//   - Provides pagination metadata
	//   - Used in transaction management interfaces
	GetActiveTransactions(ctx context.Context, arg GetActiveTransactionsParams) ([]*GetActiveTransactionsRow, error)
	// GetActiveTransfers: Retrieves paginated active transfers with search
	// Purpose: List all non-deleted transfers with filtering options
	// Parameters:
	//   $1: search_term - Optional text to filter by source or destination account
	//   $2: limit - Maximum records to return per page
	//   $3: offset - Records to skip for pagination
	// Returns:
	//   All transfer fields plus total_count of matching active records
	// Business Logic:
	//   - Only includes active transfers (deleted_at IS NULL)
	//   - Filters on transfer_from and transfer_to fields
	//   - Orders by transfer_time (newest first)
	//   - Provides pagination metadata
	//   - Used in transfer management interfaces
	GetActiveTransfers(ctx context.Context, arg GetActiveTransfersParams) ([]*GetActiveTransfersRow, error)
	// GetActiveUsersWithPagination: Get Active Users with Pagination and Total Count
	// Purpose: Retrieve active (non-deleted) users with pagination and total count
	// Parameters:
	//   $1: search_term - A search term to filter active users by firstname, lastname, or email
	//   $2: limit - The maximum number of active users to return per page
	//   $3: offset - The number of active users to skip (for pagination)
	// Returns:
	//   - Active user records matching the search term, including firstname, lastname, and email
	//   - A total count of active users, including all pages (using COUNT(*) OVER())
	// Business Logic:
	//   - Filters users where `deleted_at` is NULL (only active users).
	//   - Allows filtering by search term across firstname, lastname, or email.
	//   - Returns paginated active users, ordered by `created_at` in descending order.
	//   - The total count of active users is calculated, including those that are not currently on the current page.
	GetActiveUsersWithPagination(ctx context.Context, arg GetActiveUsersWithPaginationParams) ([]*GetActiveUsersWithPaginationRow, error)
	// GetActiveWithdraws: Retrieves paginated active withdrawals with search
	// Purpose: List all non-deleted withdrawals with filtering options
	// Parameters:
	//   $1: search_term - Optional text to filter withdrawals
	//   $2: limit - Maximum records to return per page
	//   $3: offset - Records to skip for pagination
	// Returns:
	//   All withdrawal fields plus total_count of matching active records
	// Business Logic:
	//   - Only includes active withdrawals (deleted_at IS NULL)
	//   - Same comprehensive filtering as GetWithdraws
	//   - Orders by withdraw_time (newest first)
	//   - Provides pagination metadata
	//   - Used in withdrawal management interfaces
	GetActiveWithdraws(ctx context.Context, arg GetActiveWithdrawsParams) ([]*GetActiveWithdrawsRow, error)
	// GetCardByCardNumber: Retrieves a single active card by its card number
	// Purpose: Lookup card information using the physical card number
	// Parameters:
	//   $1: card_number - The exact card number to search for
	// Returns:
	//   All fields for the matching card or NULL if not found or deleted
	// Business Logic:
	//   - Only returns active cards (deleted_at IS NULL)
	//   - Performs exact match on card_number field (case-sensitive)
	//   - Useful for card verification during transactions
	GetCardByCardNumber(ctx context.Context, cardNumber string) (*Card, error)
	// GetCardByID: Retrieves a single card by its ID
	// Purpose: Get detailed information about a specific card
	// Parameters:
	//   $1: card_id - The ID of the card to retrieve
	// Returns:
	//   All fields for the specified card
	// Business Logic:
	//   - Only returns active cards (deleted_at IS NULL)
	//   - Returns NULL if card is not found or has been soft-deleted
	GetCardByID(ctx context.Context, cardID int32) (*Card, error)
	// GetCardByUserID: Retrieves a single active card associated with a specific user
	// Purpose: Get the card information for a particular user
	// Parameters:
	//   $1: user_id - The ID of the user whose card should be retrieved
	// Returns:
	//   All fields for the user's card or NULL if no active card exists
	// Business Logic:
	//   - Only returns active cards (deleted_at IS NULL)
	//   - Returns at most one card (LIMIT 1) even if multiple cards exist for the user
	//   - Useful for displaying a user's primary/default card
	GetCardByUserID(ctx context.Context, userID int32) (*Card, error)
	// GetCards: Retrieves paginated list of active cards with search capability
	// Purpose: List all active cards for management UI
	// Parameters:
	//   $1: search_term - Optional text to filter cards by number, type or provider (NULL for no filter)
	//   $2: limit - Maximum number of records to return
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All card fields plus total_count of matching records
	// Business Logic:
	//   - Excludes soft-deleted cards (deleted_at IS NULL)
	//   - Supports partial text matching on card_number, card_type and card_provider fields (case-insensitive)
	//   - Returns cards ordered by card_id
	//   - Provides total_count for pagination calculations
	GetCards(ctx context.Context, arg GetCardsParams) ([]*GetCardsRow, error)
	// GetMerchantByApiKey: Retrieves a merchant by its API key
	// Purpose: Authenticate or lookup a merchant using its API key
	// Parameters:
	//   $1: api_key - API key of the merchant
	// Returns:
	//   Complete merchant record
	// Business Logic:
	//   - Excludes soft-deleted merchants (deleted_at IS NULL)
	GetMerchantByApiKey(ctx context.Context, apiKey string) (*Merchant, error)
	// GetMerchantByID: Retrieves a merchant by its unique ID
	// Purpose: Fetch details of a single merchant if not soft-deleted
	// Parameters:
	//   $1: merchant_id - Unique identifier of the merchant
	// Returns:
	//   Complete merchant record
	// Business Logic:
	//   - Excludes soft-deleted merchants (deleted_at IS NULL)
	GetMerchantByID(ctx context.Context, merchantID int32) (*Merchant, error)
	// GetMerchantByName: Retrieves a merchant by its name
	// Purpose: Find merchant data based on exact name match
	// Parameters:
	//   $1: name - Exact name of the merchant
	// Returns:
	//   Complete merchant record
	// Business Logic:
	//   - Excludes soft-deleted merchants (deleted_at IS NULL)
	GetMerchantByName(ctx context.Context, name string) (*Merchant, error)
	GetMerchantDocument(ctx context.Context, documentID int32) (*MerchantDocument, error)
	GetMerchantDocuments(ctx context.Context, arg GetMerchantDocumentsParams) ([]*GetMerchantDocumentsRow, error)
	// GetMerchants: Retrieves paginated list of all non-deleted merchants with search capability
	// Purpose: Display all active (non-trashed) merchants in admin interface
	// Parameters:
	//   $1: search_term - Optional text to filter by name, api_key, or status (NULL for no filter)
	//   $2: limit - Maximum number of records to return
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All merchant fields plus total_count of matching records
	// Business Logic:
	//   - Excludes soft-deleted merchants (deleted_at IS NULL)
	//   - Supports partial text search on name, api_key, and status (case-insensitive)
	//   - Returns results ordered by merchant_id
	//   - Provides total_count for pagination calculations
	GetMerchants(ctx context.Context, arg GetMerchantsParams) ([]*GetMerchantsRow, error)
	// GetMerchantsByUserID: Retrieves all merchants associated with a user
	// Purpose: List all merchants that belong to a specific user
	// Parameters:
	//   $1: user_id - ID of the user who owns the merchants
	// Returns:
	//   List of merchant records
	// Business Logic:
	//   - Excludes soft-deleted merchants (deleted_at IS NULL)
	GetMerchantsByUserID(ctx context.Context, userID int32) ([]*Merchant, error)
	// GetMonthTopupStatusFailed: Retrieves monthly failed metrics for topups
	// Purpose: Analyze failedful topup trends across comparison periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period
	//   $2: period1_end - End date of first comparison period
	//   $3: period2_start - Start date of second comparison period
	//   $4: period2_end - End date of second comparison period
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_failed: Count of failedful topups
	//   total_amount: Sum of failedful topup amounts
	// Business Logic:
	//   - Only includes failedful topups (status = 'failed')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no activity
	//   - Formats output for consistent visualization
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal topup patterns
	GetMonthTopupStatusFailed(ctx context.Context, arg GetMonthTopupStatusFailedParams) ([]*GetMonthTopupStatusFailedRow, error)
	// GetMonthTopupStatusFailedCardNumber: Retrieves monthly failed metrics for topups
	// Purpose: Analyze failedful topup trends across comparison periods
	// Parameters:
	//   $1: card_number       - Optional filter by card_number (NULL to ignore filter)
	//   $2: period1_start - Start date of first comparison period
	//   $3: period1_end - End date of first comparison period
	//   $4: period2_start - Start date of second comparison period
	//   $5: period2_end - End date of second comparison period
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_failed: Count of failedful topups
	//   total_amount: Sum of failedful topup amounts
	// Business Logic:
	//   - Only includes failedful topups (status = 'failed')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no activity
	//   - Formats output for consistent visualization
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal topup patterns
	GetMonthTopupStatusFailedCardNumber(ctx context.Context, arg GetMonthTopupStatusFailedCardNumberParams) ([]*GetMonthTopupStatusFailedCardNumberRow, error)
	// GetMonthTopupStatusSuccess: Retrieves monthly success metrics for topups
	// Purpose: Analyze successful topup trends across comparison periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period
	//   $2: period1_end - End date of first comparison period
	//   $3: period2_start - Start date of second comparison period
	//   $4: period2_end - End date of second comparison period
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_success: Count of successful topups
	//   total_amount: Sum of successful topup amounts
	// Business Logic:
	//   - Only includes successful topups (status = 'success')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no activity
	//   - Formats output for consistent visualization
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal topup patterns
	GetMonthTopupStatusSuccess(ctx context.Context, arg GetMonthTopupStatusSuccessParams) ([]*GetMonthTopupStatusSuccessRow, error)
	// GetMonthTopupStatusSuccessCardNumber: Retrieves monthly success metrics for topups
	// Purpose: Analyze successful topup trends across comparison periods
	// Parameters:
	//   $1: card_number       - Optional filter by card_number (NULL to ignore filter)
	//   $2: period1_start - Start date of first comparison period
	//   $3: period1_end - End date of first comparison period
	//   $4: period2_start - Start date of second comparison period
	//   $5: period2_end - End date of second comparison period
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_success: Count of successful topups
	//   total_amount: Sum of successful topup amounts
	// Business Logic:
	//   - Only includes successful topups (status = 'success')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no activity
	//   - Formats output for consistent visualization
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal topup patterns
	GetMonthTopupStatusSuccessCardNumber(ctx context.Context, arg GetMonthTopupStatusSuccessCardNumberParams) ([]*GetMonthTopupStatusSuccessCardNumberRow, error)
	// GetMonthTransactionStatusFailed: Retrieves monthly failed metrics for transactions
	// Purpose: Analyze failedful transaction trends across comparison periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period
	//   $2: period1_end - End date of first comparison period
	//   $3: period2_start - Start date of second comparison period
	//   $4: period2_end - End date of second comparison period
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_failed: Count of failedful transactions
	//   total_amount: Sum of failedful transaction amounts
	// Business Logic:
	//   - Only includes failedful transactions (status = 'failed')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal transaction patterns and revenue trends
	GetMonthTransactionStatusFailed(ctx context.Context, arg GetMonthTransactionStatusFailedParams) ([]*GetMonthTransactionStatusFailedRow, error)
	// GetMonthTransactionStatusFailed: Retrieves monthly failed metrics for transactions
	// Purpose: Analyze failedful transaction trends across comparison periods
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: period1_start - Start date of first comparison period
	//   $3: period1_end - End date of first comparison period
	//   $4: period2_start - Start date of second comparison period
	//   $5: period2_end - End date of second comparison period
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_failed: Count of failedful transactions
	//   total_amount: Sum of failedful transaction amounts
	// Business Logic:
	//   - Only includes failedful transactions (status = 'failed')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal transaction patterns and revenue trends
	GetMonthTransactionStatusFailedCardNumber(ctx context.Context, arg GetMonthTransactionStatusFailedCardNumberParams) ([]*GetMonthTransactionStatusFailedCardNumberRow, error)
	// GetMonthTransactionStatusSuccess: Retrieves monthly success metrics for transactions
	// Purpose: Analyze successful transaction trends across comparison periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period
	//   $2: period1_end - End date of first comparison period
	//   $3: period2_start - Start date of second comparison period
	//   $4: period2_end - End date of second comparison period
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_success: Count of successful transactions
	//   total_amount: Sum of successful transaction amounts
	// Business Logic:
	//   - Only includes successful transactions (status = 'success')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal transaction patterns and revenue trends
	GetMonthTransactionStatusSuccess(ctx context.Context, arg GetMonthTransactionStatusSuccessParams) ([]*GetMonthTransactionStatusSuccessRow, error)
	// GetMonthTransactionStatusSuccessCardNumber: Retrieves monthly success metrics for transactions
	// Purpose: Analyze successful transaction trends across comparison periods
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: period1_start - Start date of first comparison period
	//   $3: period1_end - End date of first comparison period
	//   $4: period2_start - Start date of second comparison period
	//   $5: period2_end - End date of second comparison period
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_success: Count of successful transactions
	//   total_amount: Sum of successful transaction amounts
	// Business Logic:
	//   - Only includes successful transactions (status = 'success')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal transaction patterns and revenue trends
	GetMonthTransactionStatusSuccessCardNumber(ctx context.Context, arg GetMonthTransactionStatusSuccessCardNumberParams) ([]*GetMonthTransactionStatusSuccessCardNumberRow, error)
	// GetMonthTransferStatusFailed: Retrieves monthly failed metrics for fund transfers
	// Purpose: Analyze failedful transfer trends across comparison periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period (timestamp)
	//   $2: period1_end - End date of first comparison period (timestamp)
	//   $3: period2_start - Start date of second comparison period (timestamp)
	//   $4: period2_end - End date of second comparison period (timestamp)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_failed: Count of failedful transfers
	//   total_amount: Sum of failedful transfer amounts
	// Business Logic:
	//   - Only includes failedful transfers (status = 'failed')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no transfer activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal transfer patterns and cash flow analysis
	GetMonthTransferStatusFailed(ctx context.Context, arg GetMonthTransferStatusFailedParams) ([]*GetMonthTransferStatusFailedRow, error)
	// GetMonthTransferStatusFailedCardNumber: Retrieves monthly failed metrics for fund transfers
	// Purpose: Analyze failedful transfer trends across comparison periods
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: period1_start - Start date of first comparison period (timestamp)
	//   $3: period1_end - End date of first comparison period (timestamp)
	//   $4: period2_start - Start date of second comparison period (timestamp)
	//   $5: period2_end - End date of second comparison period (timestamp)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_failed: Count of failedful transfers
	//   total_amount: Sum of failedful transfer amounts
	// Business Logic:
	//   - Only includes failedful transfers (status = 'failed')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no transfer activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal transfer patterns and cash flow analysis
	GetMonthTransferStatusFailedCardNumber(ctx context.Context, arg GetMonthTransferStatusFailedCardNumberParams) ([]*GetMonthTransferStatusFailedCardNumberRow, error)
	// GetMonthTransferStatusSuccess: Retrieves monthly success metrics for fund transfers
	// Purpose: Analyze successful transfer trends across comparison periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period (timestamp)
	//   $2: period1_end - End date of first comparison period (timestamp)
	//   $3: period2_start - Start date of second comparison period (timestamp)
	//   $4: period2_end - End date of second comparison period (timestamp)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_success: Count of successful transfers
	//   total_amount: Sum of successful transfer amounts
	// Business Logic:
	//   - Only includes successful transfers (status = 'success')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no transfer activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal transfer patterns and cash flow analysis
	GetMonthTransferStatusSuccess(ctx context.Context, arg GetMonthTransferStatusSuccessParams) ([]*GetMonthTransferStatusSuccessRow, error)
	// GetMonthTransferStatusSuccessCardNumber: Retrieves monthly success metrics for fund transfers
	// Purpose: Analyze successful transfer trends across comparison periods
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: period1_start - Start date of first comparison period (timestamp)
	//   $3: period1_end - End date of first comparison period (timestamp)
	//   $4: period2_start - Start date of second comparison period (timestamp)
	//   $5: period2_end - End date of second comparison period (timestamp)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_success: Count of successful transfers
	//   total_amount: Sum of successful transfer amounts
	// Business Logic:
	//   - Only includes successful transfers (status = 'success')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no transfer activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal transfer patterns and cash flow analysis
	GetMonthTransferStatusSuccessCardNumber(ctx context.Context, arg GetMonthTransferStatusSuccessCardNumberParams) ([]*GetMonthTransferStatusSuccessCardNumberRow, error)
	// GetMonthWithdrawStatusFailed: Retrieves monthly failed metrics for withdrawals
	// Purpose: Analyze failed withdrawal trends across comparison periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period (timestamp)
	//   $2: period1_end - End date of first comparison period (timestamp)
	//   $3: period2_start - Start date of second comparison period (timestamp)
	//   $4: period2_end - End date of second comparison period (timestamp)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_failed: Count of failed withdrawals
	//   total_amount: Sum of failed withdrawal amounts
	// Business Logic:
	//   - Only includes failed withdrawals (status = 'failed')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no withdrawal activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal cash withdrawal patterns
	GetMonthWithdrawStatusFailed(ctx context.Context, arg GetMonthWithdrawStatusFailedParams) ([]*GetMonthWithdrawStatusFailedRow, error)
	// GetMonthWithdrawStatusFailedCardNumber: Retrieves monthly failed metrics for withdrawals
	// Purpose: Analyze failed withdrawal trends across comparison periods
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: period1_start - Start date of first comparison period (timestamp)
	//   $3: period1_end - End date of first comparison period (timestamp)
	//   $4: period2_start - Start date of second comparison period (timestamp)
	//   $5: period2_end - End date of second comparison period (timestamp)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_failed: Count of failed withdrawals
	//   total_amount: Sum of failed withdrawal amounts
	// Business Logic:
	//   - Only includes failed withdrawals (status = 'failed')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no withdrawal activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal cash withdrawal patterns
	GetMonthWithdrawStatusFailedCardNumber(ctx context.Context, arg GetMonthWithdrawStatusFailedCardNumberParams) ([]*GetMonthWithdrawStatusFailedCardNumberRow, error)
	// GetMonthWithdrawStatusSuccess: Retrieves monthly success metrics for withdrawals
	// Purpose: Analyze successful withdrawal trends across comparison periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period (timestamp)
	//   $2: period1_end - End date of first comparison period (timestamp)
	//   $3: period2_start - Start date of second comparison period (timestamp)
	//   $4: period2_end - End date of second comparison period (timestamp)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_success: Count of successful withdrawals
	//   total_amount: Sum of successful withdrawal amounts
	// Business Logic:
	//   - Only includes successful withdrawals (status = 'success')
	//   - Covers two customizable time periods for comparison
	//   - Zero-fills months with no withdrawal activity
	//   - Formats output for consistent visualization (year as text, month as 'Mon')
	//   - Orders by year and month (newest first)
	//   - Useful for identifying seasonal cash withdrawal patterns
	GetMonthWithdrawStatusSuccess(ctx context.Context, arg GetMonthWithdrawStatusSuccessParams) ([]*GetMonthWithdrawStatusSuccessRow, error)
	GetMonthWithdrawStatusSuccessCardNumber(ctx context.Context, arg GetMonthWithdrawStatusSuccessCardNumberParams) ([]*GetMonthWithdrawStatusSuccessCardNumberRow, error)
	// GetMonthlyAmountByApikey: Retrieves total transaction amount per month for a specific merchant and year
	// Purpose: Generate monthly income report for a specific merchant regardless of payment method
	// Parameters:
	//   $1: reference_date - Any date within the target year
	//   $2: api-key - The merchant to filter transactions
	// Returns:
	//   - Month name (e.g., Jan, Feb)
	//   - Total transaction amount (0 if no activity)
	// Business Logic:
	//   - Generates complete 12-month series for the given year
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Filters by specific merchant_id
	//   - Uses LEFT JOIN to ensure each month is represented
	//   - Uses COALESCE to return 0 if a month has no transaction data
	//   - Results are ordered chronologically by month
	GetMonthlyAmountByApikey(ctx context.Context, arg GetMonthlyAmountByApikeyParams) ([]*GetMonthlyAmountByApikeyRow, error)
	// GetMonthlyAmountByMerchants: Retrieves total transaction amount per month for a specific merchant and year
	// Purpose: Generate monthly income report for a specific merchant regardless of payment method
	// Parameters:
	//   $1: reference_date - Any date within the target year
	//   $2: merchant_id - The merchant to filter transactions
	// Returns:
	//   - Month name (e.g., Jan, Feb)
	//   - Total transaction amount (0 if no activity)
	// Business Logic:
	//   - Generates complete 12-month series for the given year
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Filters by specific merchant_id
	//   - Uses LEFT JOIN to ensure each month is represented
	//   - Uses COALESCE to return 0 if a month has no transaction data
	//   - Results are ordered chronologically by month
	GetMonthlyAmountByMerchants(ctx context.Context, arg GetMonthlyAmountByMerchantsParams) ([]*GetMonthlyAmountByMerchantsRow, error)
	// GetMonthlyAmountMerchant: Retrieves total transaction amount per month for a given year
	// Purpose: Generate monthly income report regardless of payment method
	// Parameters:
	//   $1: reference_date - Any date within the target year
	// Returns:
	//   - Month name (e.g., Jan, Feb)
	//   - Total transaction amount (0 if no activity)
	// Business Logic:
	//   - Generates complete 12-month series
	//   - Includes only active (non-deleted) transactions and merchants
	//   - Uses LEFT JOIN to ensure each month is represented
	//   - Uses COALESCE to return 0 if a month has no data
	//   - Ordered chronologically by month
	GetMonthlyAmountMerchant(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyAmountMerchantRow, error)
	// GetMonthlyAmounts: Retrieves total transaction amount per month for a specific year
	// Purpose:
	//   Visualize monthly trends in transaction volume for charting/dashboards
	// Parameters:
	//   $1: reference_date - Any date within the target year
	// Returns:
	//   - month: 3-letter month abbreviation
	//   - total_amount: Sum of transaction amounts in each month
	// Business Logic:
	//   - Uses LEFT JOIN to ensure all months are included, even with 0 transactions
	//   - Filters out soft-deleted data (deleted_at IS NULL)
	GetMonthlyAmounts(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyAmountsRow, error)
	// GetMonthlyAmountsByCardNumber: Retrieves total transaction amount per month for a specific year
	// Purpose:
	//   Visualize monthly trends in transaction volume for charting/dashboards
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: reference_date - Any date within the target year
	// Returns:
	//   - month: 3-letter month abbreviation
	//   - total_amount: Sum of transaction amounts in each month
	// Business Logic:
	//   - Uses LEFT JOIN to ensure all months are included, even with 0 transactions
	//   - Filters out soft-deleted data (deleted_at IS NULL)
	GetMonthlyAmountsByCardNumber(ctx context.Context, arg GetMonthlyAmountsByCardNumberParams) ([]*GetMonthlyAmountsByCardNumberRow, error)
	// GetMonthlyBalances: Retrieves monthly balance totals for a given year
	// Purpose: Provide monthly balance trends for dashboard visualizations
	// Parameters:
	//   $1: reference_date - A date used to determine the year to analyze
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_balance: Sum of balances for that month (zero if no data)
	// Business Logic:
	//   - Generates a complete 12-month series for the year
	//   - Includes only active saldos and cards (deleted_at IS NULL)
	//   - Uses LEFT JOIN to ensure all months appear in results
	//   - COALESCE returns 0 for months with no data
	//   - Results ordered chronologically
	GetMonthlyBalances(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyBalancesRow, error)
	// GetMonthlyBalancesByCardNumber: Retrieves monthly balance history for a specific card
	// Purpose: Track monthly balance trends for individual card statements
	// Parameters:
	//   $1: reference_date - Date to determine the analysis year
	//   $2: card_number - Specific card to analyze
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_balance: Monthly balance total (0 if no data)
	// Business Logic:
	//   - Generates complete 12-month series for the year
	//   - Filters for specific card number
	//   - Only includes active saldos and cards
	//   - Ensures all months appear with COALESCE default
	//   - Useful for cardholder spending pattern analysis
	GetMonthlyBalancesByCardNumber(ctx context.Context, arg GetMonthlyBalancesByCardNumberParams) ([]*GetMonthlyBalancesByCardNumberRow, error)
	// GetMonthlyPaymentMethodByApikey: Retrieves total transaction amount per payment method per month for a specific merchant
	// Purpose: Analyze monthly transaction totals by payment method for a specific merchant and year
	// Parameters:
	//   $1: reference_date - Any date within the target year
	//   $2: api-key - The merchant to filter transactions
	// Returns:
	//   - Month name (e.g., Jan, Feb)
	//   - Payment method
	//   - Total transaction amount for each combination
	// Business Logic:
	//   - Generates a complete 12-month series for the given year
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Filters by specific merchant_id
	//   - Uses LEFT JOIN and CROSS JOIN to ensure all months and payment methods are included
	//   - Uses COALESCE to return 0 for combinations with no data
	//   - Results are ordered chronologically by month
	GetMonthlyPaymentMethodByApikey(ctx context.Context, arg GetMonthlyPaymentMethodByApikeyParams) ([]*GetMonthlyPaymentMethodByApikeyRow, error)
	// GetMonthlyPaymentMethodByMerchants: Retrieves total transaction amount per payment method per month for a specific merchant
	// Purpose: Analyze monthly transaction totals by payment method for a specific merchant and year
	// Parameters:
	//   $1: reference_date - Any date within the target year
	//   $2: merchant_id - The merchant to filter transactions
	// Returns:
	//   - Month name (e.g., Jan, Feb)
	//   - Payment method
	//   - Total transaction amount for each combination
	// Business Logic:
	//   - Generates a complete 12-month series for the given year
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Filters by specific merchant_id
	//   - Uses LEFT JOIN and CROSS JOIN to ensure all months and payment methods are included
	//   - Uses COALESCE to return 0 for combinations with no data
	//   - Results are ordered chronologically by month
	GetMonthlyPaymentMethodByMerchants(ctx context.Context, arg GetMonthlyPaymentMethodByMerchantsParams) ([]*GetMonthlyPaymentMethodByMerchantsRow, error)
	// GetMonthlyPaymentMethods: Retrieves a monthly summary of transaction transactions categorized by payment method
	// Purpose:
	//   Useful for visualizing how each payment method is used over time within a given year
	// Parameters:
	//   $1: reference_date - Any date within the target year (used to generate monthly range)
	// Returns:
	//   - month (e.g., 'Jan', 'Feb')
	//   - payment_method (e.g., 'e-wallet', 'bank_transfer')
	//   - total_transactions: Number of transactions for the method that month
	//   - total_amount: Total amount of transactions for the method that month
	// Business Logic:
	//   - Includes all combinations of months and available payment methods (even if 0 data)
	//   - Excludes soft-deleted transactions (deleted_at IS NULL)
	//   - Uses CROSS JOIN to ensure all months and methods are represented
	GetMonthlyPaymentMethods(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyPaymentMethodsRow, error)
	// GetMonthlyPaymentMethodsByCardNumber: Retrieves a monthly summary of transaction transactions categorized by payment method
	// Purpose:
	//   Useful for visualizing how each payment method is used over time within a given year
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: reference_date - Any date within the target year (used to generate monthly range)
	// Returns:
	//   - month (e.g., 'Jan', 'Feb')
	//   - payment_method (e.g., 'e-wallet', 'bank_transfer')
	//   - total_transactions: Number of transactions for the method that month
	//   - total_amount: Total amount of transactions for the method that month
	// Business Logic:
	//   - Includes all combinations of months and available payment methods (even if 0 data)
	//   - Excludes soft-deleted transactions (deleted_at IS NULL)
	//   - Uses CROSS JOIN to ensure all months and methods are represent
	GetMonthlyPaymentMethodsByCardNumber(ctx context.Context, arg GetMonthlyPaymentMethodsByCardNumberParams) ([]*GetMonthlyPaymentMethodsByCardNumberRow, error)
	// GetMonthlyPaymentMethodsMerchant: Retrieves monthly transaction totals per payment method
	// Purpose: Analyze monthly transaction distribution across payment methods for a given year
	// Parameters:
	//   $1: reference_date - Any date within the target year
	// Returns:
	//   - Month name (e.g., Jan, Feb)
	//   - Payment method
	//   - Total transaction amount (0 if no activity)
	// Business Logic:
	//   - Generates complete 12-month series from the reference year
	//   - Cross joins with distinct active payment methods
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Uses LEFT JOIN to ensure all month-method combinations are included
	//   - Uses COALESCE to display 0 for months with no transactions
	//   - Ordered by month and payment method
	GetMonthlyPaymentMethodsMerchant(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyPaymentMethodsMerchantRow, error)
	// GetMonthlySaldoBalances: Retrieves monthly balance totals for a given year
	// Purpose: Provide monthly balance trends for financial reporting and dashboards
	// Parameters:
	//   $1: reference_date - A date used to determine the year to analyze
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan', 'Feb')
	//   total_balance: Sum of balances for that month (0 if no data exists)
	// Business Logic:
	//   - Generates a complete 12-month series for the specified year
	//   - Uses LEFT JOIN to ensure all months appear in results
	//   - COALESCE returns 0 for months with no balance data
	//   - Only includes active saldo records (deleted_at IS NULL)
	//   - Groups by month and orders chronologically
	//   - Useful for cash flow analysis and financial planning
	GetMonthlySaldoBalances(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlySaldoBalancesRow, error)
	// GetMonthlyTopupAmount: Retrieves monthly top-up totals for a given year
	// Purpose: Analyze monthly top-up patterns and trends
	// Parameters:
	//   $1: reference_date - A date used to determine the year to analyze
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_topup_amount: Sum of top-ups for that month (zero if no data)
	// Business Logic:
	//   - Generates complete 12-month series
	//   - Only includes active topups and cards
	//   - Uses LEFT JOIN to ensure all months appear
	//   - COALESCE returns 0 for months with no activity
	//   - Results ordered chronologically
	GetMonthlyTopupAmount(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTopupAmountRow, error)
	// GetMonthlyTopupAmountByCardNumber: Retrieves monthly top-up history for a card
	// Purpose: Analyze monthly top-up patterns for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_date - Date to determine analysis year
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_topup_amount: Monthly top-up total (0 if none)
	// Business Logic:
	//   - Complete 12-month coverage
	//   - Card-specific filtering
	//   - Active records only
	//   - Zero-filled for missing months
	//   - Helps identify top-up habit seasonality
	GetMonthlyTopupAmountByCardNumber(ctx context.Context, arg GetMonthlyTopupAmountByCardNumberParams) ([]*GetMonthlyTopupAmountByCardNumberRow, error)
	// GetMonthlyTopupAmounts: Retrieves total topup amounts per month for the selected year
	// Purpose: Visualize total topup volume across months in a given year
	// Parameters:
	//   $1: reference_date - Any date within the target year
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_amount: Sum of all topup amounts per month
	// Business Logic:
	//   - Filters soft-deleted entries (deleted_at IS NULL)
	//   - Uses LEFT JOIN to ensure months with no topups are still included with amount = 0
	//   - Useful for monthly topup charts or dashboards
	GetMonthlyTopupAmounts(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTopupAmountsRow, error)
	// GetMonthlyTopupAmountsByCardNumber: Retrieves total topup amounts per month for the selected year
	// Purpose: Visualize total topup volume across months in a given year
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: reference_date - Any date within the target year
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_amount: Sum of all topup amounts per month
	// Business Logic:
	//   - Filters soft-deleted entries (deleted_at IS NULL)
	//   - Uses LEFT JOIN to ensure months with no topups are still included with amount = 0
	//   - Useful for monthly topup charts or dashboards
	GetMonthlyTopupAmountsByCardNumber(ctx context.Context, arg GetMonthlyTopupAmountsByCardNumberParams) ([]*GetMonthlyTopupAmountsByCardNumberRow, error)
	// GetMonthlyTopupMethods: Retrieves monthly breakdown of topup usage by method
	// Purpose: Track topup method distribution and amounts over each month of the selected year
	// Parameters:
	//   $1: reference_date - Any date within the target year (used to define monthly range)
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   topup_method: Method used for topup (e.g., 'bank_transfer', 'e-wallet')
	//   total_topups: Count of topups using the method in that month
	//   total_amount: Sum of topup amounts using the method in that month
	// Business Logic:
	//   - Ensures every topup method is shown for every month (even with 0 data)
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Uses CROSS JOIN to combine months with all available methods
	//   - Useful for visualizing adoption trends of each topup method monthly
	GetMonthlyTopupMethods(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTopupMethodsRow, error)
	// GetMonthlyTopupMethodsByCardNumber: Retrieves monthly breakdown of topup usage by method
	// Purpose: Track topup method distribution and amounts over each month of the selected year
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: reference_date - Any date within the target year (used to define monthly range)
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   topup_method: Method used for topup (e.g., 'bank_transfer', 'e-wallet')
	//   total_topups: Count of topups using the method in that month
	//   total_amount: Sum of topup amounts using the method in that month
	// Business Logic:
	//   - Ensures every topup method is shown for every month (even with 0 data)
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Uses CROSS JOIN to combine months with all available methods
	//   - Useful for visualizing adoption trends of each topup method monthly
	GetMonthlyTopupMethodsByCardNumber(ctx context.Context, arg GetMonthlyTopupMethodsByCardNumberParams) ([]*GetMonthlyTopupMethodsByCardNumberRow, error)
	// GetMonthlyTotalAmountByApikey: Retrieves total transaction amounts for the current and previous month
	// Purpose: Provide monthly transaction summary including zero values if no transactions exist
	// Parameters:
	//   $1: reference_date - Any date within the target (current) month
	//   $2: api-key - The merchant to filter transactions
	// Returns:
	//   - Year (as text)
	//   - Month (abbreviated name, e.g., Jan, Feb)
	//   - Total transaction amount for each month
	// Business Logic:
	//   - Aggregates total transaction amounts for the target month and the month before
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Includes 0 as total_amount if there's no transaction data for either month
	//   - Uses UNION ALL to combine real data with "missing month" placeholders
	//   - Results are sorted by year and month (most recent first)
	GetMonthlyTotalAmountByApikey(ctx context.Context, arg GetMonthlyTotalAmountByApikeyParams) ([]*GetMonthlyTotalAmountByApikeyRow, error)
	// GetMonthlyTotalAmountByMerchant: Retrieves total transaction amounts for the current and previous month
	// Purpose: Provide monthly transaction summary including zero values if no transactions exist
	// Parameters:
	//   $1: reference_date - Any date within the target (current) month
	//   $2: merchant_id - The merchant to filter transactions
	// Returns:
	//   - Year (as text)
	//   - Month (abbreviated name, e.g., Jan, Feb)
	//   - Total transaction amount for each month
	// Business Logic:
	//   - Aggregates total transaction amounts for the target month and the month before
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Includes 0 as total_amount if there's no transaction data for either month
	//   - Uses UNION ALL to combine real data with "missing month" placeholders
	//   - Results are sorted by year and month (most recent first)
	GetMonthlyTotalAmountByMerchant(ctx context.Context, arg GetMonthlyTotalAmountByMerchantParams) ([]*GetMonthlyTotalAmountByMerchantRow, error)
	// GetMonthlyTotalAmountMerchant: Retrieves total transaction amounts for the current and previous month
	// Purpose: Provide monthly transaction summary including zero values if no transactions exist
	// Parameters:
	//   $1: reference_date - Any date within the target (current) month
	// Returns:
	//   - Year (as text)
	//   - Month (abbreviated name, e.g., Jan, Feb)
	//   - Total transaction amount for each month
	// Business Logic:
	//   - Aggregates total transaction amounts for the target month and the month before
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Includes 0 as total_amount if there's no transaction data for either month
	//   - Uses UNION ALL to combine real data with "missing month" placeholders
	//   - Results are sorted by year and month (most recent first)
	GetMonthlyTotalAmountMerchant(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTotalAmountMerchantRow, error)
	// GetMonthlyTotalSaldoBalance: Retrieves monthly balance totals for comparison periods
	// Purpose: Compare monthly balance trends between two time periods
	// Parameters:
	//   $1: period1_start - Start date of first comparison period
	//   $2: period1_end - End date of first comparison period
	//   $3: period2_start - Start date of second comparison period
	//   $4: period2_end - End date of second comparison period
	// Returns:
	//   year: The year as text
	//   month: 3-letter month abbreviation
	//   total_balance: Monthly balance total (0 if no data)
	// Business Logic:
	//   - Aggregates balances for two customizable time periods
	//   - Only includes active saldos (deleted_at IS NULL)
	//   - Ensures both periods' months appear with zero-filling
	//   - Formats output for consistent visualization
	//   - Results ordered by year and month (newest first)
	GetMonthlyTotalSaldoBalance(ctx context.Context, arg GetMonthlyTotalSaldoBalanceParams) ([]*GetMonthlyTotalSaldoBalanceRow, error)
	// GetMonthlyTransactionAmount: Retrieves monthly transaction totals for a given year
	// Purpose: Analyze monthly transaction patterns and trends
	// Parameters:
	//   $1: reference_date - A date used to determine the year to analyze
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_transaction_amount: Sum of transactions for that month (zero if no data)
	// Business Logic:
	//   - Generates complete 12-month series
	//   - Only includes active transactions and cards
	//   - Uses LEFT JOIN to ensure all months appear
	//   - COALESCE returns 0 for months with no activity
	//   - Results ordered chronologically
	GetMonthlyTransactionAmount(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTransactionAmountRow, error)
	// GetMonthlyTransactionAmountByCardNumber: Retrieves monthly transaction history for a card
	// Purpose: Analyze monthly transaction patterns for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_date - Date to determine analysis year
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_transaction_amount: Monthly transaction total (0 if none)
	// Business Logic:
	//   - Complete 12-month coverage
	//   - Card-specific filtering
	//   - Active records only
	//   - Zero-filled for missing months
	//   - Helps identify transaction habit seasonality
	GetMonthlyTransactionAmountByCardNumber(ctx context.Context, arg GetMonthlyTransactionAmountByCardNumberParams) ([]*GetMonthlyTransactionAmountByCardNumberRow, error)
	// GetMonthlyTransferAmountByReceiver: Retrieves monthly transfer history for a card
	// Purpose: Analyze monthly transfer patterns for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_date - Date to determine analysis year
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_sent_amount: Monthly transfer total (0 if none)
	// Business Logic:
	//   - Complete 12-month coverage
	//   - Card-specific filtering
	//   - Active records only
	//   - Zero-filled for missing months
	//   - Helps identify transfer habit seasonality
	GetMonthlyTransferAmountByReceiver(ctx context.Context, arg GetMonthlyTransferAmountByReceiverParams) ([]*GetMonthlyTransferAmountByReceiverRow, error)
	// GetMonthlyTransferAmountBySender: Retrieves monthly transfer history for a card
	// Purpose: Analyze monthly transfer patterns for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_date - Date to determine analysis year
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_sent_amount: Monthly transfer total (0 if none)
	// Business Logic:
	//   - Complete 12-month coverage
	//   - Card-specific filtering
	//   - Active records only
	//   - Zero-filled for missing months
	//   - Helps identify transfer habit seasonality
	GetMonthlyTransferAmountBySender(ctx context.Context, arg GetMonthlyTransferAmountBySenderParams) ([]*GetMonthlyTransferAmountBySenderRow, error)
	// GetMonthlyTransferAmountReceiver: Retrieves monthly transfer totals for a given year
	// Purpose: Analyze monthly transfer patterns and trends
	// Parameters:
	//   $1: reference_date - A date used to determine the year to analyze
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_received_amount: Sum of transfers for that month (zero if no data)
	// Business Logic:
	//   - Generates complete 12-month series
	//   - Only includes active transfers and cards
	//   - Uses LEFT JOIN to ensure all months appear
	//   - COALESCE returns 0 for months with no activity
	//   - Results ordered chronologically
	GetMonthlyTransferAmountReceiver(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTransferAmountReceiverRow, error)
	// GetMonthlyTransferAmountSender: Retrieves monthly transfer totals for a given year
	// Purpose: Analyze monthly transfer patterns and trends
	// Parameters:
	//   $1: reference_date - A date used to determine the year to analyze
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_sent_amount: Sum of transfers for that month (zero if no data)
	// Business Logic:
	//   - Generates complete 12-month series
	//   - Only includes active transfers and cards
	//   - Uses LEFT JOIN to ensure all months appear
	//   - COALESCE returns 0 for months with no activity
	//   - Results ordered chronologically
	GetMonthlyTransferAmountSender(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTransferAmountSenderRow, error)
	// GetMonthlyTransferAmounts: Retrieves monthly transfer amounts
	// Purpose: Track total transfer amounts over each month of the selected year
	// Parameters:
	//   $1: reference_date - Any date within the target year (used to define monthly range)
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_transfer_amount: Sum of transfer amounts in that month
	// Business Logic:
	//   - Generates complete monthly series for the target year
	//   - Includes all transfers regardless of method
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Zero-fills months with no transfer activity
	//   - Useful for visualizing monthly cash flow patterns
	GetMonthlyTransferAmounts(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTransferAmountsRow, error)
	// GetMonthlyTransferAmountsByReceiverCardNumber: Retrieves monthly transfer amounts
	// Purpose: Track total transfer amounts over each month of the selected year
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: reference_date - Any date within the target year (used to define monthly range)
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_transfer_amount: Sum of transfer amounts in that month
	// Business Logic:
	//   - Generates complete monthly series for the target year
	//   - Includes all transfers regardless of method
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Zero-fills months with no transfer activity
	//   - Useful for visualizing monthly cash flow patterns
	GetMonthlyTransferAmountsByReceiverCardNumber(ctx context.Context, arg GetMonthlyTransferAmountsByReceiverCardNumberParams) ([]*GetMonthlyTransferAmountsByReceiverCardNumberRow, error)
	// GetMonthlyTransferAmountsBySenderCardNumber: Retrieves monthly transfer amounts
	// Purpose: Track total transfer amounts over each month of the selected year
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: reference_date - Any date within the target year (used to define monthly range)
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_transfer_amount: Sum of transfer amounts in that month
	// Business Logic:
	//   - Generates complete monthly series for the target year
	//   - Includes all transfers regardless of method
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Zero-fills months with no transfer activity
	//   - Useful for visualizing monthly cash flow patterns
	GetMonthlyTransferAmountsBySenderCardNumber(ctx context.Context, arg GetMonthlyTransferAmountsBySenderCardNumberParams) ([]*GetMonthlyTransferAmountsBySenderCardNumberRow, error)
	// GetMonthlyWithdrawAmount: Retrieves monthly withdraw totals for a given year
	// Purpose: Analyze monthly withdraw patterns and trends
	// Parameters:
	//   $1: reference_date - A date used to determine the year to analyze
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_withdraw_amount: Sum of withdraws for that month (zero if no data)
	// Business Logic:
	//   - Generates complete 12-month series
	//   - Only includes active withdraws and cards
	//   - Uses LEFT JOIN to ensure all months appear
	//   - COALESCE returns 0 for months with no activity
	//   - Results ordered chronologically
	GetMonthlyWithdrawAmount(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyWithdrawAmountRow, error)
	// GetMonthlyWithdrawAmountByCardNumber: Retrieves monthly withdraw history for a card
	// Purpose: Analyze monthly withdraw patterns for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_date - Date to determine analysis year
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_withdraw_amount: Monthly withdraw total (0 if none)
	// Business Logic:
	//   - Complete 12-month coverage
	//   - Card-specific filtering
	//   - Active records only
	//   - Zero-filled for missing months
	//   - Helps identify withdraw habit seasonality
	GetMonthlyWithdrawAmountByCardNumber(ctx context.Context, arg GetMonthlyWithdrawAmountByCardNumberParams) ([]*GetMonthlyWithdrawAmountByCardNumberRow, error)
	// GetMonthlyWithdraws: Retrieves monthly withdrawal totals for a given year
	// Purpose: Analyze monthly cash withdrawal patterns and trends
	// Parameters:
	//   $1: reference_date - Any date within the target year (used to define the year range)
	// Returns:
	//   month: 3-letter month abbreviation (e.g., 'Jan')
	//   total_withdraw_amount: Sum of withdrawal amounts for that month (0 if no withdrawals)
	// Business Logic:
	//   - Generates complete monthly series for the specified year
	//   - Includes all withdrawals regardless of card or status
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Zero-fills months with no withdrawal activity
	//   - Orders results chronologically by month
	//   - Useful for cash flow analysis and ATM/branch planning
	GetMonthlyWithdraws(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyWithdrawsRow, error)
	// GetMonthlyWithdrawsByCardNumber: Retrieves monthly withdrawals for a specific card
	// Purpose: Track monthly cash usage patterns for individual cardholders
	// Parameters:
	//   $1: card_number - The card number to filter withdrawals
	//   $2: reference_date - Any date within the target year
	// Returns:
	//   month: 3-letter month abbreviation
	//   total_withdraw_amount: Sum of withdrawals for that card by month
	// Business Logic:
	//   - Generates complete monthly series for the year
	//   - Filters withdrawals by specific card number
	//   - Zero-fills months with no activity for that card
	//   - Orders chronologically
	//   - Useful for individual spending pattern analysis
	GetMonthlyWithdrawsByCardNumber(ctx context.Context, arg GetMonthlyWithdrawsByCardNumberParams) ([]*GetMonthlyWithdrawsByCardNumberRow, error)
	GetResetToken(ctx context.Context, token string) (*ResetToken, error)
	// GetRole: Retrieves role details by role_id
	// Purpose: Fetch a single role record (regardless of deleted status)
	// Parameters:
	//   $1: Role ID
	// Returns:
	//   role_id, role_name, and timestamps
	GetRole(ctx context.Context, roleID int32) (*Role, error)
	// GetRoleByName: Retrieves role by exact role name
	// Purpose: Check role existence or fetch role info based on name
	// Parameters:
	//   $1: Role name (exact match)
	// Returns:
	//   role_id, role_name, and timestamps
	GetRoleByName(ctx context.Context, roleName string) (*Role, error)
	// GetRoles: Retrieves all roles (active & trashed) with optional name search and pagination
	// Purpose: General listing of roles regardless of status
	// Parameters:
	//   $1: Search query (role name, nullable)
	//   $2: Limit (number of records per page)
	//   $3: Offset (starting index for pagination)
	// Returns:
	//   role_id, role_name, timestamps, and total_count (for pagination support)
	// Business Logic:
	//   - Supports fuzzy search on role_name
	//   - Includes both active and trashed roles
	//   - Useful for admin panels with filters and pagination
	GetRoles(ctx context.Context, arg GetRolesParams) ([]*GetRolesRow, error)
	// GetSaldoByCardNumber: Retrieves saldo information for a specific card
	// Purpose: Get the current balance and details for a particular card
	// Parameters:
	//   $1: card_number - The card number to lookup
	// Returns:
	//   All saldo fields for the active record matching the card number
	// Business Logic:
	//   - Only returns active saldo records (deleted_at IS NULL)
	//   - Useful for checking card balances before transactions
	GetSaldoByCardNumber(ctx context.Context, cardNumber string) (*Saldo, error)
	// GetSaldoByID: Retrieves single active saldo by ID
	// Purpose: Fetch a specific saldo record for display or processing
	// Parameters:
	//   $1: saldo_id - Unique identifier of the saldo
	// Returns:
	//   Single saldo record if it is active (deleted_at IS NULL)
	// Business Logic:
	//   - Ensures only active saldos are returned (soft-deleted saldos are excluded)
	//   - Used for detail views or transaction lookups
	GetSaldoByID(ctx context.Context, saldoID int32) (*Saldo, error)
	// GetSaldos: Retrieves paginated list of active saldos with search capability
	// Purpose: List all active saldos for admin or user dashboard with optional filtering
	// Parameters:
	//   $1: search_term - Optional text to filter saldos by card_number (NULL for no filter)
	//   $2: limit - Maximum number of records to return
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All saldo fields plus total_count of matching records
	// Business Logic:
	//   - Excludes soft-deleted saldos (deleted_at IS NULL)
	//   - Supports partial text matching on card_number (case-insensitive)
	//   - Returns saldos ordered by saldo_id
	//   - Provides total_count for pagination calculations
	GetSaldos(ctx context.Context, arg GetSaldosParams) ([]*GetSaldosRow, error)
	// GetTopupByID: Retrieves a specific topup by ID
	// Purpose: Used to display details of a single topup transaction
	// Parameters:
	//   $1: topup_id - Unique identifier of the topup
	// Returns:
	//   Topup record matching the ID (if not soft-deleted)
	// Business Logic:
	//   - Only returns record if it is active (deleted_at IS NULL)
	GetTopupByID(ctx context.Context, topupID int32) (*Topup, error)
	// GetTopups: Retrieves paginated list of active topups with search capability
	// Purpose: Provide admin or user access to topup history with search support
	// Parameters:
	//   $1: search_term - Optional filter to match card_number, topup_no, topup_method, or status (NULL for no filter)
	//   $2: limit - Max number of records to return
	//   $3: offset - Records to skip for pagination
	// Returns:
	//   All topup fields and total_count of matching records
	// Business Logic:
	//   - Filters out soft-deleted topups (deleted_at IS NULL)
	//   - Supports partial, case-insensitive search across multiple fields
	//   - Results sorted by topup_time (most recent first)
	//   - total_count is used for frontend pagination
	GetTopups(ctx context.Context, arg GetTopupsParams) ([]*GetTopupsRow, error)
	// GetTopupsByCardNumber: Retrieves paginated topups based on card number and optional search keyword
	// Purpose: View all topups for a specific card, with filtering and pagination
	// Parameters:
	//   $1: card_number - Exact card number match
	//   $2: keyword - Optional keyword (nullable), filters topup_no, method, status
	//   $3: limit - Number of records to return
	//   $4: offset - Offset for pagination
	// Returns:
	//   All matching topup records with total_count using window function
	// Business Logic:
	//   - Skips soft-deleted records
	//   - Ordered by topup_time descending
	GetTopupsByCardNumber(ctx context.Context, arg GetTopupsByCardNumberParams) ([]*GetTopupsByCardNumberRow, error)
	// GetTotalBalance: Calculates the sum of all active card balances
	// Purpose: Get the total balance across all active cards in the system
	// Returns:
	//   Single column 'total_balance' containing the sum of all non-deleted card balances
	// Business Logic:
	//   - Only includes balances from active saldos records (s.deleted_at IS NULL)
	//   - Only includes balances from active cards (c.deleted_at IS NULL)
	//   - Useful for financial dashboards and system health monitoring
	//   - Returns NULL if no active balances exist
	GetTotalBalance(ctx context.Context) (int64, error)
	// GetTotalBalanceByCardNumber: Calculates the total balance for a specific card
	// Purpose: Get the current balance of a particular active card
	// Parameters:
	//   $1: card_number - The card number to query balance for
	// Returns:
	//   Single column 'total_balance' containing the sum balance for the specified card
	// Business Logic:
	//   - Only includes balance from active saldos records (s.deleted_at IS NULL)
	//   - Only includes balance if card is active (c.deleted_at IS NULL)
	//   - Returns NULL if card doesn't exist or has been deleted
	//   - Useful for displaying individual card balances
	GetTotalBalanceByCardNumber(ctx context.Context, cardNumber string) (int64, error)
	// GetTotalTopupAmount: Calculates the sum of all top-up transactions
	// Purpose: Get the total amount ever topped up across all active cards
	// Returns:
	//   Single column 'total_topup_amount' containing sum of all non-deleted topups
	// Business Logic:
	//   - Only includes amounts from active topups (t.deleted_at IS NULL)
	//   - Only includes amounts from active cards (c.deleted_at IS NULL)
	//   - Useful for financial reporting and reconciliation
	//   - Returns NULL if no topups exist
	GetTotalTopupAmount(ctx context.Context) (int64, error)
	// GetTotalTopupAmountByCardNumber: Calculates total top-ups for a specific card
	// Purpose: Get the lifetime top-up amount for a particular card
	// Parameters:
	//   $1: card_number - The card number to query top-ups for
	// Returns:
	//   Single column 'total_topup_amount' containing sum of all top-ups
	// Business Logic:
	//   - Only includes active topup records (t.deleted_at IS NULL)
	//   - Only includes amounts when card is active (c.deleted_at IS NULL)
	//   - Useful for card activity analysis and user statements
	GetTotalTopupAmountByCardNumber(ctx context.Context, cardNumber string) (int64, error)
	// GetTotalTransactionAmount: Calculates the sum of all payment transactions
	// Purpose: Get the total amount processed through all card transactions
	// Returns:
	//   Single column 'total_transaction_amount' containing sum of all non-deleted transactions
	// Business Logic:
	//   - Only includes amounts from active transactions (t.deleted_at IS NULL)
	//   - Only includes amounts from active cards (c.deleted_at IS NULL)
	//   - Useful for sales reporting and revenue analysis
	//   - Returns NULL if no transactions exist
	GetTotalTransactionAmount(ctx context.Context) (int64, error)
	// GetTotalTransactionAmountByCardNumber: Calculates total transactions for a card
	// Purpose: Get the lifetime transaction amount for a specific card
	// Parameters:
	//   $1: card_number - The card number to query transactions for
	// Returns:
	//   Single column 'total_transaction_amount' containing sum of all transactions
	// Business Logic:
	//   - Only includes active transaction records (t.deleted_at IS NULL)
	//   - Only includes amounts when card is active (c.deleted_at IS NULL)
	//   - Useful for spending analysis and card statements
	GetTotalTransactionAmountByCardNumber(ctx context.Context, cardNumber string) (int64, error)
	// GetTotalTransferAmount: Calculates the sum of all transfer transactions
	// Purpose: Get the total amount transferred between accounts
	// Returns:
	//   Single column 'total_transfer_amount' containing sum of all non-deleted transfers
	// Business Logic:
	//   - Includes amounts from both sides of transfers (using UNION ALL)
	//   - Only includes active transfer records (deleted_at IS NULL)
	//   - Counts both outgoing and incoming transfers in the total
	//   - Useful for monitoring money movement in the system
	//   - Returns NULL if no transfers exist
	// Note: The current implementation appears to double-count transfers by including
	//       the same table twice in the UNION ALL. This may need review.
	GetTotalTransferAmount(ctx context.Context) (int64, error)
	// GetTotalTransferAmountByReceiver: Calculates total incoming transfers to an account
	// Purpose: Get the total amount received by a specific card/account
	// Parameters:
	//   $1: transfer_to - The account/card number that received transfers
	// Returns:
	//   Single column 'total_transfer_amount' containing sum of all incoming transfers
	// Business Logic:
	//   - Only includes active transfer records (deleted_at IS NULL)
	//   - Useful for tracking money received by a particular account
	GetTotalTransferAmountByReceiver(ctx context.Context, transferTo string) (int64, error)
	// GetTotalTransferAmountBySender: Calculates total outgoing transfers from an account
	// Purpose: Get the total amount sent from a specific card/account
	// Parameters:
	//   $1: transfer_from - The account/card number that initiated transfers
	// Returns:
	//   Single column 'total_transfer_amount' containing sum of all outgoing transfers
	// Business Logic:
	//   - Only includes active transfer records (deleted_at IS NULL)
	//   - Useful for tracking money sent by a particular account
	GetTotalTransferAmountBySender(ctx context.Context, transferFrom string) (int64, error)
	// GetTotalWithdrawAmount: Calculates the sum of all withdrawal transactions
	// Purpose: Get the total amount ever withdrawn from all active cards
	// Returns:
	//   Single column 'total_withdraw_amount' containing sum of all non-deleted withdrawals
	// Business Logic:
	//   - Only includes amounts from active withdrawals (s.deleted_at IS NULL)
	//   - Only includes amounts from active cards (c.deleted_at IS NULL)
	//   - Useful for cash flow analysis and auditing
	//   - Returns NULL if no withdrawals exist
	GetTotalWithdrawAmount(ctx context.Context) (int64, error)
	// GetTotalWithdrawAmountByCardNumber: Calculates total withdrawals for a card
	// Purpose: Get the lifetime withdrawal amount for a specific card
	// Parameters:
	//   $1: card_number - The card number to query withdrawals for
	// Returns:
	//   Single column 'total_withdraw_amount' containing sum of all withdrawals
	// Business Logic:
	//   - Only includes active withdrawal records (s.deleted_at IS NULL)
	//   - Only includes amounts when card is active (c.deleted_at IS NULL)
	//   - Useful for cash flow analysis per card
	// Note: Verify table name consistency (saldos vs withdraws)
	GetTotalWithdrawAmountByCardNumber(ctx context.Context, cardNumber string) (int64, error)
	// GetTransactionByCardNumber: Retrieves paginated transactions for a specific card with optional filtering
	// Purpose: View transaction history for a particular card with search capability
	// Parameters:
	//   $1: card_number - The card number to filter transactions (exact match)
	//   $2: search_term - Optional text to filter by payment method (NULL for no filter)
	//   $3: limit - Maximum number of records to return per page
	//   $4: offset - Number of records to skip for pagination
	// Returns:
	//   All transaction fields plus total_count of matching records
	// Business Logic:
	//   - Only returns active transactions (non-deleted records)
	//   - Strict matching on card_number combined with optional payment method search
	//   - Case-insensitive partial matching on payment_method when search term provided
	//   - Orders results by transaction_time (newest transactions first)
	//   - Includes pagination metadata via total_count
	//   - Useful for cardholder transaction history views and statements
	GetTransactionByCardNumber(ctx context.Context, arg GetTransactionByCardNumberParams) ([]*GetTransactionByCardNumberRow, error)
	// GetTransactionByID: Retrieves a single transaction by its ID
	// Purpose: Get detailed information about a specific transaction
	// Parameters:
	//   $1: transaction_id - The ID of the transaction to retrieve
	// Returns:
	//   All fields for the specified transaction or NULL if not found/deleted
	// Business Logic:
	//   - Only returns active transactions (deleted_at IS NULL)
	//   - Useful for transaction details viewing and verification
	GetTransactionByID(ctx context.Context, transactionID int32) (*Transaction, error)
	// GetTransactions: Retrieves paginated transaction records with search capability
	// Purpose: List all transactions for management UI with filtering options
	// Parameters:
	//   $1: search_term - Optional text to filter transactions by card number, payment method, or status (NULL for no filter)
	//   $2: limit - Maximum number of records to return
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All transaction fields plus total_count of matching records
	// Business Logic:
	//   - Excludes soft-deleted transactions (deleted_at IS NULL)
	//   - Supports partial text matching on multiple fields (case-insensitive)
	//   - Orders by transaction_time (newest first)
	//   - Provides total_count for pagination calculations
	//   - Useful for transaction monitoring and auditing
	GetTransactions(ctx context.Context, arg GetTransactionsParams) ([]*GetTransactionsRow, error)
	// GetTransactionsByCardNumber: Retrieves paginated transactions for a specific card
	// Purpose: List all transactions associated with a particular card
	// Parameters:
	//   $1: card_number - The card number to filter transactions
	//   $2: search_term - Optional text to filter by payment method or status
	//   $3: limit - Maximum number of records to return
	//   $4: offset - Number of records to skip for pagination
	// Returns:
	//   All transaction fields plus total_count of matching records
	// Business Logic:
	//   - Only includes active transactions (deleted_at IS NULL)
	//   - Strict card number matching combined with optional search filters
	//   - Orders by transaction_time (newest first)
	//   - Provides pagination support with total_count
	//   - Useful for cardholder transaction history
	GetTransactionsByCardNumber(ctx context.Context, arg GetTransactionsByCardNumberParams) ([]*GetTransactionsByCardNumberRow, error)
	// GetTransactionsByMerchantID: Retrieves transactions for a specific merchant
	// Purpose: List all transactions associated with a merchant
	// Parameters:
	//   $1: merchant_id - The ID of the merchant to filter transactions
	// Returns:
	//   All transaction fields for the merchant's transactions
	// Business Logic:
	//   - Only includes active transactions (deleted_at IS NULL)
	//   - Orders by transaction_time (newest first)
	//   - No pagination (assumes manageable number of records per merchant)
	//   - Useful for merchant transaction reports
	GetTransactionsByMerchantID(ctx context.Context, merchantID int32) ([]*Transaction, error)
	// GetTransferByID: Retrieves a single transfer by its ID
	// Purpose: Get detailed information about a specific transfer
	// Parameters:
	//   $1: transfer_id - The ID of the transfer to retrieve
	// Returns:
	//   All fields for the specified transfer or NULL if not found/deleted
	// Business Logic:
	//   - Only returns active transfers (deleted_at IS NULL)
	//   - Useful for transfer verification and detailed viewing
	GetTransferByID(ctx context.Context, transferID int32) (*Transfer, error)
	// GetTransfers: Retrieves paginated transfer records with search capability
	// Purpose: List all active transfers for management UI with filtering options
	// Parameters:
	//   $1: search_term - Optional text to filter transfers by source or destination account (NULL for no filter)
	//   $2: limit - Maximum number of records to return per page
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All transfer fields plus total_count of matching records
	// Business Logic:
	//   - Excludes soft-deleted transfers (deleted_at IS NULL)
	//   - Supports partial text matching on transfer_from and transfer_to fields (case-insensitive)
	//   - Orders by transfer_time (newest transfers first)
	//   - Provides total_count for pagination calculations
	//   - Useful for transfer monitoring and auditing
	GetTransfers(ctx context.Context, arg GetTransfersParams) ([]*GetTransfersRow, error)
	// GetTransfersByCardNumber:  Retrieves all transfers where the given card number is either the sender or the receiver
	// Purpose:
	//   Useful for displaying all transfer history related to a specific card
	// Parameters:
	//   $1: card_number - Card number to search for in both transfer_from and transfer_to
	// Returns:
	//   All transfer columns for matched records
	// Business Logic:
	//   - Excludes soft-deleted records (deleted_at IS NULL)
	//   - Sorted by most recent transfer first (DESC)
	GetTransfersByCardNumber(ctx context.Context, transferFrom string) ([]*Transfer, error)
	// GetTransfersByDestinationCard: Retrieves all transfers where the specified card is the destination (transfer_to)
	// Purpose:
	//   Track incoming transfers for a user or card
	// Parameters:
	//   $1: card_number - The destination card number
	// Returns:
	//   All transfer columns for matched records
	// Business Logic:
	//   - Excludes soft-deleted records (deleted_at IS NULL)
	//   - Sorted by most recent transfer first (DESC)
	GetTransfersByDestinationCard(ctx context.Context, transferTo string) ([]*Transfer, error)
	// GetTransfersBySourceCard: Retrieves all transfers where the specified card is the source (transfer_from)
	// Purpose:
	//   Track outgoing transfer history for auditing or user activity
	// Parameters:
	//   $1: card_number - The source card number
	// Returns:
	//   All transfer columns for matched records
	// Business Logic:
	//   - Excludes soft-deleted records (deleted_at IS NULL)
	//   - Sorted by most recent transfer first (DESC)
	GetTransfersBySourceCard(ctx context.Context, transferFrom string) ([]*Transfer, error)
	// GetTrashedCardByID: Retrieves a single soft-deleted card by its ID
	// Purpose: View details of a specific trashed card for recovery or audit
	// Parameters:
	//   $1: card_id - The ID of the card to retrieve
	// Returns:
	//   All fields for the specified trashed card or NULL if not found or not deleted
	// Business Logic:
	//   - Only returns soft-deleted cards (deleted_at IS NOT NULL)
	//   - Useful for admin interfaces showing deleted items
	//   - Can be used before restoring a deleted card
	GetTrashedCardByID(ctx context.Context, cardID int32) (*Card, error)
	// GetTrashedCardsWithCount: Retrieves paginated list of soft-deleted cards with search capability
	// Purpose: List all trashed (soft-deleted) cards for recovery or audit purposes
	// Parameters:
	//   $1: search_term - Optional text to filter cards by number, type or provider (NULL for no filter)
	//   $2: limit - Maximum number of records to return
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All card fields plus total_count of matching records
	// Business Logic:
	//   - Includes only soft-deleted cards (deleted_at IS NOT NULL)
	//   - Supports partial text matching on card_number, card_type and card_provider fields (case-insensitive)
	//   - Returns cards ordered by card_id
	//   - Provides total_count for pagination calculations
	GetTrashedCardsWithCount(ctx context.Context, arg GetTrashedCardsWithCountParams) ([]*GetTrashedCardsWithCountRow, error)
	// GetTrashedMerchantByID: Retrieves a soft-deleted merchant by ID
	// Purpose: Access trashed merchant record for potential restoration or inspection
	// Parameters:
	//   $1: merchant_id - Unique identifier of the merchant
	// Returns:
	//   Trashed merchant record
	// Business Logic:
	//   - Includes only merchants that have been soft-deleted (deleted_at IS NOT NULL)
	GetTrashedMerchantByID(ctx context.Context, merchantID int32) (*Merchant, error)
	GetTrashedMerchantDocuments(ctx context.Context, arg GetTrashedMerchantDocumentsParams) ([]*GetTrashedMerchantDocumentsRow, error)
	// GetTrashedMerchants: Retrieves paginated list of soft-deleted merchants with search capability
	// Purpose: View trashed merchants for potential restoration or permanent deletion
	// Parameters:
	//   $1: search_term - Optional text to filter by name, api_key, or status (NULL for no filter)
	//   $2: limit - Maximum number of records to return
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All merchant fields plus total_count of matching records
	// Business Logic:
	//   - Only includes soft-deleted merchants (deleted_at IS NOT NULL)
	//   - Supports partial text search (case-insensitive) on name, api_key, and status
	//   - Returns results ordered by merchant_id
	//   - Provides total_count for pagination calculations
	GetTrashedMerchants(ctx context.Context, arg GetTrashedMerchantsParams) ([]*GetTrashedMerchantsRow, error)
	// GetTrashedRoles: Retrieves only soft-deleted roles with optional search and pagination
	// Purpose: For trash/recycle bin management
	// Parameters:
	//   $1: Search query (nullable)
	//   $2: Limit
	//   $3: Offset
	// Returns:
	//   role_id, role_name, timestamps, and total_count
	GetTrashedRoles(ctx context.Context, arg GetTrashedRolesParams) ([]*GetTrashedRolesRow, error)
	// GetTrashedSaldoByID: Retrieves a single soft-deleted saldo record by ID
	// Purpose: View details of a trashed saldo for recovery or audit purposes
	// Parameters:
	//   $1: saldo_id - The ID of the saldo record to retrieve
	// Returns:
	//   All fields for the specified trashed saldo or NULL if not found/not deleted
	// Business Logic:
	//   - Only returns soft-deleted saldos (deleted_at IS NOT NULL)
	//   - Useful for admin interfaces showing deleted items
	//   - Can be used before restoring a deleted saldo
	GetTrashedSaldoByID(ctx context.Context, saldoID int32) (*Saldo, error)
	// GetTrashedSaldos: Retrieves soft-deleted saldos with search and pagination
	// Purpose: Display trashed saldos for recovery or permanent deletion
	// Parameters:
	//   $1: search_term - Optional search by card_number (NULL for no filter)
	//   $2: limit - Max number of records
	//   $3: offset - Number of rows to skip
	// Returns:
	//   List of trashed saldos and total_count of matches
	// Business Logic:
	//   - Includes only soft-deleted saldos (deleted_at IS NOT NULL)
	//   - Partial match on card_number
	//   - Useful for building a "Trash Bin" feature in the UI
	GetTrashedSaldos(ctx context.Context, arg GetTrashedSaldosParams) ([]*GetTrashedSaldosRow, error)
	// GetTrashedTopupByID: Retrieves a topup that has been soft-deleted
	// Purpose: Preview or manage trashed entries (e.g., for restore)
	// Parameters:
	//   $1: topup_id - ID of the soft-deleted topup
	// Returns:
	//   Full topup record if found and deleted_at IS NOT NULL
	GetTrashedTopupByID(ctx context.Context, topupID int32) (*Topup, error)
	// GetTrashedTopups: Retrieves trashed (soft-deleted) topups with pagination and search
	// Purpose: Allow recovery or permanent deletion of topups
	// Parameters:
	//   $1: search_term - Optional filter to match card_number, topup_no, or topup_method
	//   $2: limit - Max records to return
	//   $3: offset - Rows to skip
	// Returns:
	//   Trashed topup records with total_count
	// Business Logic:
	//   - Only includes topups where deleted_at IS NOT NULL
	//   - Supports flexible search
	//   - Results sorted by topup_time descending
	GetTrashedTopups(ctx context.Context, arg GetTrashedTopupsParams) ([]*GetTrashedTopupsRow, error)
	// GetTrashedTransactionByID: Retrieves a single soft-deleted transaction by ID
	// Purpose: View details of a deleted transaction for recovery or audit
	// Parameters:
	//   $1: transaction_id - The ID of the transaction to retrieve
	// Returns:
	//   All fields for the specified trashed transaction or NULL if not found/active
	// Business Logic:
	//   - Only returns soft-deleted transactions (deleted_at IS NOT NULL)
	//   - Used in admin interfaces for transaction recovery
	GetTrashedTransactionByID(ctx context.Context, transactionID int32) (*Transaction, error)
	// GetTrashedTransactions: Retrieves paginated soft-deleted transactions
	// Purpose: List all deleted transactions for recovery or audit purposes
	// Parameters:
	//   $1: search_term - Optional text to filter deleted transactions
	//   $2: limit - Maximum records to return
	//   $3: offset - Records to skip for pagination
	// Returns:
	//   All transaction fields plus total_count of matching deleted records
	// Business Logic:
	//   - Only includes soft-deleted transactions (deleted_at IS NOT NULL)
	//   - Same filtering capabilities as active transactions
	//   - Maintains newest-first ordering
	//   - Used in admin interfaces for transaction recovery
	GetTrashedTransactions(ctx context.Context, arg GetTrashedTransactionsParams) ([]*GetTrashedTransactionsRow, error)
	// GetTrashedTransferByID: Retrieves a single soft-deleted transfer by its ID
	// Purpose:
	//   Used for viewing trashed data or restoring transfers
	// Parameters:
	//   $1: transfer_id - ID of the transfer
	// Returns:
	//   The transfer row if it exists and is soft-deleted
	// Business Logic:
	//   - Includes only soft-deleted records (deleted_at IS NOT NULL)
	GetTrashedTransferByID(ctx context.Context, transferID int32) (*Transfer, error)
	// GetTrashedTransfers: Retrieves paginated soft-deleted transfers
	// Purpose: List all deleted transfers for recovery or audit purposes
	// Parameters:
	//   $1: search_term - Optional text to filter deleted transfers
	//   $2: limit - Maximum records to return per page
	//   $3: offset - Records to skip for pagination
	// Returns:
	//   All transfer fields plus total_count of matching deleted records
	// Business Logic:
	//   - Only includes soft-deleted transfers (deleted_at IS NOT NULL)
	//   - Same filtering capabilities as active transfers
	//   - Maintains newest-first ordering
	//   - Used in admin interfaces for transfer recovery
	GetTrashedTransfers(ctx context.Context, arg GetTrashedTransfersParams) ([]*GetTrashedTransfersRow, error)
	// GetTrashedUserByID: Retrieve trashed user by their ID
	// Purpose: Fetch a trashed (soft-deleted) user based on their user_id.
	// Parameters:
	//   $1: user_id - The ID of the trashed user to fetch.
	// Returns:
	//   - User record matching the user_id where `deleted_at` is not NULL (indicating the user is trashed).
	// Business Logic:
	//   - Filters the users table to find a trashed user based on their `user_id`.
	//   - Checks that `deleted_at` is NOT NULL to ensure the user is trashed.
	GetTrashedUserByID(ctx context.Context, userID int32) (*User, error)
	// GetTrashedUserRoles: Retrieves all soft-deleted roles for a given user
	// Purpose: Review previously deleted role assignments for recovery or audit
	// Parameters:
	//   $1: User ID
	// Returns:
	//   user_role_id, user_id, role_id, role_name, timestamps
	// Business Logic:
	//   - Joins with roles to show role name
	//   - Orders by most recently trashed
	GetTrashedUserRoles(ctx context.Context, userID int32) ([]*GetTrashedUserRolesRow, error)
	// GetTrashedUsersWithPagination: Get Trashed Users with Pagination and Total Count
	// Purpose: Retrieve trashed (soft-deleted) users with pagination and total count
	// Parameters:
	//   $1: search_term - A search term to filter trashed users by firstname, lastname, or email
	//   $2: limit - The maximum number of trashed users to return per page
	//   $3: offset - The number of trashed users to skip (for pagination)
	// Returns:
	//   - Trashed user records matching the search term, including firstname, lastname, and email
	//   - A total count of trashed users, including all pages (using COUNT(*) OVER())
	// Business Logic:
	//   - Filters users where `deleted_at` is NOT NULL (only trashed users).
	//   - Allows filtering by search term across firstname, lastname, or email.
	//   - Returns paginated trashed users, ordered by `created_at` in descending order.
	//   - The total count of trashed users is calculated, including those that are not currently on the current page.
	GetTrashedUsersWithPagination(ctx context.Context, arg GetTrashedUsersWithPaginationParams) ([]*GetTrashedUsersWithPaginationRow, error)
	// GetTrashedWithdrawByID: Retrieves a single soft-deleted withdrawal by ID
	// Purpose: View details of a deleted withdrawal for recovery or audit
	// Parameters:
	//   $1: withdraw_id - The ID of the withdrawal to retrieve
	// Returns:
	//   All fields for the specified trashed withdrawal or NULL if not found/active
	// Business Logic:
	//   - Only returns soft-deleted withdrawals (deleted_at IS NOT NULL)
	//   - Used in admin interfaces for withdrawal recovery
	GetTrashedWithdrawByID(ctx context.Context, withdrawID int32) (*Withdraw, error)
	// GetTrashedWithdraws: Retrieves paginated soft-deleted withdrawals
	// Purpose: List all deleted withdrawals for recovery or audit purposes
	// Parameters:
	//   $1: search_term - Optional text to filter deleted withdrawals
	//   $2: limit - Maximum records to return per page
	//   $3: offset - Records to skip for pagination
	// Returns:
	//   All withdrawal fields plus total_count of matching deleted records
	// Business Logic:
	//   - Only includes soft-deleted withdrawals (deleted_at IS NOT NULL)
	//   - Same filtering capabilities as active withdrawals
	//   - Maintains newest-first ordering
	//   - Used in admin interfaces for withdrawal recovery
	GetTrashedWithdraws(ctx context.Context, arg GetTrashedWithdrawsParams) ([]*GetTrashedWithdrawsRow, error)
	// GetUserByEmail: Retrieve a user by their email
	// Purpose: Fetch a specific user based on their email.
	// Parameters:
	//   $1: email - The email of the user to fetch.
	// Returns:
	//   - User record matching the provided email with `deleted_at` being NULL (active user).
	// Business Logic:
	//   - Filters the users table by email to find a user.
	//   - Ensures that the `deleted_at` field is NULL, so only active users are returned.
	GetUserByEmail(ctx context.Context, email string) (*User, error)
	// Purpose: Retrieve a verified user by their email.
	// Parameters:
	//   $1: email - The email of the user to fetch.
	// Returns:
	//   - User record where email matches, user is verified, and not deleted.
	// Business Logic:
	//   - Must match email exactly.
	//   - `is_verified` must be true.
	//   - `deleted_at` must be NULL (not soft-deleted).
	GetUserByEmailAndVerified(ctx context.Context, email string) (*User, error)
	// GetUserByID: Retrieve a user by their ID
	// Purpose: Fetch details of a specific user by their unique user_id.
	// Parameters:
	//   $1: user_id - The ID of the user to fetch.
	// Returns:
	//   - User record matching the user_id with the `deleted_at` column being NULL (indicating the user is active).
	// Business Logic:
	//   - Filters the users table to find a user based on their `user_id`.
	//   - Ensures the user is active by checking that `deleted_at` is NULL.
	GetUserByID(ctx context.Context, userID int32) (*User, error)
	// Purpose: Fetch a user based on their verification code.
	// Parameters:
	//   $1: verification_code - The verification code of the user to fetch.
	// Returns:
	//   - User record matching the provided verification code.
	// Business Logic:
	//   - Filters the users table to find a user based on their verification code.
	GetUserByVerificationCode(ctx context.Context, verificationCode string) (*User, error)
	GetUserEmailByCardNumber(ctx context.Context, cardNumber string) (*GetUserEmailByCardNumberRow, error)
	// GetUserRoles: Retrieves all roles assigned to a specific user
	// Purpose: Identify the access level(s) of a user
	// Parameters:
	//   $1: User ID
	// Returns:
	//   List of roles (id, name, timestamps)
	GetUserRoles(ctx context.Context, userID int32) ([]*Role, error)
	// GetUsersWithPagination: Search Users with Pagination and Total Count
	// Purpose: Retrieve users with pagination and total count of users matching the search criteria
	// Parameters:
	//   $1: search_term - A search term to filter users by firstname, lastname, or email
	//   $2: limit - The maximum number of users to return per page
	//   $3: offset - The number of users to skip (for pagination)
	// Returns:
	//   - User records matching the search term, including firstname, lastname, and email
	//   - A total count of matching users, including all pages (using COUNT(*) OVER())
	// Business Logic:
	//   - Filters users by search_term (if provided), allowing case-insensitive search.
	//   - Returns paginated results, ordered by `created_at` in descending order.
	//   - The total count includes the entire dataset, not limited by pagination.
	GetUsersWithPagination(ctx context.Context, arg GetUsersWithPaginationParams) ([]*GetUsersWithPaginationRow, error)
	// GetWithdrawByID: Retrieves a single withdrawal by its ID
	// Purpose: Get detailed information about a specific withdrawal
	// Parameters:
	//   $1: withdraw_id - The ID of the withdrawal to retrieve
	// Returns:
	//   All fields for the specified withdrawal or NULL if not found/deleted
	// Business Logic:
	//   - Only returns active withdrawals (deleted_at IS NULL)
	//   - Useful for withdrawal details viewing and verification
	GetWithdrawByID(ctx context.Context, withdrawID int32) (*Withdraw, error)
	// GetWithdraws: Retrieves paginated withdrawal records with search capability
	// Purpose: List all withdrawals for management UI with filtering options
	// Parameters:
	//   $1: search_term - Optional text to filter withdrawals by various fields (NULL for no filter)
	//   $2: limit - Maximum number of records to return per page
	//   $3: offset - Number of records to skip for pagination
	// Returns:
	//   All withdrawal fields plus total_count of matching records
	// Business Logic:
	//   - Excludes soft-deleted withdrawals (deleted_at IS NULL)
	//   - Supports partial text matching on multiple fields (case-insensitive):
	//     * card_number
	//     * withdraw_amount (converted to text)
	//     * withdraw_time (converted to text)
	//     * status
	//   - Orders by withdraw_time (newest withdrawals first)
	//   - Provides total_count for pagination calculations
	//   - Useful for withdrawal monitoring and auditing
	GetWithdraws(ctx context.Context, arg GetWithdrawsParams) ([]*GetWithdrawsRow, error)
	// GetWithdrawsByCardNumber: Retrieves paginated withdrawals for a specific card with search
	// Purpose: List all withdrawals associated with a particular card
	// Parameters:
	//   $1: card_number - The card number to filter withdrawals
	//   $2: search_term - Optional text to filter by amount, time, or status
	//   $3: limit - Maximum number of records to return per page
	//   $4: offset - Number of records to skip for pagination
	// Returns:
	//   All withdrawal fields plus total_count of matching records
	// Business Logic:
	//   - Only includes active withdrawals (deleted_at IS NULL)
	//   - Strict card number matching combined with optional search filters:
	//     * withdraw_amount (converted to text for searching)
	//     * withdraw_time (formatted as string for searching)
	//     * status
	//   - Orders by withdraw_time (newest first)
	//   - Provides pagination support with total_count
	//   - Useful for cardholder withdrawal history
	GetWithdrawsByCardNumber(ctx context.Context, arg GetWithdrawsByCardNumberParams) ([]*GetWithdrawsByCardNumberRow, error)
	// GetYearlyAmountByMerchants: Retrieves total transaction amount per year for the last 5 years for a specific merchant
	// Purpose: Show overall yearly revenue trends for a merchant across all payment methods
	// Parameters:
	//   $1: api-key - The merchant to filter transactions
	//   $2: current_year - The latest year to include in the 5-year window
	// Returns:
	//   - Year (e.g., 2021, 2022)
	//   - Total transaction amount
	// Business Logic:
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Filters by specific merchant_id
	//   - Includes data for the last 5 calendar years up to the current year
	//   - Groups by calendar year
	//   - Results are ordered chronologically by year
	GetYearlyAmountByApikey(ctx context.Context, arg GetYearlyAmountByApikeyParams) ([]*GetYearlyAmountByApikeyRow, error)
	// GetYearlyAmountByMerchants: Retrieves total transaction amount per year for the last 5 years for a specific merchant
	// Purpose: Show overall yearly revenue trends for a merchant across all payment methods
	// Parameters:
	//   $1: merchant_id - The merchant to filter transactions
	//   $2: current_year - The latest year to include in the 5-year window
	// Returns:
	//   - Year (e.g., 2021, 2022)
	//   - Total transaction amount
	// Business Logic:
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Filters by specific merchant_id
	//   - Includes data for the last 5 calendar years up to the current year
	//   - Groups by calendar year
	//   - Results are ordered chronologically by year
	GetYearlyAmountByMerchants(ctx context.Context, arg GetYearlyAmountByMerchantsParams) ([]*GetYearlyAmountByMerchantsRow, error)
	// GetYearlyAmountMerchant: Retrieves total transaction amount per year for the last 5 years
	// Purpose: Show overall yearly revenue trends across all payment methods
	// Parameters:
	//   $1: current_year - The latest year to include in the 5-year window
	// Returns:
	//   - Year (e.g., 2021, 2022)
	//   - Total transaction amount
	// Business Logic:
	//   - Aggregates yearly transaction amounts
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Includes data for the last 5 calendar years up to the current year
	//   - Ordered chronologically by year
	GetYearlyAmountMerchant(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyAmountMerchantRow, error)
	// GetYearlyAmounts: Retrieves total transaction amount per year over a 5-year span
	// Purpose:
	//   Analyze annual growth or decline in transaction volume for trend analysis
	// Parameters:
	//   $1: current_year - The most recent year to include (covers current_year - 4 to current_year)
	// Returns:
	//   - year: Year of the transaction
	//   - total_amount: Total transaction amount for the year
	// Business Logic:
	//   - Excludes soft-deleted transactions (deleted_at IS NULL)
	GetYearlyAmounts(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyAmountsRow, error)
	// GetYearlyAmountsByCardNumber:  Retrieves total transaction amount per year over a 5-year span
	// Purpose:
	//   Analyze annual growth or decline in transaction volume for trend analysis
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The most recent year to include (covers current_year - 4 to current_year)
	// Returns:
	//   - year: Year of the transaction
	//   - total_amount: Total transaction amount for the year
	// Business Logic:
	//   - Excludes soft-deleted transactions (deleted_at IS NULL)
	GetYearlyAmountsByCardNumber(ctx context.Context, arg GetYearlyAmountsByCardNumberParams) ([]*GetYearlyAmountsByCardNumberRow, error)
	// GetYearlyBalances: Retrieves yearly balance totals for last 5 years
	// Purpose: Provide annual balance trends for financial reporting
	// Parameters:
	//   $1: reference_year - The target year (includes this year plus previous 4)
	// Returns:
	//   year: The 4-digit year
	//   total_balance: Sum of balances for that year
	// Business Logic:
	//   - Covers a 5-year rolling window (reference_year-4 to reference_year)
	//   - Only includes active saldos and cards
	//   - Groups by calendar year
	//   - Results ordered chronologically
	GetYearlyBalances(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyBalancesRow, error)
	// GetYearlyBalancesByCardNumber: Retrieves 5-year balance history for a specific card
	// Purpose: Show annual balance trends for individual cardholders
	// Parameters:
	//   $1: reference_year - Central year for 5-year window
	//   $2: card_number - Specific card to analyze
	// Returns:
	//   year: 4-digit year
	//   total_balance: Annual balance total
	// Business Logic:
	//   - Covers reference_year-4 to reference_year (5 years)
	//   - Strictly filters for specified card
	//   - Only includes active records
	//   - Useful for long-term financial planning
	GetYearlyBalancesByCardNumber(ctx context.Context, arg GetYearlyBalancesByCardNumberParams) ([]*GetYearlyBalancesByCardNumberRow, error)
	// GetYearlyPaymentMethodByApikey: Retrieves total transaction amount per payment method over the last 5 years for a specific merchant
	// Purpose: Analyze yearly transaction totals grouped by payment method for a merchant
	// Parameters:
	//   $1: api-key - The merchant to filter transactions
	//   $2: current_year - The latest year to include in the 5-year window
	// Returns:
	//   - Year (e.g., 2021, 2022)
	//   - Payment method
	//   - Total transaction amount
	// Business Logic:
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Filters by specific merchant_id
	//   - Includes data for the last 5 calendar years up to the current year
	//   - Groups by calendar year and payment method
	//   - Results are ordered chronologically by year
	GetYearlyPaymentMethodByApikey(ctx context.Context, arg GetYearlyPaymentMethodByApikeyParams) ([]*GetYearlyPaymentMethodByApikeyRow, error)
	// GetYearlyPaymentMethodByMerchants: Retrieves total transaction amount per payment method over the last 5 years for a specific merchant
	// Purpose: Analyze yearly transaction totals grouped by payment method for a merchant
	// Parameters:
	//   $1: current_year - The latest year to include in the 5-year window
	//   $2: merchant_id - The merchant to filter transactions
	// Returns:
	//   - Year (e.g., 2021, 2022)
	//   - Payment method
	//   - Total transaction amount
	// Business Logic:
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Filters by specific merchant_id
	//   - Includes data for the last 5 calendar years up to the current year
	//   - Groups by calendar year and payment method
	//   - Results are ordered chronologically by year
	GetYearlyPaymentMethodByMerchants(ctx context.Context, arg GetYearlyPaymentMethodByMerchantsParams) ([]*GetYearlyPaymentMethodByMerchantsRow, error)
	// GetYearlyPaymentMethodMerchant: Retrieves yearly transaction totals per payment method (last 5 years)
	// Purpose: Show transaction trends across payment methods over the past 5 years
	// Parameters:
	//   $1: current_year - The latest year to include in the 5-year window
	// Returns:
	//   - Year (e.g., 2021, 2022)
	//   - Payment method
	//   - Total transaction amount
	// Business Logic:
	//   - Aggregates yearly totals for each payment method
	//   - Includes only active (non-deleted) transactions and merchants
	//   - Covers a 5-year range: (current_year - 4) to current_year
	//   - Ordered by year
	GetYearlyPaymentMethodMerchant(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyPaymentMethodMerchantRow, error)
	// GetYearlyPaymentMethods: Retrieves yearly summary of transaction transactions grouped by payment method over a 5-year span
	// Purpose:
	//   Analyze long-term trends of transaction method usage across years
	// Parameters:
	//   $1: current_year - The most recent year to include (covers current_year - 4 to current_year)
	// Returns:
	//   - year: Year of transaction (e.g., 2020, 2021)
	//   - payment_method
	//   - total_transactions: Count of transactions per method per year
	//   - total_amount: Sum of amounts per method per year
	// Business Logic:
	//   - Filters data within a 5-year window
	//   - Excludes soft-deleted transactions (deleted_at IS NULL)
	GetYearlyPaymentMethods(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyPaymentMethodsRow, error)
	// GetYearlyPaymentMethodsByCardNumber: Retrieves yearly summary of transaction transactions grouped by payment method over a 5-year span
	// Purpose:
	//   Analyze long-term trends of transaction method usage across years
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The most recent year to include (covers current_year - 4 to current_year)
	// Returns:
	//   - year: Year of transaction (e.g., 2020, 2021)
	//   - payment_method
	//   - total_transactions: Count of transactions per method per year
	//   - total_amount: Sum of amounts per method per year
	// Business Logic:
	//   - Filters data within a 5-year window
	//   - Excludes soft-deleted transactions (deleted_at IS NULL)
	GetYearlyPaymentMethodsByCardNumber(ctx context.Context, arg GetYearlyPaymentMethodsByCardNumberParams) ([]*GetYearlyPaymentMethodsByCardNumberRow, error)
	// GetYearlySaldoBalances: Retrieves yearly balance totals for a 5-year period
	// Purpose: Show annual balance trends for long-term financial analysis
	// Parameters:
	//   $1: reference_year - The target year (includes this year plus previous 4 years)
	// Returns:
	//   year: The 4-digit year
	//   total_balance: Sum of balances for that year
	// Business Logic:
	//   - Covers a 5-year rolling window (reference_year-4 to reference_year)
	//   - Only includes active saldo records (deleted_at IS NULL)
	//   - Groups by calendar year
	//   - Results ordered chronologically
	//   - Useful for identifying year-over-year trends and growth patterns
	GetYearlySaldoBalances(ctx context.Context, dollar_1 interface{}) ([]*GetYearlySaldoBalancesRow, error)
	// GetYearlyTopupAmount: Retrieves yearly top-up totals for last 5 years
	// Purpose: Analyze long-term top-up trends and growth
	// Parameters:
	//   $1: reference_year - The target year (includes this year plus previous 4)
	// Returns:
	//   year: The 4-digit year
	//   total_topup_amount: Sum of top-ups for that year
	// Business Logic:
	//   - Covers a 5-year rolling window
	//   - Only includes active topups and cards
	//   - Groups by calendar year
	//   - Results ordered chronologically
	//   - Useful for identifying annual growth patterns
	GetYearlyTopupAmount(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTopupAmountRow, error)
	// GetYearlyTopupAmountByCardNumber: Retrieves 5-year top-up history for a card
	// Purpose: Track long-term top-up trends for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_year - Central year for 5-year window
	// Returns:
	//   year: 4-digit year
	//   total_topup_amount: Annual top-up total
	// Business Logic:
	//   - 5-year rolling window analysis
	//   - Strict card number filtering
	//   - Active records only
	//   - Chronological ordering
	//   - Useful for identifying annual top-up growth/decline
	GetYearlyTopupAmountByCardNumber(ctx context.Context, arg GetYearlyTopupAmountByCardNumberParams) ([]*GetYearlyTopupAmountByCardNumberRow, error)
	// GetYearlyTopupAmounts: Retrieves yearly total of topup amounts
	// Purpose: Analyze yearly growth or decline in topup volume
	// Parameters:
	//   $1: current_year - The latest year to include (e.g., 2024), includes 5-year span (current_year - 4)
	// Returns:
	//   year: Year extracted from topup_time
	//   total_amount: Sum of all topup amounts in the year
	// Business Logic:
	//   - Includes topup data from current year and 4 years prior
	//   - Excludes soft-deleted records (deleted_at IS NULL)
	//   - Ideal for trend lines or comparative bar charts by year
	GetYearlyTopupAmounts(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTopupAmountsRow, error)
	// GetYearlyTopupAmountsByCardNumber: Retrieves yearly total of topup amounts
	// Purpose: Analyze yearly growth or decline in topup volume
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The latest year to include (e.g., 2024), includes 5-year span (current_year - 4)
	// Returns:
	//   year: Year extracted from topup_time
	//   total_amount: Sum of all topup amounts in the year
	// Business Logic:
	//   - Includes topup data from current year and 4 years prior
	//   - Excludes soft-deleted records (deleted_at IS NULL)
	//   - Ideal for trend lines or comparative bar charts by year
	GetYearlyTopupAmountsByCardNumber(ctx context.Context, arg GetYearlyTopupAmountsByCardNumberParams) ([]*GetYearlyTopupAmountsByCardNumberRow, error)
	// GetYearlyTopupMethods: Retrieves yearly breakdown of topup usage by method
	// Purpose: Analyze how different topup methods perform over the past 5 years
	// Parameters:
	//   $1: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)
	// Returns:
	//   year: Year extracted from topup_time
	//   topup_method: Method used for topup
	//   total_topups: Number of topups using that method in the year
	//   total_amount: Total topup amount for the method in the year
	// Business Logic:
	//   - Filters to topups within a 5-year window up to the given year
	//   - Filters out soft-deleted data (deleted_at IS NULL)
	//   - Useful for detecting long-term trends across payment methods
	GetYearlyTopupMethods(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTopupMethodsRow, error)
	// GetYearlyTopupMethodsByCardNumber: Retrieves yearly breakdown of topup usage by method
	// Purpose: Analyze how different topup methods perform over the past 5 years
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)
	// Returns:
	//   year: Year extracted from topup_time
	//   topup_method: Method used for topup
	//   total_topups: Number of topups using that method in the year
	//   total_amount: Total topup amount for the method in the year
	// Business Logic:
	//   - Filters to topups within a 5-year window up to the given year
	//   - Filters out soft-deleted data (deleted_at IS NULL)
	//   - Useful for detecting long-term trends across payment methods
	GetYearlyTopupMethodsByCardNumber(ctx context.Context, arg GetYearlyTopupMethodsByCardNumberParams) ([]*GetYearlyTopupMethodsByCardNumberRow, error)
	// GetYearlyTopupStatusFailed: Retrieves yearly failed metrics for topups
	// Purpose: Compare annual failedful topup performance
	// Parameters:
	//   $1: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_failed: Count of failedful topups
	//   total_amount: Sum of failedful topup amounts
	// Business Logic:
	//   - Only includes failedful topups (status = 'failed')
	//   - Compares current year with previous year
	//   - Zero-fills years with no activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis
	GetYearlyTopupStatusFailed(ctx context.Context, dollar_1 int32) ([]*GetYearlyTopupStatusFailedRow, error)
	// GetYearlyTopupStatusFailedCardNumber: Retrieves yearly failed metrics for topups
	// Purpose: Compare annual failedful topup performance
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_failed: Count of failedful topups
	//   total_amount: Sum of failedful topup amounts
	// Business Logic:
	//   - Only includes failedful topups (status = 'failed')
	//   - Compares current year with previous year
	//   - Zero-fills years with no activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis
	GetYearlyTopupStatusFailedCardNumber(ctx context.Context, arg GetYearlyTopupStatusFailedCardNumberParams) ([]*GetYearlyTopupStatusFailedCardNumberRow, error)
	// GetYearlyTopupStatusSuccess: Retrieves yearly success metrics for topups
	// Purpose: Compare annual successful topup performance
	// Parameters:
	//   $1: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_success: Count of successful topups
	//   total_amount: Sum of successful topup amounts
	// Business Logic:
	//   - Only includes successful topups (status = 'success')
	//   - Compares current year with previous year
	//   - Zero-fills years with no activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis
	GetYearlyTopupStatusSuccess(ctx context.Context, dollar_1 int32) ([]*GetYearlyTopupStatusSuccessRow, error)
	// GetYearlyTopupStatusSuccess: Retrieves yearly success metrics for topups
	// Purpose: Compare annual successful topup performance
	// Parameters:
	//   $1: card_number       - Optional filter by card_number (NULL to ignore filter)
	//   $2: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_success: Count of successful topups
	//   total_amount: Sum of successful topup amounts
	// Business Logic:
	//   - Only includes successful topups (status = 'success')
	//   - Compares current year with previous year
	//   - Zero-fills years with no activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis
	GetYearlyTopupStatusSuccessCardNumber(ctx context.Context, arg GetYearlyTopupStatusSuccessCardNumberParams) ([]*GetYearlyTopupStatusSuccessCardNumberRow, error)
	// GetYearlyTotalAmountByApikey: Retrieves total transaction amounts for the current and previous year
	// Purpose: Provide yearly transaction summary with fallback to 0 if no transactions exist
	// Parameters:
	//   $1: current_year - The latest year to include in the summary
	//   $2: api-key - The merchant to filter transactions
	// Returns:
	//   - Year (as text)
	//   - Total transaction amount per year
	// Business Logic:
	//   - Aggregates total amounts for both the current year and the previous year
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Ensures both years appear in the result, even if no data exists (returns 0 in such case)
	//   - Uses UNION ALL to combine actual data with 0-filled placeholders
	//   - Results are ordered in descending order by year
	GetYearlyTotalAmountByApikey(ctx context.Context, arg GetYearlyTotalAmountByApikeyParams) ([]*GetYearlyTotalAmountByApikeyRow, error)
	// GetYearlyTotalAmountByMerchant: Retrieves total transaction amounts for the current and previous year
	// Purpose: Provide yearly transaction summary with fallback to 0 if no transactions exist
	// Parameters:
	//   $1: current_year - The latest year to include in the summary
	//   $2: merchant_id - The merchant to filter transactions
	// Returns:
	//   - Year (as text)
	//   - Total transaction amount per year
	// Business Logic:
	//   - Aggregates total amounts for both the current year and the previous year
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Ensures both years appear in the result, even if no data exists (returns 0 in such case)
	//   - Uses UNION ALL to combine actual data with 0-filled placeholders
	//   - Results are ordered in descending order by year
	GetYearlyTotalAmountByMerchant(ctx context.Context, arg GetYearlyTotalAmountByMerchantParams) ([]*GetYearlyTotalAmountByMerchantRow, error)
	// GetYearlyTotalAmountMerchant: Retrieves total transaction amounts for the current and previous year
	// Purpose: Provide yearly transaction summary with fallback to 0 if no transactions exist
	// Parameters:
	//   $1: current_year - The latest year to include in the summary
	// Returns:
	//   - Year (as text)
	//   - Total transaction amount per year
	// Business Logic:
	//   - Aggregates total amounts for both the current year and the previous year
	//   - Filters only active (non-deleted) transactions and merchants
	//   - Ensures both years appear in the result, even if no data exists (returns 0 in such case)
	//   - Uses UNION ALL to combine actual data with 0-filled placeholders
	//   - Results are ordered in descending order by year
	GetYearlyTotalAmountMerchant(ctx context.Context, dollar_1 int32) ([]*GetYearlyTotalAmountMerchantRow, error)
	// GetYearlyTotalSaldoBalances: Retrieves yearly balance totals for current and previous year
	// Purpose: Compare annual balance trends between current and previous year
	// Parameters:
	//   $1: current_year - The year to analyze (includes this year and previous)
	// Returns:
	//   year: The year as text
	//   total_balance: Annual balance total (0 if no data)
	// Business Logic:
	//   - Shows comparison between specified year and previous year
	//   - Only includes active saldos (deleted_at IS NULL)
	//   - Ensures both years appear with zero-filling if missing
	//   - Results ordered by year (newest first)
	//   - Useful for year-over-year financial analysis
	GetYearlyTotalSaldoBalances(ctx context.Context, dollar_1 int32) ([]*GetYearlyTotalSaldoBalancesRow, error)
	// GetYearlyTransactionAmount: Retrieves yearly transaction totals for last 5 years
	// Purpose: Analyze long-term transaction trends and growth
	// Parameters:
	//   $1: reference_year - The target year (includes this year plus previous 4)
	// Returns:
	//   year: The 4-digit year
	//   total_transaction_amount: Sum of transactions for that year
	// Business Logic:
	//   - Covers a 5-year rolling window
	//   - Only includes active transactions and cards
	//   - Groups by calendar year
	//   - Results ordered chronologically
	//   - Useful for identifying annual growth patterns
	GetYearlyTransactionAmount(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTransactionAmountRow, error)
	// GetYearlyTransactionAmountByCardNumber: Retrieves 5-year transaction history for a card
	// Purpose: Track long-term transaction trends for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_year - Central year for 5-year window
	// Returns:
	//   year: 4-digit year
	//   total_transaction_amount: Annual transaction total
	// Business Logic:
	//   - 5-year rolling window analysis
	//   - Strict card number filtering
	//   - Active records only
	//   - Chronological ordering
	//   - Useful for identifying annual transaction growth/decline
	GetYearlyTransactionAmountByCardNumber(ctx context.Context, arg GetYearlyTransactionAmountByCardNumberParams) ([]*GetYearlyTransactionAmountByCardNumberRow, error)
	// GetYearlyTransactionStatusFailed: Retrieves yearly failed metrics for transactions
	// Purpose: Compare annual failedful transaction performance
	// Parameters:
	//   $1: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_failed: Count of failedful transactions
	//   total_amount: Sum of failedful transaction amounts
	// Business Logic:
	//   - Only includes failedful transactions (status = 'failed')
	//   - Compares current year with previous year
	//   - Zero-fills years with no activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis and financial reporting
	//   - Helps identify annual transaction volume and revenue trends
	GetYearlyTransactionStatusFailed(ctx context.Context, dollar_1 int32) ([]*GetYearlyTransactionStatusFailedRow, error)
	// GetYearlyTransactionStatusFailed: Retrieves yearly failed metrics for transactions
	// Purpose: Compare annual failedful transaction performance
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_failed: Count of failedful transactions
	//   total_amount: Sum of failedful transaction amounts
	// Business Logic:
	//   - Only includes failedful transactions (status = 'failed')
	//   - Compares current year with previous year
	//   - Zero-fills years with no activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis and financial reporting
	//   - Helps identify annual transaction volume and revenue trends
	GetYearlyTransactionStatusFailedCardNumber(ctx context.Context, arg GetYearlyTransactionStatusFailedCardNumberParams) ([]*GetYearlyTransactionStatusFailedCardNumberRow, error)
	// GetYearlyTransactionStatusSuccess: Retrieves yearly success metrics for transactions
	// Purpose: Compare annual successful transaction performance
	// Parameters:
	//   $1: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_success: Count of successful transactions
	//   total_amount: Sum of successful transaction amounts
	// Business Logic:
	//   - Only includes successful transactions (status = 'success')
	//   - Compares current year with previous year
	//   - Zero-fills years with no activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis and financial reporting
	//   - Helps identify annual transaction volume and revenue trends
	GetYearlyTransactionStatusSuccess(ctx context.Context, dollar_1 int32) ([]*GetYearlyTransactionStatusSuccessRow, error)
	// GetYearlyTransactionStatusSuccessCardNumber: Retrieves yearly success metrics for transactions
	// Purpose: Compare annual successful transaction performance
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_success: Count of successful transactions
	//   total_amount: Sum of successful transaction amounts
	// Business Logic:
	//   - Only includes successful transactions (status = 'success')
	//   - Compares current year with previous year
	//   - Zero-fills years with no activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis and financial reporting
	//   - Helps identify annual transaction volume and revenue trends
	GetYearlyTransactionStatusSuccessCardNumber(ctx context.Context, arg GetYearlyTransactionStatusSuccessCardNumberParams) ([]*GetYearlyTransactionStatusSuccessCardNumberRow, error)
	// GetYearlyTransferAmountByReceiver: Retrieves 5-year transfer history for a card
	// Purpose: Track long-term transfer trends for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_year - Central year for 5-year window
	// Returns:
	//   year: 4-digit year
	//   total_sent_amount: Annual transfer total
	// Business Logic:
	//   - 5-year rolling window analysis
	//   - Strict card number filtering
	//   - Active records only
	//   - Chronological ordering
	//   - Useful for identifying annual transfer growth/decline
	GetYearlyTransferAmountByReceiver(ctx context.Context, arg GetYearlyTransferAmountByReceiverParams) ([]*GetYearlyTransferAmountByReceiverRow, error)
	// GetYearlyTransferAmountBySender: Retrieves 5-year transfer history for a card
	// Purpose: Track long-term transfer trends for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_year - Central year for 5-year window
	// Returns:
	//   year: 4-digit year
	//   total_sent_amount: Annual transfer total
	// Business Logic:
	//   - 5-year rolling window analysis
	//   - Strict card number filtering
	//   - Active records only
	//   - Chronological ordering
	//   - Useful for identifying annual transfer growth/decline
	GetYearlyTransferAmountBySender(ctx context.Context, arg GetYearlyTransferAmountBySenderParams) ([]*GetYearlyTransferAmountBySenderRow, error)
	// GetYearlyTransferAmountReceiver: Retrieves yearly transfer totals for last 5 years
	// Purpose: Analyze long-term transfer trends and growth
	// Parameters:
	//   $1: reference_year - The target year (includes this year plus previous 4)
	// Returns:
	//   year: The 4-digit year
	//   total_received_amount: Sum of transfers for that year
	// Business Logic:
	//   - Covers a 5-year rolling window
	//   - Only includes active topups and cards
	//   - Groups by calendar year
	//   - Results ordered chronologically
	//   - Useful for identifying annual growth patterns
	GetYearlyTransferAmountReceiver(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTransferAmountReceiverRow, error)
	// GetYearlyTransferAmountSender: Retrieves yearly transfer totals for last 5 years
	// Purpose: Analyze long-term transfer trends and growth
	// Parameters:
	//   $1: reference_year - The target year (includes this year plus previous 4)
	// Returns:
	//   year: The 4-digit year
	//   total_sent_amount: Sum of transfers for that year
	// Business Logic:
	//   - Covers a 5-year rolling window
	//   - Only includes active topups and cards
	//   - Groups by calendar year
	//   - Results ordered chronologically
	//   - Useful for identifying annual growth patterns
	GetYearlyTransferAmountSender(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTransferAmountSenderRow, error)
	// GetYearlyTransferAmounts: Retrieves yearly transfer amounts
	// Purpose: Analyze total transfer amounts over a 5-year period
	// Parameters:
	//   $1: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)
	// Returns:
	//   year: 4-digit year
	//   total_transfer_amount: Sum of transfer amounts in that year
	// Business Logic:
	//   - Covers a 5-year window (current_year - 4 to current_year)
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Groups by calendar year
	//   - Useful for identifying long-term money movement trends
	GetYearlyTransferAmounts(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTransferAmountsRow, error)
	// GetYearlyTransferAmountsByReceiverCardNumber: Retrieves yearly transfer amounts
	// Purpose: Analyze total transfer amounts over a 5-year period
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)
	// Returns:
	//   year: 4-digit year
	//   total_transfer_amount: Sum of transfer amounts in that year
	// Business Logic:
	//   - Covers a 5-year window (current_year - 4 to current_year)
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Groups by calendar year
	//   - Useful for identifying long-term money movement trends
	GetYearlyTransferAmountsByReceiverCardNumber(ctx context.Context, arg GetYearlyTransferAmountsByReceiverCardNumberParams) ([]*GetYearlyTransferAmountsByReceiverCardNumberRow, error)
	// GetYearlyTransferAmountsBySenderCardNumber: Retrieves yearly transfer amounts
	// Purpose: Analyze total transfer amounts over a 5-year period
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)
	// Returns:
	//   year: 4-digit year
	//   total_transfer_amount: Sum of transfer amounts in that year
	// Business Logic:
	//   - Covers a 5-year window (current_year - 4 to current_year)
	//   - Filters out soft-deleted records (deleted_at IS NULL)
	//   - Groups by calendar year
	//   - Useful for identifying long-term money movement trends
	GetYearlyTransferAmountsBySenderCardNumber(ctx context.Context, arg GetYearlyTransferAmountsBySenderCardNumberParams) ([]*GetYearlyTransferAmountsBySenderCardNumberRow, error)
	// GetYearlyTransferStatusFailed: Retrieves yearly failed metrics for fund transfers
	// Purpose: Compare annual failedful transfer performance year-over-year
	// Parameters:
	//   $1: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_failed: Count of failedful transfers
	//   total_amount: Sum of failedful transfer amounts
	// Business Logic:
	//   - Only includes failedful transfers (status = 'failed')
	//   - Compares current year with previous year
	//   - Zero-fills years with no transfer activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis and financial reporting
	//   - Helps identify annual transfer volume and money movement trends
	GetYearlyTransferStatusFailed(ctx context.Context, dollar_1 int32) ([]*GetYearlyTransferStatusFailedRow, error)
	// GetYearlyTransferStatusFailedCardNumber: Retrieves yearly failed metrics for fund transfers
	// Purpose: Compare annual failedful transfer performance year-over-year
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_failed: Count of failedful transfers
	//   total_amount: Sum of failedful transfer amounts
	// Business Logic:
	//   - Only includes failedful transfers (status = 'failed')
	//   - Compares current year with previous year
	//   - Zero-fills years with no transfer activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis and financial reporting
	//   - Helps identify annual transfer volume and money movement trends
	GetYearlyTransferStatusFailedCardNumber(ctx context.Context, arg GetYearlyTransferStatusFailedCardNumberParams) ([]*GetYearlyTransferStatusFailedCardNumberRow, error)
	// GetYearlyTransferStatusSuccess: Retrieves yearly success metrics for fund transfers
	// Purpose: Compare annual successful transfer performance year-over-year
	// Parameters:
	//   $1: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_success: Count of successful transfers
	//   total_amount: Sum of successful transfer amounts
	// Business Logic:
	//   - Only includes successful transfers (status = 'success')
	//   - Compares current year with previous year
	//   - Zero-fills years with no transfer activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis and financial reporting
	//   - Helps identify annual transfer volume and money movement trends
	GetYearlyTransferStatusSuccess(ctx context.Context, dollar_1 int32) ([]*GetYearlyTransferStatusSuccessRow, error)
	// GetYearlyTransferStatusSuccessCardNumber: Retrieves yearly success metrics for fund transfers
	// Purpose: Compare annual successful transfer performance year-over-year
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_success: Count of successful transfers
	//   total_amount: Sum of successful transfer amounts
	// Business Logic:
	//   - Only includes successful transfers (status = 'success')
	//   - Compares current year with previous year
	//   - Zero-fills years with no transfer activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year growth analysis and financial reporting
	//   - Helps identify annual transfer volume and money movement trends
	GetYearlyTransferStatusSuccessCardNumber(ctx context.Context, arg GetYearlyTransferStatusSuccessCardNumberParams) ([]*GetYearlyTransferStatusSuccessCardNumberRow, error)
	// GetYearlyWithdrawAmount: Retrieves yearly withdraw totals for last 5 years
	// Purpose: Analyze long-term withdraw trends and growth
	// Parameters:
	//   $1: reference_year - The target year (includes this year plus previous 4)
	// Returns:
	//   year: The 4-digit year
	//   total_withdraw_amount: Sum of withdraws for that year
	// Business Logic:
	//   - Covers a 5-year rolling window
	//   - Only includes active withdraws and cards
	//   - Groups by calendar year
	//   - Results ordered chronologically
	//   - Useful for identifying annual growth patterns
	GetYearlyWithdrawAmount(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyWithdrawAmountRow, error)
	// GetYearlyWithdrawAmountByCardNumber: Retrieves 5-year withdraw history for a card
	// Purpose: Track long-term withdraw trends for individual cards
	// Parameters:
	//   $1: card_number - Specific card to analyze
	//   $2: reference_year - Central year for 5-year window
	// Returns:
	//   year: 4-digit year
	//   total_withdraw_amount: Annual withdraw total
	// Business Logic:
	//   - 5-year rolling window analysis
	//   - Strict card number filtering
	//   - Active records only
	//   - Chronological ordering
	//   - Useful for identifying annual withdraw growth/decline
	GetYearlyWithdrawAmountByCardNumber(ctx context.Context, arg GetYearlyWithdrawAmountByCardNumberParams) ([]*GetYearlyWithdrawAmountByCardNumberRow, error)
	// GetYearlyWithdrawStatusFailed: Retrieves yearly failed metrics for withdrawals
	// Purpose: Compare annual failedful withdrawal performance year-over-year
	// Parameters:
	//   $1: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_failed: Count of failedful withdrawals
	//   total_amount: Sum of failedful withdrawal amounts
	// Business Logic:
	//   - Only includes failedful withdrawals (status = 'failed')
	//   - Compares current year with previous year
	//   - Zero-fills years with no withdrawal activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year cash flow analysis
	//   - Helps identify annual withdrawal patterns and liquidity trends
	GetYearlyWithdrawStatusFailed(ctx context.Context, dollar_1 int32) ([]*GetYearlyWithdrawStatusFailedRow, error)
	// GetYearlyWithdrawStatusFailedCardNumber: Retrieves yearly failed metrics for withdrawals
	// Purpose: Compare annual failedful withdrawal performance year-over-year
	// Parameters:
	//   $1: card_number  - filter by card_number
	//   $2: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_failed: Count of failedful withdrawals
	//   total_amount: Sum of failedful withdrawal amounts
	// Business Logic:
	//   - Only includes failedful withdrawals (status = 'failed')
	//   - Compares current year with previous year
	//   - Zero-fills years with no withdrawal activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year cash flow analysis
	//   - Helps identify annual withdrawal patterns and liquidity trends
	GetYearlyWithdrawStatusFailedCardNumber(ctx context.Context, arg GetYearlyWithdrawStatusFailedCardNumberParams) ([]*GetYearlyWithdrawStatusFailedCardNumberRow, error)
	// GetYearlyWithdrawStatusSuccess: Retrieves yearly success metrics for withdrawals
	// Purpose: Compare annual successful withdrawal performance year-over-year
	// Parameters:
	//   $1: current_year - The target year (includes this year and previous)
	// Returns:
	//   year: Year as text (e.g., '2023')
	//   total_success: Count of successful withdrawals
	//   total_amount: Sum of successful withdrawal amounts
	// Business Logic:
	//   - Only includes successful withdrawals (status = 'success')
	//   - Compares current year with previous year
	//   - Zero-fills years with no withdrawal activity
	//   - Orders by year (newest first)
	//   - Useful for year-over-year cash flow analysis
	//   - Helps identify annual withdrawal patterns and liquidity trends
	GetYearlyWithdrawStatusSuccess(ctx context.Context, dollar_1 int32) ([]*GetYearlyWithdrawStatusSuccessRow, error)
	GetYearlyWithdrawStatusSuccessCardNumber(ctx context.Context, arg GetYearlyWithdrawStatusSuccessCardNumberParams) ([]*GetYearlyWithdrawStatusSuccessCardNumberRow, error)
	// GetYearlyWithdraws: Retrieves yearly withdrawal totals for a 5-year period
	// Purpose: Analyze long-term withdrawal trends
	// Parameters:
	//   $1: current_year - The final year to include (includes this year and previous 4 years)
	// Returns:
	//   year: 4-digit year
	//   total_withdraw_amount: Sum of withdrawal amounts for that year
	// Business Logic:
	//   - Covers a 5-year rolling window (current_year-4 to current_year)
	//   - Only includes active withdrawal records
	//   - Groups by calendar year
	//   - Orders results chronologically
	//   - Useful for identifying annual cash usage patterns
	GetYearlyWithdraws(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyWithdrawsRow, error)
	// GetYearlyWithdrawsByCardNumber: Retrieves yearly withdrawals for a specific card
	// Purpose: Analyze long-term cash usage for individual cardholders
	// Parameters:
	//   $1: card_number - The card number to filter withdrawals
	//   $2: current_year - The final year to include (5-year window)
	// Returns:
	//   year: 4-digit year
	//   total_withdraw_amount: Sum of withdrawals for that card by year
	// Business Logic:
	//   - Covers 5-year period (current_year-4 to current_year)
	//   - Filters by specific card number
	//   - Only includes active withdrawals
	//   - Groups by calendar year
	//   - Orders chronologically
	//   - Useful for customer spending habit analysis
	GetYearlyWithdrawsByCardNumber(ctx context.Context, arg GetYearlyWithdrawsByCardNumberParams) ([]*GetYearlyWithdrawsByCardNumberRow, error)
	// RemoveRoleFromUser: Permanently removes a role from a user
	// Purpose: Hard delete of a user-role mapping (bypasses trash)
	// Parameters:
	//   $1: User ID
	//   $2: Role ID
	// Business Logic:
	//   - Deletes the record instead of soft-deleting
	//   - Use cautiously if audit/history is important
	RemoveRoleFromUser(ctx context.Context, arg RemoveRoleFromUserParams) error
	// RestoreAllCards: Restores all trashed cards
	// Purpose: Bulk-restore all soft-deleted cards
	// Parameters: None
	// Returns: Nothing
	// Business Logic:
	//   - Sets deleted_at to NULL for all trashed cards
	RestoreAllCards(ctx context.Context) error
	RestoreAllMerchantDocuments(ctx context.Context) error
	// Restore All Trashed Merchants
	// Purpose: Restore all merchants that are soft deleted
	// Business Logic:
	//   - Resets the `deleted_at` field to NULL for all merchants that have been marked as deleted.
	//   - Restores all merchants to an active state.
	RestoreAllMerchants(ctx context.Context) error
	// RestoreAllRoles: Restores all soft-deleted roles in bulk
	// Purpose: Bulk recovery of all trashed roles
	// Parameters: None
	RestoreAllRoles(ctx context.Context) error
	// RestoreAllSaldos: Recovers all trashed saldo records
	// Purpose: Mass restoration of deleted saldos
	// Business Logic:
	//   - Clears deleted_at for all trashed records
	//   - Useful for system recovery scenarios
	RestoreAllSaldos(ctx context.Context) error
	// RestoreAllTopups: Restores all soft-deleted topups in bulk
	// Purpose: Batch recovery of trashed topup data
	// Business Logic:
	//   - Sets deleted_at to NULL for all where it was not null
	RestoreAllTopups(ctx context.Context) error
	// RestoreAllTransactions: Recovers all trashed transactions
	// Purpose: Mass restoration of deleted transactions
	// Business Logic:
	//   - Clears deleted_at for all trashed records
	//   - Useful for system recovery scenarios
	//   - Should be used cautiously in production
	RestoreAllTransactions(ctx context.Context) error
	// RestoreAllTransfers: Recovers all trashed transfers
	// Purpose: Mass restoration of deleted transfers
	// Business Logic:
	//   - Clears deleted_at for all trashed transfers
	//   - Useful for system recovery
	//   - Use with caution in production
	RestoreAllTransfers(ctx context.Context) error
	// RestoreAllUsers: Restore all trashed users
	// Purpose: Restore all soft-deleted users by clearing their `deleted_at` field.
	// Business Logic:
	//   - Clears the `deleted_at` field for all trashed users, effectively restoring them.
	RestoreAllUsers(ctx context.Context) error
	// RestoreAllWithdraws: Recovers all trashed withdrawals
	// Purpose: Mass restoration of deleted withdrawals
	// Business Logic:
	//   - Clears deleted_at for all trashed withdrawals
	//   - Useful for system recovery scenarios
	//   - Should be used cautiously in production
	//   - Admin-level operation
	RestoreAllWithdraws(ctx context.Context) error
	// RestoreCard: Restores a previously trashed card
	// Purpose: Undo soft-delete of a card
	// Parameters:
	//   $1: card_id - Identifier of the card to restore
	// Returns: Nothing
	// Business Logic:
	//   - Sets deleted_at to NULL
	//   - Only affects cards that are currently trashed
	RestoreCard(ctx context.Context, cardID int32) (*Card, error)
	// Restore Trashed Merchant
	// Purpose: Restore a previously trashed (soft deleted) merchant
	// Parameters:
	//   $1: merchant_id - ID of the merchant to restore
	// Business Logic:
	//   - Resets the `deleted_at` field to NULL, restoring the merchant to an active state.
	//   - Ensures the merchant is currently trashed (deleted_at is not NULL).
	RestoreMerchant(ctx context.Context, merchantID int32) (*Merchant, error)
	RestoreMerchantDocument(ctx context.Context, documentID int32) (*MerchantDocument, error)
	// RestoreRole: Restores a previously trashed role
	// Purpose: Undelete a soft-deleted role
	// Parameters:
	//   $1: Role ID
	RestoreRole(ctx context.Context, roleID int32) (*Role, error)
	// RestoreSaldo: Recovers a soft-deleted saldo
	// Purpose: Reactivate a previously trashed saldo record
	// Parameters:
	//   $1: saldo_id - The ID of the saldo to restore
	// Business Logic:
	//   - Clears the deleted_at timestamp
	//   - Only works on currently trashed records
	RestoreSaldo(ctx context.Context, saldoID int32) (*Saldo, error)
	// RestoreTopup: Restores a soft-deleted topup by nullifying deleted_at
	// Purpose: Reactivate a previously trashed topup
	// Parameters:
	//   $1: topup_id - ID of the topup to restore
	// Business Logic:
	//   - Only applies to records where deleted_at IS NOT NULL
	RestoreTopup(ctx context.Context, topupID int32) (*Topup, error)
	// RestoreTransaction: Recovers a soft-deleted transaction
	// Purpose: Reactivate a previously trashed transaction
	// Parameters:
	//   $1: transaction_id - ID of transaction to restore
	// Business Logic:
	//   - Clears the deleted_at timestamp
	//   - Only works on currently trashed records
	//   - Used for data recovery purposes
	RestoreTransaction(ctx context.Context, transactionID int32) (*Transaction, error)
	// RestoreTransfer: Recovers a soft-deleted transfer
	// Purpose: Reactivate a previously deleted transfer
	// Parameters:
	//   $1: transfer_id - ID of transfer to restore
	// Business Logic:
	//   - Clears deleted_at timestamp
	//   - Only works on trashed transfers
	RestoreTransfer(ctx context.Context, transferID int32) (*Transfer, error)
	// RestoreUser: Recovers a soft-deleted user
	// Purpose: Reactivate a previously deactivated user
	// Parameters:
	//   $1: user_id - ID of user to restore
	// Returns: The restored user record
	// Business Logic:
	//   - Nullifies the deleted_at field
	//   - Only works on previously deleted users
	//   - Restores full account access
	//   - Maintains all original user data
	RestoreUser(ctx context.Context, userID int32) (*User, error)
	// RestoreUserRole: Restores a trashed user-role relation
	// Purpose: Reactivate a previously soft-deleted user-role
	// Parameters:
	//   $1: user_role_id
	// Business Logic:
	//   - Clears the deleted_at field to mark as active again
	RestoreUserRole(ctx context.Context, userRoleID int32) error
	// RestoreWithdraw: Recovers a soft-deleted withdrawal
	// Purpose: Reactivate a previously deleted withdrawal
	// Parameters:
	//   $1: withdraw_id - ID of withdrawal to restore
	// Business Logic:
	//   - Clears the deleted_at timestamp (sets to NULL)
	//   - Only works on currently trashed withdrawals
	//   - Used for data recovery purposes
	RestoreWithdraw(ctx context.Context, withdrawID int32) (*Withdraw, error)
	// SearchUsersByEmail: Search users by email with case-insensitive matching
	// Purpose: Allows searching for users whose email matches a given search term (case-insensitive).
	// Parameters:
	//   $1: email_search_term - A partial or full email address to search for.
	// Returns:
	//   - List of users whose emails match the search term.
	//   - The results are ordered by the `created_at` column in descending order.
	// Business Logic:
	//   - Uses `ILIKE` to perform a case-insensitive search on the `email` column.
	//   - Only returns active users (`deleted_at IS NULL`).
	SearchUsersByEmail(ctx context.Context, dollar_1 sql.NullString) ([]*User, error)
	// TrashCard: Soft-deletes a card by marking deleted_at
	// Purpose: Temporarily remove a card without deleting it permanently
	// Parameters:
	//   $1: card_id - Identifier of the card to be trashed
	// Returns: Nothing
	// Business Logic:
	//   - Sets deleted_at to current timestamp
	//   - Only affects cards not already trashed
	TrashCard(ctx context.Context, cardID int32) (*Card, error)
	// Trash Merchant
	// Purpose: Mark a merchant as deleted (soft delete)
	// Parameters:
	//   $1: merchant_id - ID of the merchant to be trashed
	// Business Logic:
	//   - Sets the `deleted_at` timestamp to the current time for the specified merchant.
	//   - Marks the merchant as deleted, without permanently removing it from the database.
	//   - Ensures the merchant is not already marked as deleted (deleted_at is NULL).
	TrashMerchant(ctx context.Context, merchantID int32) (*Merchant, error)
	TrashMerchantDocument(ctx context.Context, documentID int32) (*MerchantDocument, error)
	// TrashRole: Soft-deletes a role (moves to trash)
	// Purpose: Mark role as deleted without removing it permanently
	// Parameters:
	//   $1: Role ID
	TrashRole(ctx context.Context, roleID int32) (*Role, error)
	// TrashSaldo: Soft-deletes a saldo record
	// Purpose: Remove a saldo from active use without permanent deletion
	// Parameters:
	//   $1: saldo_id - The ID of the saldo to trash
	// Business Logic:
	//   - Sets deleted_at timestamp
	//   - Only affects currently active records
	//   - Preserves data for possible recovery
	TrashSaldo(ctx context.Context, saldoID int32) (*Saldo, error)
	// TrashTopup: Soft deletes a topup by setting deleted_at
	// Purpose: Moves topup to trash without losing data
	// Parameters:
	//   $1: topup_id - ID of the topup to soft-delete
	// Business Logic:
	//   - Only active (non-deleted) records can be trashed
	//   - Allows restore in future
	TrashTopup(ctx context.Context, topupID int32) (*Topup, error)
	// TrashTransaction: Soft-deletes a transaction record
	// Purpose: Remove transaction from active use without permanent deletion
	// Parameters:
	//   $1: transaction_id - ID of transaction to trash
	// Business Logic:
	//   - Sets deleted_at timestamp
	//   - Preserves data for audit/recovery purposes
	//   - Only affects currently active records
	TrashTransaction(ctx context.Context, transactionID int32) (*Transaction, error)
	// TrashTransfer: Soft-deletes a transfer
	// Purpose: Remove transfer from active view without permanent deletion
	// Parameters:
	//   $1: transfer_id - ID of transfer to trash
	// Business Logic:
	//   - Sets deleted_at timestamp
	//   - Only affects active transfers
	//   - Preserves data for audit/recovery
	TrashTransfer(ctx context.Context, transferID int32) (*Transfer, error)
	// TrashUser: Soft-deletes a user account
	// Purpose: Deactivate user without permanent deletion
	// Parameters:
	//   $1: user_id - ID of user to deactivate
	// Returns: The soft-deleted user record
	// Business Logic:
	//   - Sets deleted_at timestamp to current time
	//   - Only processes currently active users
	//   - Preserves all user data for potential restoration
	//   - Prevents login while deleted
	TrashUser(ctx context.Context, userID int32) (*User, error)
	// TrashUserRole: Soft deletes a user-role mapping (moves to trash)
	// Purpose: Temporarily disable a role assignment without permanent deletion
	// Parameters:
	//   $1: user_role_id (primary key of the mapping)
	// Business Logic:
	//   - Sets deleted_at timestamp, indicating the relation is inactive
	TrashUserRole(ctx context.Context, userRoleID int32) error
	// TrashWithdraw: Soft-deletes a withdrawal record
	// Purpose: Remove withdrawal from active view without permanent deletion
	// Parameters:
	//   $1: withdraw_id - ID of withdrawal to trash
	// Business Logic:
	//   - Sets deleted_at timestamp to current time
	//   - Only affects active withdrawals
	//   - Preserves data for audit/recovery purposes
	//   - Withdrawal remains in database but hidden
	TrashWithdraw(ctx context.Context, withdrawID int32) (*Withdraw, error)
	// UpdateCard: Updates an existing card's details
	// Purpose: Modify card attributes for a specific card
	// Parameters:
	//   $1: card_id - Identifier of the card to update
	//   $2: card_type - New card type
	//   $3: expire_date - New expiration date
	//   $4: cvv - New CVV
	//   $5: card_provider - New card provider
	// Returns: Nothing
	// Business Logic:
	//   - Automatically updates updated_at timestamp
	//   - Only updates cards that are not soft-deleted
	UpdateCard(ctx context.Context, arg UpdateCardParams) (*Card, error)
	// Update Merchant
	// Purpose: Update an existing merchant record
	// Parameters:
	//   $1: merchant_id - ID of the merchant to be updated
	//   $2: name - The new name for the merchant
	//   $3: user_id - New user ID associated with the merchant
	//   $4: status - New status for the merchant
	// Business Logic:
	//   - Updates the specified merchant's name, user_id, and status.
	//   - Ensures the merchant is not marked as deleted (deleted_at is NULL).
	//   - Sets the updated_at timestamp to the current time.
	UpdateMerchant(ctx context.Context, arg UpdateMerchantParams) (*Merchant, error)
	UpdateMerchantDocument(ctx context.Context, arg UpdateMerchantDocumentParams) (*MerchantDocument, error)
	UpdateMerchantDocumentStatus(ctx context.Context, arg UpdateMerchantDocumentStatusParams) (*MerchantDocument, error)
	// Purpose: Update only the status of an existing merchant
	// Parameters:
	//   $1: merchant_id - ID of the merchant to update
	//   $2: status - New status to set for the merchant
	// Business Logic:
	//   - Updates the status of the specified merchant.
	//   - Ensures the merchant is not marked as deleted (deleted_at is NULL).
	//   - Sets the updated_at timestamp to the current time.
	UpdateMerchantStatus(ctx context.Context, arg UpdateMerchantStatusParams) (*Merchant, error)
	// UpdateRefreshTokenByUserId: Updates refresh token for a user
	// Purpose: Rotate/refresh token for a user
	// Parameters:
	//   $1: user_id - ID of the user to update token for
	//   $2: token - New token string
	//   $3: expiration - New expiration timestamp
	// Business Logic:
	//   - Updates token and expiration fields
	//   - Sets updated_at to current time
	//   - Only modifies active tokens
	//   - Used during token rotation flows
	UpdateRefreshTokenByUserId(ctx context.Context, arg UpdateRefreshTokenByUserIdParams) (*RefreshToken, error)
	// UpdateRole: Updates role name by ID
	// Purpose: Modify role information (e.g., name correction)
	// Parameters:
	//   $1: Role ID
	//   $2: New role name
	// Returns:
	//   Updated role's data
	UpdateRole(ctx context.Context, arg UpdateRoleParams) (*Role, error)
	// UpdateSaldo: Modifies saldo record details
	// Purpose: Update card number and balance for an existing saldo
	// Parameters:
	//   $1: saldo_id - The ID of the saldo to update
	//   $2: card_number - New card number to associate
	//   $3: total_balance - New balance amount
	// Business Logic:
	//   - Only updates active records (deleted_at IS NULL)
	//   - Automatically updates the modification timestamp
	//   - Useful for administrative corrections
	UpdateSaldo(ctx context.Context, arg UpdateSaldoParams) (*Saldo, error)
	// UpdateSaldoBalance: Updates only the balance amount for a card
	// Purpose: Adjust card balance without changing card association
	// Parameters:
	//   $1: card_number - The card number to update
	//   $2: total_balance - New balance amount
	// Business Logic:
	//   - Card-specific update (uses card_number instead of saldo_id)
	//   - Only updates active records
	//   - Useful for balance adjustments and corrections
	UpdateSaldoBalance(ctx context.Context, arg UpdateSaldoBalanceParams) (*Saldo, error)
	// UpdateSaldoWithdraw: Processes a withdrawal transaction
	// Purpose: Record a withdrawal and update the remaining balance
	// Parameters:
	//   $1: card_number - The card used for withdrawal
	//   $2: withdraw_amount - The amount being withdrawn
	//   $3: withdraw_time - Timestamp of the withdrawal
	// Business Logic:
	//   - Only processes if sufficient balance exists (total_balance >= $2)
	//   - Updates both withdrawal amount and remaining balance
	//   - Records withdrawal timestamp
	//   - Only affects active records
	UpdateSaldoWithdraw(ctx context.Context, arg UpdateSaldoWithdrawParams) (*Saldo, error)
	// UpdateTopup: Updates an existing topup transaction
	// Purpose: Modify existing topup information by ID
	// Parameters:
	//   $1: topup_id - ID of the topup to update
	//   $2: card_number - Updated card number
	//   $3: topup_amount - Updated amount
	//   $4: topup_method - Updated payment method
	//   $5: topup_time - Updated transaction time
	// Business Logic:
	//   - Skips soft-deleted records (deleted_at IS NULL)
	//   - Updates updated_at automatically
	UpdateTopup(ctx context.Context, arg UpdateTopupParams) (*Topup, error)
	// UpdateTopupAmount: Updates only the topup_amount field for a specific topup
	// Purpose: Allow adjustment of topup amount without affecting other fields
	// Parameters:
	//   $1: topup_id - ID of the target topup
	//   $2: new topup amount
	// Business Logic:
	//   - Ignores deleted entries
	//   - Automatically updates the updated_at timestamp
	UpdateTopupAmount(ctx context.Context, arg UpdateTopupAmountParams) (*Topup, error)
	// UpdateTopupStatus: Updates the status of a specific topup
	// Purpose: Mark topup as 'success', 'failed', etc.
	// Parameters:
	//   $1: topup_id - ID of the topup
	//   $2: new status value (e.g., 'success', 'failed')
	// Business Logic:
	//   - Applies only to active (non-deleted) records
	//   - updated_at is refreshed
	UpdateTopupStatus(ctx context.Context, arg UpdateTopupStatusParams) (*Topup, error)
	// UpdateTransaction: Modifies an existing transaction's details
	// Purpose: Update transaction information
	// Parameters:
	//   $1: transaction_id - ID of transaction to update
	//   $2: card_number - Updated card number
	//   $3: amount - Updated transaction amount
	//   $4: payment_method - Updated payment method
	//   $5: merchant_id - Updated merchant ID
	//   $6: transaction_time - Updated transaction timestamp
	// Business Logic:
	//   - Only updates active transactions (non-deleted)
	//   - Automatically updates the modification timestamp
	//   - Used for correcting transaction details
	UpdateTransaction(ctx context.Context, arg UpdateTransactionParams) (*Transaction, error)
	// UpdateTransactionStatus: Changes a transaction's status
	// Purpose: Update transaction processing status
	// Parameters:
	//   $1: transaction_id - ID of transaction to update
	//   $2: status - New status (e.g., 'success', 'failed', 'pending')
	// Business Logic:
	//   - Only updates active transactions
	//   - Used to reflect transaction processing outcomes
	//   - Important for reconciliation and reporting
	UpdateTransactionStatus(ctx context.Context, arg UpdateTransactionStatusParams) (*Transaction, error)
	// UpdateTransfer: Modifies transfer details
	// Purpose: Update all fields of an existing transfer
	// Parameters:
	//   $1: transfer_id - ID of transfer to update
	//   $2: transfer_from - Updated source account
	//   $3: transfer_to - Updated destination account
	//   $4: transfer_amount - Updated amount
	//   $5: transfer_time - Updated timestamp
	// Business Logic:
	//   - Only updates active transfers (non-deleted)
	//   - Updates modification timestamp automatically
	//   - Used for correcting transfer details
	UpdateTransfer(ctx context.Context, arg UpdateTransferParams) (*Transfer, error)
	// UpdateTransferAmount: Changes only the transfer amount
	// Purpose: Adjust the amount of a transfer
	// Parameters:
	//   $1: transfer_id - ID of transfer to update
	//   $2: transfer_amount - New transfer amount
	// Business Logic:
	//   - Only updates active transfers
	//   - Updates both amount and transfer timestamp
	//   - Used for amount corrections
	UpdateTransferAmount(ctx context.Context, arg UpdateTransferAmountParams) (*Transfer, error)
	// UpdateTransferStatus: Changes transfer status
	// Purpose: Update processing status of a transfer
	// Parameters:
	//   $1: transfer_id - ID of transfer to update
	//   $2: status - New status (e.g., 'completed', 'failed')
	// Business Logic:
	//   - Only updates active transfers
	//   - Updates modification timestamp
	//   - Used to reflect transfer processing outcomes
	UpdateTransferStatus(ctx context.Context, arg UpdateTransferStatusParams) (*Transfer, error)
	// UpdateUser: Modifies user account information
	// Purpose: Update user profile details
	// Parameters:
	//   $1: user_id - ID of user to update
	//   $2: firstname - Updated first name
	//   $3: lastname - Updated last name
	//   $4: email - Updated email address
	//   $5: password - New hashed password (optional)
	// Returns: Updated user record
	// Business Logic:
	//   - Auto-updates updated_at timestamp
	//   - Only modifies active (non-deleted) users
	//   - Validates email uniqueness
	//   - Password field optional (can maintain existing)
	UpdateUser(ctx context.Context, arg UpdateUserParams) (*User, error)
	UpdateUserIsVerified(ctx context.Context, arg UpdateUserIsVerifiedParams) (*User, error)
	UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (*User, error)
	// UpdateWithdraw: Modifies withdrawal details
	// Purpose: Update withdrawal information
	// Parameters:
	//   $1: withdraw_id - ID of withdrawal to update
	//   $2: card_number - Updated card number
	//   $3: withdraw_amount - Updated withdrawal amount
	//   $4: withdraw_time - Updated withdrawal timestamp
	// Business Logic:
	//   - Only updates active withdrawals (non-deleted)
	//   - Updates modification timestamp automatically
	//   - Used for correcting withdrawal records
	//   - Requires original withdrawal record exists
	UpdateWithdraw(ctx context.Context, arg UpdateWithdrawParams) (*Withdraw, error)
	// UpdateWithdrawStatus: Changes withdrawal status
	// Purpose: Update processing status of a withdrawal
	// Parameters:
	//   $1: withdraw_id - ID of withdrawal to update
	//   $2: status - New status (e.g., 'completed', 'failed', 'pending')
	// Business Logic:
	//   - Only updates active withdrawals
	//   - Updates modification timestamp
	//   - Used to reflect withdrawal processing outcomes
	//   - Important for reconciliation purposes
	UpdateWithdrawStatus(ctx context.Context, arg UpdateWithdrawStatusParams) (*Withdraw, error)
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AssignRoleToUser

func (q *Queries) AssignRoleToUser(ctx context.Context, arg AssignRoleToUserParams) (*UserRole, error)

AssignRoleToUser: Assigns a role to a user (creates a user-role relation) Purpose: Role management for user access control Parameters:

$1: User ID
$2: Role ID

Returns:

user_role_id, user_id, role_id, timestamps (incl. deleted_at for future status check)

Business Logic:

  • Adds a new entry in the user_roles mapping table
  • Timestamps created_at and updated_at auto-set to current

func (*Queries) CreateCard

func (q *Queries) CreateCard(ctx context.Context, arg CreateCardParams) (*Card, error)

CreateCard: Creates a new card record Purpose: Add a new card to the system for a specific user Parameters:

$1: user_id - Owner of the card
$2: card_number - Unique number of the card
$3: card_type - Type of the card (e.g., debit, credit)
$4: expire_date - Expiration date of the card
$5: cvv - Card verification value
$6: card_provider - Provider/issuer of the card

Returns: Complete created card record Business Logic:

  • Automatically sets created_at and updated_at timestamps
  • Requires all fields to be provided

func (*Queries) CreateMerchant

func (q *Queries) CreateMerchant(ctx context.Context, arg CreateMerchantParams) (*Merchant, error)

Create Merchant Purpose: Insert a new merchant record into the database Parameters:

$1: name - The name of the merchant
$2: api_key - Unique API key for the merchant
$3: user_id - ID of the user associated with the merchant
$4: status - Current status of the merchant (e.g., active, inactive)

Returns:

  • The newly created merchant record

Business Logic:

  • Inserts a new merchant with the provided details.
  • Sets the created_at and updated_at timestamps to the current time.
  • Returns the created merchant's data using the RETURNING clause.

func (*Queries) CreateMerchantDocument

func (q *Queries) CreateMerchantDocument(ctx context.Context, arg CreateMerchantDocumentParams) (*MerchantDocument, error)

func (*Queries) CreateRefreshToken

func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (*RefreshToken, error)

CreateRefreshToken: Creates a new refresh token Purpose: Generate a refresh token for user authentication Parameters:

$1: user_id - ID of the user this token belongs to
$2: token - The actual refresh token string
$3: expiration - Expiration timestamp of the token

Returns: The created refresh token record (excluding sensitive fields if any) Business Logic:

  • Sets both created_at and updated_at to current timestamp
  • Used in JWT refresh token rotation
  • Typically created during login/auth flows

func (*Queries) CreateResetToken

func (q *Queries) CreateResetToken(ctx context.Context, arg CreateResetTokenParams) (*ResetToken, error)

func (*Queries) CreateRole

func (q *Queries) CreateRole(ctx context.Context, roleName string) (*Role, error)

CreateRole: Inserts a new role into the system Purpose: Add new role definitions (e.g., Admin, Cashier, etc.) Parameters:

$1: Role name

Returns:

Newly created role's full data (including timestamps)

func (*Queries) CreateSaldo

func (q *Queries) CreateSaldo(ctx context.Context, arg CreateSaldoParams) (*Saldo, error)

CreateSaldo: Creates a new saldo record Purpose: Initialize a balance record for a new card Parameters:

$1: card_number - The card number to associate with this saldo
$2: total_balance - The initial balance amount

Returns:

The newly created saldo record

Business Logic:

  • Sets creation and update timestamps automatically
  • Used when issuing new cards

func (*Queries) CreateTopup

func (q *Queries) CreateTopup(ctx context.Context, arg CreateTopupParams) (*Topup, error)

CreateTopup: Inserts a new topup transaction into the topups table Purpose: Used when a user performs a topup action Parameters:

$1: card_number - The card number receiving the topup
$2: topup_amount - Amount of the topup
$3: topup_method - Payment method used (e.g., 'e-wallet', 'bank_transfer')
$4: topup_time - Timestamp of the actual topup transaction

Returns:

Full topup record including auto-generated fields

Business Logic:

  • Automatically sets created_at and updated_at to current timestamp

func (*Queries) CreateTransaction

func (q *Queries) CreateTransaction(ctx context.Context, arg CreateTransactionParams) (*Transaction, error)

CreateTransaction: Creates a new transaction record Purpose: Record a financial transaction in the system Parameters:

$1: card_number - The card used for the transaction
$2: amount - The transaction amount
$3: payment_method - Payment method used (e.g., 'credit', 'debit')
$4: merchant_id - ID of the merchant where transaction occurred
$5: transaction_time - Timestamp of when transaction occurred

Returns:

The newly created transaction record with all fields

Business Logic:

  • Sets creation and update timestamps automatically
  • Used for recording purchases, payments, and other financial activities

func (*Queries) CreateTransfer

func (q *Queries) CreateTransfer(ctx context.Context, arg CreateTransferParams) (*Transfer, error)

CreateTransfer: Records a new transfer transaction Purpose: Create a transfer between accounts/cards Parameters:

$1: transfer_from - Source account/card number
$2: transfer_to - Destination account/card number
$3: transfer_amount - Amount transferred
$4: transfer_time - When the transfer occurred
$5: status - Initial status of the transfer

Returns:

The newly created transfer record

Business Logic:

  • Sets creation and update timestamps automatically
  • Used for recording money movements between accounts

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (*User, error)

CreateUser: Insert a new user into the users table Purpose: Add a new user to the system. Parameters:

$1: firstname - The first name of the user.
$2: lastname - The last name of the user.
$3: email - The email address of the user.
$4: password - The password of the user (hashed).

Returns:

  • The newly created user record.

Business Logic:

  • Inserts a new user record into the `users` table with the current timestamp for `created_at` and `updated_at`.

func (*Queries) CreateWithdraw

func (q *Queries) CreateWithdraw(ctx context.Context, arg CreateWithdrawParams) (*Withdraw, error)

CreateWithdraw: Records a new cash withdrawal Purpose: Create a withdrawal transaction in the system Parameters:

$1: card_number - The card used for withdrawal
$2: withdraw_amount - The amount withdrawn
$3: withdraw_time - When the withdrawal occurred
$4: created_at - Timestamp of record creation

Returns:

The newly created withdrawal record with all fields

Business Logic:

  • Sets creation and update timestamps automatically
  • Used for recording ATM/branch cash withdrawals
  • Typically triggered after successful cash dispense

func (*Queries) DeleteAllPermanentCards

func (q *Queries) DeleteAllPermanentCards(ctx context.Context) error

DeleteAllPermanentCards: Permanently deletes all trashed cards Purpose: Bulk-delete all cards that have been soft-deleted Parameters: None Returns: Nothing Business Logic:

  • Deletes only cards with deleted_at set

func (*Queries) DeleteAllPermanentMerchantDocuments

func (q *Queries) DeleteAllPermanentMerchantDocuments(ctx context.Context) error

func (*Queries) DeleteAllPermanentMerchants

func (q *Queries) DeleteAllPermanentMerchants(ctx context.Context) error

Delete All Trashed Merchants Permanently Purpose: Permanently delete all merchants that are soft deleted Business Logic:

  • Permanently deletes all merchants that have been soft deleted (i.e., deleted_at is not NULL).
  • Removes these merchants completely from the database.

func (*Queries) DeleteAllPermanentRoles

func (q *Queries) DeleteAllPermanentRoles(ctx context.Context) error

DeleteAllPermanentRoles: Permanently deletes all soft-deleted roles Purpose: Bulk cleanup of trashed roles Parameters: None

func (*Queries) DeleteAllPermanentSaldos

func (q *Queries) DeleteAllPermanentSaldos(ctx context.Context) error

DeleteAllPermanentSaldos: Permanently removes all trashed saldos Purpose: Clean up all soft-deleted records Business Logic:

  • Irreversible bulk deletion
  • Only affects records marked as deleted
  • Frees database space from old records

func (*Queries) DeleteAllPermanentTopups

func (q *Queries) DeleteAllPermanentTopups(ctx context.Context) error

DeleteAllPermanentTopups: Permanently deletes all soft-deleted topups Purpose: Bulk cleanup of trashed topup records Business Logic:

  • Cannot be undone; this is a hard delete
  • Use for permanent data purging

func (*Queries) DeleteAllPermanentTransactions

func (q *Queries) DeleteAllPermanentTransactions(ctx context.Context) error

DeleteAllPermanentTransactions: Permanently removes all trashed transactions Purpose: Clean up all soft-deleted transaction records Business Logic:

  • Irreversible bulk deletion
  • Only affects records marked as deleted
  • Frees database space from old records
  • Typically used during maintenance periods

func (*Queries) DeleteAllPermanentTransfers

func (q *Queries) DeleteAllPermanentTransfers(ctx context.Context) error

DeleteAllPermanentTransfers: Permanently removes all trashed transfers Purpose: Clean up all soft-deleted transfers Business Logic:

  • Irreversible bulk deletion
  • Only affects trashed records
  • Frees database space

func (*Queries) DeleteAllPermanentUsers

func (q *Queries) DeleteAllPermanentUsers(ctx context.Context) error

DeleteAllPermanentUsers: Permanently delete all trashed users Purpose: Permanently delete all trashed user records from the database. Business Logic:

  • Deletes all users who have been trashed (soft-deleted), i.e., where `deleted_at` is not NULL.

func (*Queries) DeleteAllPermanentWithdraws

func (q *Queries) DeleteAllPermanentWithdraws(ctx context.Context) error

DeleteAllPermanentWithdraws: Permanently removes all trashed withdrawals Purpose: Clean up all soft-deleted withdrawal records Business Logic:

  • Irreversible bulk deletion
  • Only affects records marked as deleted
  • Frees database space from old records
  • Typically used during maintenance periods
  • Requires admin privileges

func (*Queries) DeleteCardPermanently

func (q *Queries) DeleteCardPermanently(ctx context.Context, cardID int32) error

DeleteCardPermanently: Removes a trashed card from the database Purpose: Permanently delete a card that has been soft-deleted Parameters:

$1: card_id - Identifier of the card to permanently delete

Returns: Nothing Business Logic:

  • Only deletes cards that are currently trashed

func (*Queries) DeleteMerchantDocumentPermanently

func (q *Queries) DeleteMerchantDocumentPermanently(ctx context.Context, documentID int32) error

func (*Queries) DeleteMerchantPermanently

func (q *Queries) DeleteMerchantPermanently(ctx context.Context, merchantID int32) error

Delete Merchant Permanently Purpose: Permanently delete a merchant from the database Parameters:

$1: merchant_id - ID of the merchant to be permanently deleted

Business Logic:

  • Deletes the specified merchant from the database.
  • Ensures the merchant is marked as deleted (deleted_at is not NULL).

func (*Queries) DeletePermanentRole

func (q *Queries) DeletePermanentRole(ctx context.Context, roleID int32) error

DeletePermanentRole: Permanently deletes a trashed role Purpose: Remove role from DB after soft delete Parameters:

$1: Role ID

func (*Queries) DeleteRefreshToken

func (q *Queries) DeleteRefreshToken(ctx context.Context, token string) error

DeleteRefreshToken: Permanently deletes a refresh token Purpose: Invalidate a specific refresh token Parameters:

$1: token - The token string to delete

Business Logic:

  • Hard deletes the token record
  • Used during logout/token invalidation
  • Prevents token reuse after deletion

func (*Queries) DeleteRefreshTokenByUserId

func (q *Queries) DeleteRefreshTokenByUserId(ctx context.Context, userID int32) error

DeleteRefreshTokenByUserId: Permanently deletes all tokens for a user Purpose: Invalidate all refresh tokens for a user Parameters:

$1: user_id - ID of the user whose tokens to delete

Business Logic:

  • Hard deletes all tokens for the user
  • Used during password reset or account lock
  • Ensures complete session invalidation

func (*Queries) DeleteResetToken

func (q *Queries) DeleteResetToken(ctx context.Context, userID int64) error

func (*Queries) DeleteSaldoPermanently

func (q *Queries) DeleteSaldoPermanently(ctx context.Context, saldoID int32) error

DeleteSaldoPermanently: Hard-deletes a trashed saldo Purpose: Permanently remove a previously soft-deleted record Parameters:

$1: saldo_id - The ID of the saldo to delete

Business Logic:

  • Physical deletion from database
  • Only works on already trashed records
  • Irreversible operation

func (*Queries) DeleteTopupPermanently

func (q *Queries) DeleteTopupPermanently(ctx context.Context, topupID int32) error

DeleteTopupPermanently: Permanently deletes a topup record from the database Purpose: Irrecoverably removes topup data Parameters:

$1: topup_id - ID of the topup to delete

Business Logic:

  • No soft-delete; data is permanently erased
  • Use with caution

func (*Queries) DeleteTransactionPermanently

func (q *Queries) DeleteTransactionPermanently(ctx context.Context, transactionID int32) error

DeleteTransactionPermanently: Hard-deletes a trashed transaction Purpose: Permanently remove a transaction from the system Parameters:

$1: transaction_id - ID of transaction to delete

Business Logic:

  • Physical deletion from database
  • Only works on already trashed records
  • Irreversible operation
  • Used for data cleanup after retention period

func (*Queries) DeleteTransferPermanently

func (q *Queries) DeleteTransferPermanently(ctx context.Context, transferID int32) error

DeleteTransferPermanently: Hard-deletes a transfer Purpose: Permanently remove a transfer record Parameters:

$1: transfer_id - ID of transfer to delete

Business Logic:

  • Physical deletion from database
  • Only works on already trashed transfers
  • Irreversible operation

func (*Queries) DeleteUserPermanently

func (q *Queries) DeleteUserPermanently(ctx context.Context, userID int32) error

DeleteUserPermanently: Permanently delete a trashed user from the system Purpose: Permanently delete a trashed user record. Parameters:

$1: user_id - The ID of the trashed user to delete permanently.

Business Logic:

  • Deletes the user record from the `users` table permanently.
  • Only deletes users who have been trashed (`deleted_at IS NOT NULL`).

func (*Queries) DeleteWithdrawPermanently

func (q *Queries) DeleteWithdrawPermanently(ctx context.Context, withdrawID int32) error

DeleteWithdrawPermanently: Hard-deletes a withdrawal Purpose: Permanently remove a withdrawal from the system Parameters:

$1: withdraw_id - ID of withdrawal to delete

Business Logic:

  • Physical deletion from database
  • Only works on already trashed withdrawals
  • Irreversible operation
  • Used after retention period expires

func (*Queries) FindAllTransactions

func (q *Queries) FindAllTransactions(ctx context.Context, arg FindAllTransactionsParams) ([]*FindAllTransactionsRow, error)

FindAllTransactions: Retrieves a paginated list of active transactions with optional search Purpose: Display transaction list with merchant info, filtered by card number or payment method Parameters:

$1: search_query (TEXT, nullable) - Optional search string to match card_number or payment_method
$2: limit (INTEGER) - Maximum number of records to return (pagination)
$3: offset (INTEGER) - Number of records to skip (pagination)

Returns:

  • transaction_id
  • card_number
  • amount
  • payment_method
  • merchant_id
  • merchant_name (from join with merchants table)
  • transaction_time
  • created_at, updated_at, deleted_at (for audit purposes)
  • total_count: Total number of records matching the filter (useful for pagination metadata)

Business Logic:

  • Joins `transactions` with `merchants` to retrieve merchant name
  • Filters out soft-deleted transactions (where deleted_at IS NOT NULL)
  • Applies case-insensitive partial match on card_number or payment_method if search query is provided
  • Uses `COUNT(*) OVER()` to include total matching count for pagination without a separate query
  • Results are ordered by `transaction_time` descending

func (*Queries) FindAllTransactionsByApikey

func (q *Queries) FindAllTransactionsByApikey(ctx context.Context, arg FindAllTransactionsByApikeyParams) ([]*FindAllTransactionsByApikeyRow, error)

FindAllTransactions: Retrieves a paginated list of active transactions with optional search Purpose: Display transaction list with merchant info, filtered by card number or payment method Parameters:

$1: api-key - The merchant to filter transactions
$2: search_query (TEXT, nullable) - Optional search string to match card_number or payment_method
$3: limit (INTEGER) - Maximum number of records to return (pagination)
$4: offset (INTEGER) - Number of records to skip (pagination)

Returns:

  • transaction_id
  • card_number
  • amount
  • payment_method
  • merchant_id
  • merchant_name (from join with merchants table)
  • transaction_time
  • created_at, updated_at, deleted_at (for audit purposes)
  • total_count: Total number of records matching the filter (useful for pagination metadata)

Business Logic:

  • Joins `transactions` with `merchants` to retrieve merchant name
  • Filters out soft-deleted transactions (where deleted_at IS NOT NULL)
  • Applies case-insensitive partial match on card_number or payment_method if search query is provided
  • Uses `COUNT(*) OVER()` to include total matching count for pagination without a separate query
  • Results are ordered by `transaction_time` descending

func (*Queries) FindAllTransactionsByMerchant

func (q *Queries) FindAllTransactionsByMerchant(ctx context.Context, arg FindAllTransactionsByMerchantParams) ([]*FindAllTransactionsByMerchantRow, error)

FindAllTransactions: Retrieves a paginated list of active transactions with optional search Purpose: Display transaction list with merchant info, filtered by card number or payment method Parameters:

$1: merchant_id - The merchant to filter transactions
$2: search_query (TEXT, nullable) - Optional search string to match card_number or payment_method
$3: limit (INTEGER) - Maximum number of records to return (pagination)
$4: offset (INTEGER) - Number of records to skip (pagination)

Returns:

  • transaction_id
  • card_number
  • amount
  • payment_method
  • merchant_id
  • merchant_name (from join with merchants table)
  • transaction_time
  • created_at, updated_at, deleted_at (for audit purposes)
  • total_count: Total number of records matching the filter (useful for pagination metadata)

Business Logic:

  • Joins `transactions` with `merchants` to retrieve merchant name
  • Filters out soft-deleted transactions (where deleted_at IS NOT NULL)
  • Applies case-insensitive partial match on card_number or payment_method if search query is provided
  • Uses `COUNT(*) OVER()` to include total matching count for pagination without a separate query
  • Results are ordered by `transaction_time` descending

func (*Queries) FindAllTransfersByCardNumberAsReceiver

func (q *Queries) FindAllTransfersByCardNumberAsReceiver(ctx context.Context, transferTo string) ([]*FindAllTransfersByCardNumberAsReceiverRow, error)

FindAllTransfersByCardNumberAsReceiver: Retrieves all transfers where the card was the receiver Purpose: View incoming transfer history for a specific card Parameters:

$1: card_number - The card number that received the transfers

Returns:

All transfer fields for incoming transfers (transfer_to = card_number)

Business Logic:

  • Only includes active transfers (non-deleted)
  • Orders by transfer_time (newest first)
  • Useful for tracking money received by a cardholder

func (*Queries) FindAllTransfersByCardNumberAsSender

func (q *Queries) FindAllTransfersByCardNumberAsSender(ctx context.Context, transferFrom string) ([]*FindAllTransfersByCardNumberAsSenderRow, error)

FindAllTransfersByCardNumberAsSender: Retrieves all transfers where the card was the sender Purpose: View outgoing transfer history for a specific card Parameters:

$1: card_number - The card number that initiated the transfers

Returns:

All transfer fields for outgoing transfers (transfer_from = card_number)

Business Logic:

  • Only includes active transfers (non-deleted)
  • Orders by transfer_time (newest first)
  • Useful for tracking money sent by a cardholder

func (*Queries) FindAllWithdrawsByCardNumber

func (q *Queries) FindAllWithdrawsByCardNumber(ctx context.Context, cardNumber string) ([]*FindAllWithdrawsByCardNumberRow, error)

FindAllWithdrawsByCardNumber: Retrieves all withdrawals for a specific card Purpose: Get complete withdrawal history for a card Parameters:

$1: card_number - The card number to filter withdrawals

Returns:

Selected withdrawal fields for all matching records

Business Logic:

  • Only includes active withdrawals (deleted_at IS NULL)
  • Returns all withdrawals without pagination
  • Orders by withdraw_time (newest first)
  • Useful for complete withdrawal history exports

func (*Queries) FindRefreshTokenByToken

func (q *Queries) FindRefreshTokenByToken(ctx context.Context, token string) (*RefreshToken, error)

FindRefreshTokenByToken: Retrieves active refresh token by token string Purpose: Validate and lookup refresh token Parameters:

$1: token - The refresh token string to find

Returns: The refresh token record if found and active Business Logic:

  • Only returns non-deleted tokens
  • Used during token refresh operations
  • Helps prevent token reuse

func (*Queries) FindRefreshTokenByUserId

func (q *Queries) FindRefreshTokenByUserId(ctx context.Context, userID int32) (*RefreshToken, error)

FindRefreshTokenByUserId: Retrieves latest active refresh token for user Purpose: Get current valid refresh token for a user Parameters:

$1: user_id - ID of the user to find token for

Returns: The most recent refresh token for the user Business Logic:

  • Returns only active (non-deleted) tokens
  • Orders by creation date (newest first)
  • Used for token management and validation
  • Limits to 1 result to get latest token

func (*Queries) GetActiveCardsWithCount

func (q *Queries) GetActiveCardsWithCount(ctx context.Context, arg GetActiveCardsWithCountParams) ([]*GetActiveCardsWithCountRow, error)

GetActiveCardsWithCount: Retrieves paginated list of active cards with search capability Purpose: List all active cards for management UI (alternative to GetCards with same functionality) Parameters:

$1: search_term - Optional text to filter cards by number, type or provider (NULL for no filter)
$2: limit - Maximum number of records to return
$3: offset - Number of records to skip for pagination

Returns:

All card fields plus total_count of matching records

Business Logic:

  • Excludes soft-deleted cards (deleted_at IS NULL)
  • Supports partial text matching on card_number, card_type and card_provider fields (case-insensitive)
  • Returns cards ordered by card_id
  • Provides total_count for pagination calculations

func (*Queries) GetActiveMerchantDocuments

func (q *Queries) GetActiveMerchantDocuments(ctx context.Context, arg GetActiveMerchantDocumentsParams) ([]*GetActiveMerchantDocumentsRow, error)

func (*Queries) GetActiveMerchants

func (q *Queries) GetActiveMerchants(ctx context.Context, arg GetActiveMerchantsParams) ([]*GetActiveMerchantsRow, error)

GetActiveMerchants: Retrieves paginated list of active merchants with search capability Purpose: List currently active merchants (same as GetMerchants) Parameters:

$1: search_term - Optional text to filter by name, api_key, or status (NULL for no filter)
$2: limit - Maximum number of records to return
$3: offset - Number of records to skip for pagination

Returns:

All merchant fields plus total_count of matching records

Business Logic:

  • Excludes soft-deleted merchants (deleted_at IS NULL)
  • Supports case-insensitive partial matching on name, api_key, and status
  • Returns results ordered by merchant_id
  • Provides total_count for pagination calculations

func (*Queries) GetActiveRoles

func (q *Queries) GetActiveRoles(ctx context.Context, arg GetActiveRolesParams) ([]*GetActiveRolesRow, error)

GetActiveRoles: Retrieves only active (non-deleted) roles with optional search and pagination Purpose: Display roles that are currently usable in the system Parameters:

$1: Search query (nullable)
$2: Limit
$3: Offset

Returns:

role_id, role_name, timestamps, and total_count

func (*Queries) GetActiveSaldos

func (q *Queries) GetActiveSaldos(ctx context.Context, arg GetActiveSaldosParams) ([]*GetActiveSaldosRow, error)

GetActiveSaldos: Retrieves active saldos with pagination and optional search Purpose: List all non-deleted saldos with optional filtering for administrative views Parameters:

$1: search_term - Optional filter by card_number (case-insensitive, NULL for no filter)
$2: limit - Number of records to retrieve
$3: offset - Records to skip (pagination)

Returns:

Active saldo records with total_count for pagination

Business Logic:

  • Filters out trashed saldos (deleted_at IS NULL)
  • Supports partial matching on card_number
  • Results ordered by saldo_id

func (*Queries) GetActiveTopups

func (q *Queries) GetActiveTopups(ctx context.Context, arg GetActiveTopupsParams) ([]*GetActiveTopupsRow, error)

GetActiveTopups: Retrieves paginated list of active (non-deleted) topups with search Purpose: Display only active topups for admin or user dashboards Parameters:

$1: search_term - Optional text to filter by card_number, topup_no, or topup_method
$2: limit - Max records to return
$3: offset - Number of rows to skip

Returns:

All active topup fields and total_count

Business Logic:

  • Filters out soft-deleted topups (deleted_at IS NULL)
  • Supports partial, case-insensitive search across multiple fields
  • Results sorted by topup_time (most recent first)
  • total_count is used for frontend pagination

func (*Queries) GetActiveTransactions

func (q *Queries) GetActiveTransactions(ctx context.Context, arg GetActiveTransactionsParams) ([]*GetActiveTransactionsRow, error)

GetActiveTransactions: Retrieves paginated active transactions with search Purpose: List all non-deleted transactions with filtering options Parameters:

$1: search_term - Optional text to filter by card number or payment method
$2: limit - Maximum records to return
$3: offset - Records to skip for pagination

Returns:

All transaction fields plus total_count of matching active records

Business Logic:

  • Only includes active transactions (deleted_at IS NULL)
  • Filters on card_number and payment_method fields
  • Orders by transaction_time (newest first)
  • Provides pagination metadata
  • Used in transaction management interfaces

func (*Queries) GetActiveTransfers

func (q *Queries) GetActiveTransfers(ctx context.Context, arg GetActiveTransfersParams) ([]*GetActiveTransfersRow, error)

GetActiveTransfers: Retrieves paginated active transfers with search Purpose: List all non-deleted transfers with filtering options Parameters:

$1: search_term - Optional text to filter by source or destination account
$2: limit - Maximum records to return per page
$3: offset - Records to skip for pagination

Returns:

All transfer fields plus total_count of matching active records

Business Logic:

  • Only includes active transfers (deleted_at IS NULL)
  • Filters on transfer_from and transfer_to fields
  • Orders by transfer_time (newest first)
  • Provides pagination metadata
  • Used in transfer management interfaces

func (*Queries) GetActiveUsersWithPagination

func (q *Queries) GetActiveUsersWithPagination(ctx context.Context, arg GetActiveUsersWithPaginationParams) ([]*GetActiveUsersWithPaginationRow, error)

GetActiveUsersWithPagination: Get Active Users with Pagination and Total Count Purpose: Retrieve active (non-deleted) users with pagination and total count Parameters:

$1: search_term - A search term to filter active users by firstname, lastname, or email
$2: limit - The maximum number of active users to return per page
$3: offset - The number of active users to skip (for pagination)

Returns:

  • Active user records matching the search term, including firstname, lastname, and email
  • A total count of active users, including all pages (using COUNT(*) OVER())

Business Logic:

  • Filters users where `deleted_at` is NULL (only active users).
  • Allows filtering by search term across firstname, lastname, or email.
  • Returns paginated active users, ordered by `created_at` in descending order.
  • The total count of active users is calculated, including those that are not currently on the current page.

func (*Queries) GetActiveWithdraws

func (q *Queries) GetActiveWithdraws(ctx context.Context, arg GetActiveWithdrawsParams) ([]*GetActiveWithdrawsRow, error)

GetActiveWithdraws: Retrieves paginated active withdrawals with search Purpose: List all non-deleted withdrawals with filtering options Parameters:

$1: search_term - Optional text to filter withdrawals
$2: limit - Maximum records to return per page
$3: offset - Records to skip for pagination

Returns:

All withdrawal fields plus total_count of matching active records

Business Logic:

  • Only includes active withdrawals (deleted_at IS NULL)
  • Same comprehensive filtering as GetWithdraws
  • Orders by withdraw_time (newest first)
  • Provides pagination metadata
  • Used in withdrawal management interfaces

func (*Queries) GetCardByCardNumber

func (q *Queries) GetCardByCardNumber(ctx context.Context, cardNumber string) (*Card, error)

GetCardByCardNumber: Retrieves a single active card by its card number Purpose: Lookup card information using the physical card number Parameters:

$1: card_number - The exact card number to search for

Returns:

All fields for the matching card or NULL if not found or deleted

Business Logic:

  • Only returns active cards (deleted_at IS NULL)
  • Performs exact match on card_number field (case-sensitive)
  • Useful for card verification during transactions

func (*Queries) GetCardByID

func (q *Queries) GetCardByID(ctx context.Context, cardID int32) (*Card, error)

GetCardByID: Retrieves a single card by its ID Purpose: Get detailed information about a specific card Parameters:

$1: card_id - The ID of the card to retrieve

Returns:

All fields for the specified card

Business Logic:

  • Only returns active cards (deleted_at IS NULL)
  • Returns NULL if card is not found or has been soft-deleted

func (*Queries) GetCardByUserID

func (q *Queries) GetCardByUserID(ctx context.Context, userID int32) (*Card, error)

GetCardByUserID: Retrieves a single active card associated with a specific user Purpose: Get the card information for a particular user Parameters:

$1: user_id - The ID of the user whose card should be retrieved

Returns:

All fields for the user's card or NULL if no active card exists

Business Logic:

  • Only returns active cards (deleted_at IS NULL)
  • Returns at most one card (LIMIT 1) even if multiple cards exist for the user
  • Useful for displaying a user's primary/default card

func (*Queries) GetCards

func (q *Queries) GetCards(ctx context.Context, arg GetCardsParams) ([]*GetCardsRow, error)

GetCards: Retrieves paginated list of active cards with search capability Purpose: List all active cards for management UI Parameters:

$1: search_term - Optional text to filter cards by number, type or provider (NULL for no filter)
$2: limit - Maximum number of records to return
$3: offset - Number of records to skip for pagination

Returns:

All card fields plus total_count of matching records

Business Logic:

  • Excludes soft-deleted cards (deleted_at IS NULL)
  • Supports partial text matching on card_number, card_type and card_provider fields (case-insensitive)
  • Returns cards ordered by card_id
  • Provides total_count for pagination calculations

func (*Queries) GetMerchantByApiKey

func (q *Queries) GetMerchantByApiKey(ctx context.Context, apiKey string) (*Merchant, error)

GetMerchantByApiKey: Retrieves a merchant by its API key Purpose: Authenticate or lookup a merchant using its API key Parameters:

$1: api_key - API key of the merchant

Returns:

Complete merchant record

Business Logic:

  • Excludes soft-deleted merchants (deleted_at IS NULL)

func (*Queries) GetMerchantByID

func (q *Queries) GetMerchantByID(ctx context.Context, merchantID int32) (*Merchant, error)

GetMerchantByID: Retrieves a merchant by its unique ID Purpose: Fetch details of a single merchant if not soft-deleted Parameters:

$1: merchant_id - Unique identifier of the merchant

Returns:

Complete merchant record

Business Logic:

  • Excludes soft-deleted merchants (deleted_at IS NULL)

func (*Queries) GetMerchantByName

func (q *Queries) GetMerchantByName(ctx context.Context, name string) (*Merchant, error)

GetMerchantByName: Retrieves a merchant by its name Purpose: Find merchant data based on exact name match Parameters:

$1: name - Exact name of the merchant

Returns:

Complete merchant record

Business Logic:

  • Excludes soft-deleted merchants (deleted_at IS NULL)

func (*Queries) GetMerchantDocument

func (q *Queries) GetMerchantDocument(ctx context.Context, documentID int32) (*MerchantDocument, error)

func (*Queries) GetMerchantDocuments

func (q *Queries) GetMerchantDocuments(ctx context.Context, arg GetMerchantDocumentsParams) ([]*GetMerchantDocumentsRow, error)

func (*Queries) GetMerchants

func (q *Queries) GetMerchants(ctx context.Context, arg GetMerchantsParams) ([]*GetMerchantsRow, error)

GetMerchants: Retrieves paginated list of all non-deleted merchants with search capability Purpose: Display all active (non-trashed) merchants in admin interface Parameters:

$1: search_term - Optional text to filter by name, api_key, or status (NULL for no filter)
$2: limit - Maximum number of records to return
$3: offset - Number of records to skip for pagination

Returns:

All merchant fields plus total_count of matching records

Business Logic:

  • Excludes soft-deleted merchants (deleted_at IS NULL)
  • Supports partial text search on name, api_key, and status (case-insensitive)
  • Returns results ordered by merchant_id
  • Provides total_count for pagination calculations

func (*Queries) GetMerchantsByUserID

func (q *Queries) GetMerchantsByUserID(ctx context.Context, userID int32) ([]*Merchant, error)

GetMerchantsByUserID: Retrieves all merchants associated with a user Purpose: List all merchants that belong to a specific user Parameters:

$1: user_id - ID of the user who owns the merchants

Returns:

List of merchant records

Business Logic:

  • Excludes soft-deleted merchants (deleted_at IS NULL)

func (*Queries) GetMonthTopupStatusFailed

func (q *Queries) GetMonthTopupStatusFailed(ctx context.Context, arg GetMonthTopupStatusFailedParams) ([]*GetMonthTopupStatusFailedRow, error)

GetMonthTopupStatusFailed: Retrieves monthly failed metrics for topups Purpose: Analyze failedful topup trends across comparison periods Parameters:

$1: period1_start - Start date of first comparison period
$2: period1_end - End date of first comparison period
$3: period2_start - Start date of second comparison period
$4: period2_end - End date of second comparison period

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_failed: Count of failedful topups
total_amount: Sum of failedful topup amounts

Business Logic:

  • Only includes failedful topups (status = 'failed')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no activity
  • Formats output for consistent visualization
  • Orders by year and month (newest first)
  • Useful for identifying seasonal topup patterns

func (*Queries) GetMonthTopupStatusFailedCardNumber

GetMonthTopupStatusFailedCardNumber: Retrieves monthly failed metrics for topups Purpose: Analyze failedful topup trends across comparison periods Parameters:

$1: card_number       - Optional filter by card_number (NULL to ignore filter)
$2: period1_start - Start date of first comparison period
$3: period1_end - End date of first comparison period
$4: period2_start - Start date of second comparison period
$5: period2_end - End date of second comparison period

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_failed: Count of failedful topups
total_amount: Sum of failedful topup amounts

Business Logic:

  • Only includes failedful topups (status = 'failed')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no activity
  • Formats output for consistent visualization
  • Orders by year and month (newest first)
  • Useful for identifying seasonal topup patterns

func (*Queries) GetMonthTopupStatusSuccess

func (q *Queries) GetMonthTopupStatusSuccess(ctx context.Context, arg GetMonthTopupStatusSuccessParams) ([]*GetMonthTopupStatusSuccessRow, error)

GetMonthTopupStatusSuccess: Retrieves monthly success metrics for topups Purpose: Analyze successful topup trends across comparison periods Parameters:

$1: period1_start - Start date of first comparison period
$2: period1_end - End date of first comparison period
$3: period2_start - Start date of second comparison period
$4: period2_end - End date of second comparison period

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_success: Count of successful topups
total_amount: Sum of successful topup amounts

Business Logic:

  • Only includes successful topups (status = 'success')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no activity
  • Formats output for consistent visualization
  • Orders by year and month (newest first)
  • Useful for identifying seasonal topup patterns

func (*Queries) GetMonthTopupStatusSuccessCardNumber

GetMonthTopupStatusSuccessCardNumber: Retrieves monthly success metrics for topups Purpose: Analyze successful topup trends across comparison periods Parameters:

$1: card_number       - Optional filter by card_number (NULL to ignore filter)
$2: period1_start - Start date of first comparison period
$3: period1_end - End date of first comparison period
$4: period2_start - Start date of second comparison period
$5: period2_end - End date of second comparison period

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_success: Count of successful topups
total_amount: Sum of successful topup amounts

Business Logic:

  • Only includes successful topups (status = 'success')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no activity
  • Formats output for consistent visualization
  • Orders by year and month (newest first)
  • Useful for identifying seasonal topup patterns

func (*Queries) GetMonthTransactionStatusFailed

func (q *Queries) GetMonthTransactionStatusFailed(ctx context.Context, arg GetMonthTransactionStatusFailedParams) ([]*GetMonthTransactionStatusFailedRow, error)

GetMonthTransactionStatusFailed: Retrieves monthly failed metrics for transactions Purpose: Analyze failedful transaction trends across comparison periods Parameters:

$1: period1_start - Start date of first comparison period
$2: period1_end - End date of first comparison period
$3: period2_start - Start date of second comparison period
$4: period2_end - End date of second comparison period

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_failed: Count of failedful transactions
total_amount: Sum of failedful transaction amounts

Business Logic:

  • Only includes failedful transactions (status = 'failed')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal transaction patterns and revenue trends

func (*Queries) GetMonthTransactionStatusFailedCardNumber

GetMonthTransactionStatusFailed: Retrieves monthly failed metrics for transactions Purpose: Analyze failedful transaction trends across comparison periods Parameters:

$1: card_number  - filter by card_number
$2: period1_start - Start date of first comparison period
$3: period1_end - End date of first comparison period
$4: period2_start - Start date of second comparison period
$5: period2_end - End date of second comparison period

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_failed: Count of failedful transactions
total_amount: Sum of failedful transaction amounts

Business Logic:

  • Only includes failedful transactions (status = 'failed')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal transaction patterns and revenue trends

func (*Queries) GetMonthTransactionStatusSuccess

func (q *Queries) GetMonthTransactionStatusSuccess(ctx context.Context, arg GetMonthTransactionStatusSuccessParams) ([]*GetMonthTransactionStatusSuccessRow, error)

GetMonthTransactionStatusSuccess: Retrieves monthly success metrics for transactions Purpose: Analyze successful transaction trends across comparison periods Parameters:

$1: period1_start - Start date of first comparison period
$2: period1_end - End date of first comparison period
$3: period2_start - Start date of second comparison period
$4: period2_end - End date of second comparison period

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_success: Count of successful transactions
total_amount: Sum of successful transaction amounts

Business Logic:

  • Only includes successful transactions (status = 'success')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal transaction patterns and revenue trends

func (*Queries) GetMonthTransactionStatusSuccessCardNumber

GetMonthTransactionStatusSuccessCardNumber: Retrieves monthly success metrics for transactions Purpose: Analyze successful transaction trends across comparison periods Parameters:

$1: card_number  - filter by card_number
$2: period1_start - Start date of first comparison period
$3: period1_end - End date of first comparison period
$4: period2_start - Start date of second comparison period
$5: period2_end - End date of second comparison period

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_success: Count of successful transactions
total_amount: Sum of successful transaction amounts

Business Logic:

  • Only includes successful transactions (status = 'success')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal transaction patterns and revenue trends

func (*Queries) GetMonthTransferStatusFailed

func (q *Queries) GetMonthTransferStatusFailed(ctx context.Context, arg GetMonthTransferStatusFailedParams) ([]*GetMonthTransferStatusFailedRow, error)

GetMonthTransferStatusFailed: Retrieves monthly failed metrics for fund transfers Purpose: Analyze failedful transfer trends across comparison periods Parameters:

$1: period1_start - Start date of first comparison period (timestamp)
$2: period1_end - End date of first comparison period (timestamp)
$3: period2_start - Start date of second comparison period (timestamp)
$4: period2_end - End date of second comparison period (timestamp)

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_failed: Count of failedful transfers
total_amount: Sum of failedful transfer amounts

Business Logic:

  • Only includes failedful transfers (status = 'failed')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no transfer activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal transfer patterns and cash flow analysis

func (*Queries) GetMonthTransferStatusFailedCardNumber

GetMonthTransferStatusFailedCardNumber: Retrieves monthly failed metrics for fund transfers Purpose: Analyze failedful transfer trends across comparison periods Parameters:

$1: card_number  - filter by card_number
$2: period1_start - Start date of first comparison period (timestamp)
$3: period1_end - End date of first comparison period (timestamp)
$4: period2_start - Start date of second comparison period (timestamp)
$5: period2_end - End date of second comparison period (timestamp)

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_failed: Count of failedful transfers
total_amount: Sum of failedful transfer amounts

Business Logic:

  • Only includes failedful transfers (status = 'failed')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no transfer activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal transfer patterns and cash flow analysis

func (*Queries) GetMonthTransferStatusSuccess

func (q *Queries) GetMonthTransferStatusSuccess(ctx context.Context, arg GetMonthTransferStatusSuccessParams) ([]*GetMonthTransferStatusSuccessRow, error)

GetMonthTransferStatusSuccess: Retrieves monthly success metrics for fund transfers Purpose: Analyze successful transfer trends across comparison periods Parameters:

$1: period1_start - Start date of first comparison period (timestamp)
$2: period1_end - End date of first comparison period (timestamp)
$3: period2_start - Start date of second comparison period (timestamp)
$4: period2_end - End date of second comparison period (timestamp)

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_success: Count of successful transfers
total_amount: Sum of successful transfer amounts

Business Logic:

  • Only includes successful transfers (status = 'success')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no transfer activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal transfer patterns and cash flow analysis

func (*Queries) GetMonthTransferStatusSuccessCardNumber

GetMonthTransferStatusSuccessCardNumber: Retrieves monthly success metrics for fund transfers Purpose: Analyze successful transfer trends across comparison periods Parameters:

$1: card_number  - filter by card_number
$2: period1_start - Start date of first comparison period (timestamp)
$3: period1_end - End date of first comparison period (timestamp)
$4: period2_start - Start date of second comparison period (timestamp)
$5: period2_end - End date of second comparison period (timestamp)

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_success: Count of successful transfers
total_amount: Sum of successful transfer amounts

Business Logic:

  • Only includes successful transfers (status = 'success')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no transfer activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal transfer patterns and cash flow analysis

func (*Queries) GetMonthWithdrawStatusFailed

func (q *Queries) GetMonthWithdrawStatusFailed(ctx context.Context, arg GetMonthWithdrawStatusFailedParams) ([]*GetMonthWithdrawStatusFailedRow, error)

GetMonthWithdrawStatusFailed: Retrieves monthly failed metrics for withdrawals Purpose: Analyze failed withdrawal trends across comparison periods Parameters:

$1: period1_start - Start date of first comparison period (timestamp)
$2: period1_end - End date of first comparison period (timestamp)
$3: period2_start - Start date of second comparison period (timestamp)
$4: period2_end - End date of second comparison period (timestamp)

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_failed: Count of failed withdrawals
total_amount: Sum of failed withdrawal amounts

Business Logic:

  • Only includes failed withdrawals (status = 'failed')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no withdrawal activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal cash withdrawal patterns

func (*Queries) GetMonthWithdrawStatusFailedCardNumber

GetMonthWithdrawStatusFailedCardNumber: Retrieves monthly failed metrics for withdrawals Purpose: Analyze failed withdrawal trends across comparison periods Parameters:

$1: card_number  - filter by card_number
$2: period1_start - Start date of first comparison period (timestamp)
$3: period1_end - End date of first comparison period (timestamp)
$4: period2_start - Start date of second comparison period (timestamp)
$5: period2_end - End date of second comparison period (timestamp)

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_failed: Count of failed withdrawals
total_amount: Sum of failed withdrawal amounts

Business Logic:

  • Only includes failed withdrawals (status = 'failed')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no withdrawal activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal cash withdrawal patterns

func (*Queries) GetMonthWithdrawStatusSuccess

func (q *Queries) GetMonthWithdrawStatusSuccess(ctx context.Context, arg GetMonthWithdrawStatusSuccessParams) ([]*GetMonthWithdrawStatusSuccessRow, error)

GetMonthWithdrawStatusSuccess: Retrieves monthly success metrics for withdrawals Purpose: Analyze successful withdrawal trends across comparison periods Parameters:

$1: period1_start - Start date of first comparison period (timestamp)
$2: period1_end - End date of first comparison period (timestamp)
$3: period2_start - Start date of second comparison period (timestamp)
$4: period2_end - End date of second comparison period (timestamp)

Returns:

year: Year as text (e.g., '2023')
month: 3-letter month abbreviation (e.g., 'Jan')
total_success: Count of successful withdrawals
total_amount: Sum of successful withdrawal amounts

Business Logic:

  • Only includes successful withdrawals (status = 'success')
  • Covers two customizable time periods for comparison
  • Zero-fills months with no withdrawal activity
  • Formats output for consistent visualization (year as text, month as 'Mon')
  • Orders by year and month (newest first)
  • Useful for identifying seasonal cash withdrawal patterns

func (*Queries) GetMonthlyAmountByApikey

func (q *Queries) GetMonthlyAmountByApikey(ctx context.Context, arg GetMonthlyAmountByApikeyParams) ([]*GetMonthlyAmountByApikeyRow, error)

GetMonthlyAmountByApikey: Retrieves total transaction amount per month for a specific merchant and year Purpose: Generate monthly income report for a specific merchant regardless of payment method Parameters:

$1: reference_date - Any date within the target year
$2: api-key - The merchant to filter transactions

Returns:

  • Month name (e.g., Jan, Feb)
  • Total transaction amount (0 if no activity)

Business Logic:

  • Generates complete 12-month series for the given year
  • Filters only active (non-deleted) transactions and merchants
  • Filters by specific merchant_id
  • Uses LEFT JOIN to ensure each month is represented
  • Uses COALESCE to return 0 if a month has no transaction data
  • Results are ordered chronologically by month

func (*Queries) GetMonthlyAmountByMerchants

func (q *Queries) GetMonthlyAmountByMerchants(ctx context.Context, arg GetMonthlyAmountByMerchantsParams) ([]*GetMonthlyAmountByMerchantsRow, error)

GetMonthlyAmountByMerchants: Retrieves total transaction amount per month for a specific merchant and year Purpose: Generate monthly income report for a specific merchant regardless of payment method Parameters:

$1: reference_date - Any date within the target year
$2: merchant_id - The merchant to filter transactions

Returns:

  • Month name (e.g., Jan, Feb)
  • Total transaction amount (0 if no activity)

Business Logic:

  • Generates complete 12-month series for the given year
  • Filters only active (non-deleted) transactions and merchants
  • Filters by specific merchant_id
  • Uses LEFT JOIN to ensure each month is represented
  • Uses COALESCE to return 0 if a month has no transaction data
  • Results are ordered chronologically by month

func (*Queries) GetMonthlyAmountMerchant

func (q *Queries) GetMonthlyAmountMerchant(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyAmountMerchantRow, error)

GetMonthlyAmountMerchant: Retrieves total transaction amount per month for a given year Purpose: Generate monthly income report regardless of payment method Parameters:

$1: reference_date - Any date within the target year

Returns:

  • Month name (e.g., Jan, Feb)
  • Total transaction amount (0 if no activity)

Business Logic:

  • Generates complete 12-month series
  • Includes only active (non-deleted) transactions and merchants
  • Uses LEFT JOIN to ensure each month is represented
  • Uses COALESCE to return 0 if a month has no data
  • Ordered chronologically by month

func (*Queries) GetMonthlyAmounts

func (q *Queries) GetMonthlyAmounts(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyAmountsRow, error)

GetMonthlyAmounts: Retrieves total transaction amount per month for a specific year Purpose:

Visualize monthly trends in transaction volume for charting/dashboards

Parameters:

$1: reference_date - Any date within the target year

Returns:

  • month: 3-letter month abbreviation
  • total_amount: Sum of transaction amounts in each month

Business Logic:

  • Uses LEFT JOIN to ensure all months are included, even with 0 transactions
  • Filters out soft-deleted data (deleted_at IS NULL)

func (*Queries) GetMonthlyAmountsByCardNumber

func (q *Queries) GetMonthlyAmountsByCardNumber(ctx context.Context, arg GetMonthlyAmountsByCardNumberParams) ([]*GetMonthlyAmountsByCardNumberRow, error)

GetMonthlyAmountsByCardNumber: Retrieves total transaction amount per month for a specific year Purpose:

Visualize monthly trends in transaction volume for charting/dashboards

Parameters:

$1: card_number  - filter by card_number
$2: reference_date - Any date within the target year

Returns:

  • month: 3-letter month abbreviation
  • total_amount: Sum of transaction amounts in each month

Business Logic:

  • Uses LEFT JOIN to ensure all months are included, even with 0 transactions
  • Filters out soft-deleted data (deleted_at IS NULL)

func (*Queries) GetMonthlyBalances

func (q *Queries) GetMonthlyBalances(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyBalancesRow, error)

GetMonthlyBalances: Retrieves monthly balance totals for a given year Purpose: Provide monthly balance trends for dashboard visualizations Parameters:

$1: reference_date - A date used to determine the year to analyze

Returns:

month: 3-letter month abbreviation (e.g., 'Jan')
total_balance: Sum of balances for that month (zero if no data)

Business Logic:

  • Generates a complete 12-month series for the year
  • Includes only active saldos and cards (deleted_at IS NULL)
  • Uses LEFT JOIN to ensure all months appear in results
  • COALESCE returns 0 for months with no data
  • Results ordered chronologically

func (*Queries) GetMonthlyBalancesByCardNumber

func (q *Queries) GetMonthlyBalancesByCardNumber(ctx context.Context, arg GetMonthlyBalancesByCardNumberParams) ([]*GetMonthlyBalancesByCardNumberRow, error)

GetMonthlyBalancesByCardNumber: Retrieves monthly balance history for a specific card Purpose: Track monthly balance trends for individual card statements Parameters:

$1: reference_date - Date to determine the analysis year
$2: card_number - Specific card to analyze

Returns:

month: 3-letter month abbreviation (e.g., 'Jan')
total_balance: Monthly balance total (0 if no data)

Business Logic:

  • Generates complete 12-month series for the year
  • Filters for specific card number
  • Only includes active saldos and cards
  • Ensures all months appear with COALESCE default
  • Useful for cardholder spending pattern analysis

func (*Queries) GetMonthlyPaymentMethodByApikey

func (q *Queries) GetMonthlyPaymentMethodByApikey(ctx context.Context, arg GetMonthlyPaymentMethodByApikeyParams) ([]*GetMonthlyPaymentMethodByApikeyRow, error)

GetMonthlyPaymentMethodByApikey: Retrieves total transaction amount per payment method per month for a specific merchant Purpose: Analyze monthly transaction totals by payment method for a specific merchant and year Parameters:

$1: reference_date - Any date within the target year
$2: api-key - The merchant to filter transactions

Returns:

  • Month name (e.g., Jan, Feb)
  • Payment method
  • Total transaction amount for each combination

Business Logic:

  • Generates a complete 12-month series for the given year
  • Filters only active (non-deleted) transactions and merchants
  • Filters by specific merchant_id
  • Uses LEFT JOIN and CROSS JOIN to ensure all months and payment methods are included
  • Uses COALESCE to return 0 for combinations with no data
  • Results are ordered chronologically by month

func (*Queries) GetMonthlyPaymentMethodByMerchants

GetMonthlyPaymentMethodByMerchants: Retrieves total transaction amount per payment method per month for a specific merchant Purpose: Analyze monthly transaction totals by payment method for a specific merchant and year Parameters:

$1: reference_date - Any date within the target year
$2: merchant_id - The merchant to filter transactions

Returns:

  • Month name (e.g., Jan, Feb)
  • Payment method
  • Total transaction amount for each combination

Business Logic:

  • Generates a complete 12-month series for the given year
  • Filters only active (non-deleted) transactions and merchants
  • Filters by specific merchant_id
  • Uses LEFT JOIN and CROSS JOIN to ensure all months and payment methods are included
  • Uses COALESCE to return 0 for combinations with no data
  • Results are ordered chronologically by month

func (*Queries) GetMonthlyPaymentMethods

func (q *Queries) GetMonthlyPaymentMethods(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyPaymentMethodsRow, error)

GetMonthlyPaymentMethods: Retrieves a monthly summary of transaction transactions categorized by payment method Purpose:

Useful for visualizing how each payment method is used over time within a given year

Parameters:

$1: reference_date - Any date within the target year (used to generate monthly range)

Returns:

  • month (e.g., 'Jan', 'Feb')
  • payment_method (e.g., 'e-wallet', 'bank_transfer')
  • total_transactions: Number of transactions for the method that month
  • total_amount: Total amount of transactions for the method that month

Business Logic:

  • Includes all combinations of months and available payment methods (even if 0 data)
  • Excludes soft-deleted transactions (deleted_at IS NULL)
  • Uses CROSS JOIN to ensure all months and methods are represented

func (*Queries) GetMonthlyPaymentMethodsByCardNumber

GetMonthlyPaymentMethodsByCardNumber: Retrieves a monthly summary of transaction transactions categorized by payment method Purpose:

Useful for visualizing how each payment method is used over time within a given year

Parameters:

$1: card_number  - filter by card_number
$2: reference_date - Any date within the target year (used to generate monthly range)

Returns:

  • month (e.g., 'Jan', 'Feb')
  • payment_method (e.g., 'e-wallet', 'bank_transfer')
  • total_transactions: Number of transactions for the method that month
  • total_amount: Total amount of transactions for the method that month

Business Logic:

  • Includes all combinations of months and available payment methods (even if 0 data)
  • Excludes soft-deleted transactions (deleted_at IS NULL)
  • Uses CROSS JOIN to ensure all months and methods are represent

func (*Queries) GetMonthlyPaymentMethodsMerchant

func (q *Queries) GetMonthlyPaymentMethodsMerchant(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyPaymentMethodsMerchantRow, error)

GetMonthlyPaymentMethodsMerchant: Retrieves monthly transaction totals per payment method Purpose: Analyze monthly transaction distribution across payment methods for a given year Parameters:

$1: reference_date - Any date within the target year

Returns:

  • Month name (e.g., Jan, Feb)
  • Payment method
  • Total transaction amount (0 if no activity)

Business Logic:

  • Generates complete 12-month series from the reference year
  • Cross joins with distinct active payment methods
  • Filters only active (non-deleted) transactions and merchants
  • Uses LEFT JOIN to ensure all month-method combinations are included
  • Uses COALESCE to display 0 for months with no transactions
  • Ordered by month and payment method

func (*Queries) GetMonthlySaldoBalances

func (q *Queries) GetMonthlySaldoBalances(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlySaldoBalancesRow, error)

GetMonthlySaldoBalances: Retrieves monthly balance totals for a given year Purpose: Provide monthly balance trends for financial reporting and dashboards Parameters:

$1: reference_date - A date used to determine the year to analyze

Returns:

month: 3-letter month abbreviation (e.g., 'Jan', 'Feb')
total_balance: Sum of balances for that month (0 if no data exists)

Business Logic:

  • Generates a complete 12-month series for the specified year
  • Uses LEFT JOIN to ensure all months appear in results
  • COALESCE returns 0 for months with no balance data
  • Only includes active saldo records (deleted_at IS NULL)
  • Groups by month and orders chronologically
  • Useful for cash flow analysis and financial planning

func (*Queries) GetMonthlyTopupAmount

func (q *Queries) GetMonthlyTopupAmount(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTopupAmountRow, error)

GetMonthlyTopupAmount: Retrieves monthly top-up totals for a given year Purpose: Analyze monthly top-up patterns and trends Parameters:

$1: reference_date - A date used to determine the year to analyze

Returns:

month: 3-letter month abbreviation
total_topup_amount: Sum of top-ups for that month (zero if no data)

Business Logic:

  • Generates complete 12-month series
  • Only includes active topups and cards
  • Uses LEFT JOIN to ensure all months appear
  • COALESCE returns 0 for months with no activity
  • Results ordered chronologically

func (*Queries) GetMonthlyTopupAmountByCardNumber

GetMonthlyTopupAmountByCardNumber: Retrieves monthly top-up history for a card Purpose: Analyze monthly top-up patterns for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_date - Date to determine analysis year

Returns:

month: 3-letter month abbreviation
total_topup_amount: Monthly top-up total (0 if none)

Business Logic:

  • Complete 12-month coverage
  • Card-specific filtering
  • Active records only
  • Zero-filled for missing months
  • Helps identify top-up habit seasonality

func (*Queries) GetMonthlyTopupAmounts

func (q *Queries) GetMonthlyTopupAmounts(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTopupAmountsRow, error)

GetMonthlyTopupAmounts: Retrieves total topup amounts per month for the selected year Purpose: Visualize total topup volume across months in a given year Parameters:

$1: reference_date - Any date within the target year

Returns:

month: 3-letter month abbreviation
total_amount: Sum of all topup amounts per month

Business Logic:

  • Filters soft-deleted entries (deleted_at IS NULL)
  • Uses LEFT JOIN to ensure months with no topups are still included with amount = 0
  • Useful for monthly topup charts or dashboards

func (*Queries) GetMonthlyTopupAmountsByCardNumber

GetMonthlyTopupAmountsByCardNumber: Retrieves total topup amounts per month for the selected year Purpose: Visualize total topup volume across months in a given year Parameters:

$1: card_number  - filter by card_number
$2: reference_date - Any date within the target year

Returns:

month: 3-letter month abbreviation
total_amount: Sum of all topup amounts per month

Business Logic:

  • Filters soft-deleted entries (deleted_at IS NULL)
  • Uses LEFT JOIN to ensure months with no topups are still included with amount = 0
  • Useful for monthly topup charts or dashboards

func (*Queries) GetMonthlyTopupMethods

func (q *Queries) GetMonthlyTopupMethods(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTopupMethodsRow, error)

GetMonthlyTopupMethods: Retrieves monthly breakdown of topup usage by method Purpose: Track topup method distribution and amounts over each month of the selected year Parameters:

$1: reference_date - Any date within the target year (used to define monthly range)

Returns:

month: 3-letter month abbreviation (e.g., 'Jan')
topup_method: Method used for topup (e.g., 'bank_transfer', 'e-wallet')
total_topups: Count of topups using the method in that month
total_amount: Sum of topup amounts using the method in that month

Business Logic:

  • Ensures every topup method is shown for every month (even with 0 data)
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Uses CROSS JOIN to combine months with all available methods
  • Useful for visualizing adoption trends of each topup method monthly

func (*Queries) GetMonthlyTopupMethodsByCardNumber

GetMonthlyTopupMethodsByCardNumber: Retrieves monthly breakdown of topup usage by method Purpose: Track topup method distribution and amounts over each month of the selected year Parameters:

$1: card_number  - filter by card_number
$2: reference_date - Any date within the target year (used to define monthly range)

Returns:

month: 3-letter month abbreviation (e.g., 'Jan')
topup_method: Method used for topup (e.g., 'bank_transfer', 'e-wallet')
total_topups: Count of topups using the method in that month
total_amount: Sum of topup amounts using the method in that month

Business Logic:

  • Ensures every topup method is shown for every month (even with 0 data)
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Uses CROSS JOIN to combine months with all available methods
  • Useful for visualizing adoption trends of each topup method monthly

func (*Queries) GetMonthlyTotalAmountByApikey

func (q *Queries) GetMonthlyTotalAmountByApikey(ctx context.Context, arg GetMonthlyTotalAmountByApikeyParams) ([]*GetMonthlyTotalAmountByApikeyRow, error)

GetMonthlyTotalAmountByApikey: Retrieves total transaction amounts for the current and previous month Purpose: Provide monthly transaction summary including zero values if no transactions exist Parameters:

$1: reference_date - Any date within the target (current) month
$2: api-key - The merchant to filter transactions

Returns:

  • Year (as text)
  • Month (abbreviated name, e.g., Jan, Feb)
  • Total transaction amount for each month

Business Logic:

  • Aggregates total transaction amounts for the target month and the month before
  • Filters only active (non-deleted) transactions and merchants
  • Includes 0 as total_amount if there's no transaction data for either month
  • Uses UNION ALL to combine real data with "missing month" placeholders
  • Results are sorted by year and month (most recent first)

func (*Queries) GetMonthlyTotalAmountByMerchant

func (q *Queries) GetMonthlyTotalAmountByMerchant(ctx context.Context, arg GetMonthlyTotalAmountByMerchantParams) ([]*GetMonthlyTotalAmountByMerchantRow, error)

GetMonthlyTotalAmountByMerchant: Retrieves total transaction amounts for the current and previous month Purpose: Provide monthly transaction summary including zero values if no transactions exist Parameters:

$1: reference_date - Any date within the target (current) month
$2: merchant_id - The merchant to filter transactions

Returns:

  • Year (as text)
  • Month (abbreviated name, e.g., Jan, Feb)
  • Total transaction amount for each month

Business Logic:

  • Aggregates total transaction amounts for the target month and the month before
  • Filters only active (non-deleted) transactions and merchants
  • Includes 0 as total_amount if there's no transaction data for either month
  • Uses UNION ALL to combine real data with "missing month" placeholders
  • Results are sorted by year and month (most recent first)

func (*Queries) GetMonthlyTotalAmountMerchant

func (q *Queries) GetMonthlyTotalAmountMerchant(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTotalAmountMerchantRow, error)

GetMonthlyTotalAmountMerchant: Retrieves total transaction amounts for the current and previous month Purpose: Provide monthly transaction summary including zero values if no transactions exist Parameters:

$1: reference_date - Any date within the target (current) month

Returns:

  • Year (as text)
  • Month (abbreviated name, e.g., Jan, Feb)
  • Total transaction amount for each month

Business Logic:

  • Aggregates total transaction amounts for the target month and the month before
  • Filters only active (non-deleted) transactions and merchants
  • Includes 0 as total_amount if there's no transaction data for either month
  • Uses UNION ALL to combine real data with "missing month" placeholders
  • Results are sorted by year and month (most recent first)

func (*Queries) GetMonthlyTotalSaldoBalance

func (q *Queries) GetMonthlyTotalSaldoBalance(ctx context.Context, arg GetMonthlyTotalSaldoBalanceParams) ([]*GetMonthlyTotalSaldoBalanceRow, error)

GetMonthlyTotalSaldoBalance: Retrieves monthly balance totals for comparison periods Purpose: Compare monthly balance trends between two time periods Parameters:

$1: period1_start - Start date of first comparison period
$2: period1_end - End date of first comparison period
$3: period2_start - Start date of second comparison period
$4: period2_end - End date of second comparison period

Returns:

year: The year as text
month: 3-letter month abbreviation
total_balance: Monthly balance total (0 if no data)

Business Logic:

  • Aggregates balances for two customizable time periods
  • Only includes active saldos (deleted_at IS NULL)
  • Ensures both periods' months appear with zero-filling
  • Formats output for consistent visualization
  • Results ordered by year and month (newest first)

func (*Queries) GetMonthlyTransactionAmount

func (q *Queries) GetMonthlyTransactionAmount(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTransactionAmountRow, error)

GetMonthlyTransactionAmount: Retrieves monthly transaction totals for a given year Purpose: Analyze monthly transaction patterns and trends Parameters:

$1: reference_date - A date used to determine the year to analyze

Returns:

month: 3-letter month abbreviation
total_transaction_amount: Sum of transactions for that month (zero if no data)

Business Logic:

  • Generates complete 12-month series
  • Only includes active transactions and cards
  • Uses LEFT JOIN to ensure all months appear
  • COALESCE returns 0 for months with no activity
  • Results ordered chronologically

func (*Queries) GetMonthlyTransactionAmountByCardNumber

GetMonthlyTransactionAmountByCardNumber: Retrieves monthly transaction history for a card Purpose: Analyze monthly transaction patterns for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_date - Date to determine analysis year

Returns:

month: 3-letter month abbreviation
total_transaction_amount: Monthly transaction total (0 if none)

Business Logic:

  • Complete 12-month coverage
  • Card-specific filtering
  • Active records only
  • Zero-filled for missing months
  • Helps identify transaction habit seasonality

func (*Queries) GetMonthlyTransferAmountByReceiver

GetMonthlyTransferAmountByReceiver: Retrieves monthly transfer history for a card Purpose: Analyze monthly transfer patterns for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_date - Date to determine analysis year

Returns:

month: 3-letter month abbreviation
total_sent_amount: Monthly transfer total (0 if none)

Business Logic:

  • Complete 12-month coverage
  • Card-specific filtering
  • Active records only
  • Zero-filled for missing months
  • Helps identify transfer habit seasonality

func (*Queries) GetMonthlyTransferAmountBySender

func (q *Queries) GetMonthlyTransferAmountBySender(ctx context.Context, arg GetMonthlyTransferAmountBySenderParams) ([]*GetMonthlyTransferAmountBySenderRow, error)

GetMonthlyTransferAmountBySender: Retrieves monthly transfer history for a card Purpose: Analyze monthly transfer patterns for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_date - Date to determine analysis year

Returns:

month: 3-letter month abbreviation
total_sent_amount: Monthly transfer total (0 if none)

Business Logic:

  • Complete 12-month coverage
  • Card-specific filtering
  • Active records only
  • Zero-filled for missing months
  • Helps identify transfer habit seasonality

func (*Queries) GetMonthlyTransferAmountReceiver

func (q *Queries) GetMonthlyTransferAmountReceiver(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTransferAmountReceiverRow, error)

GetMonthlyTransferAmountReceiver: Retrieves monthly transfer totals for a given year Purpose: Analyze monthly transfer patterns and trends Parameters:

$1: reference_date - A date used to determine the year to analyze

Returns:

month: 3-letter month abbreviation
total_received_amount: Sum of transfers for that month (zero if no data)

Business Logic:

  • Generates complete 12-month series
  • Only includes active transfers and cards
  • Uses LEFT JOIN to ensure all months appear
  • COALESCE returns 0 for months with no activity
  • Results ordered chronologically

func (*Queries) GetMonthlyTransferAmountSender

func (q *Queries) GetMonthlyTransferAmountSender(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTransferAmountSenderRow, error)

GetMonthlyTransferAmountSender: Retrieves monthly transfer totals for a given year Purpose: Analyze monthly transfer patterns and trends Parameters:

$1: reference_date - A date used to determine the year to analyze

Returns:

month: 3-letter month abbreviation
total_sent_amount: Sum of transfers for that month (zero if no data)

Business Logic:

  • Generates complete 12-month series
  • Only includes active transfers and cards
  • Uses LEFT JOIN to ensure all months appear
  • COALESCE returns 0 for months with no activity
  • Results ordered chronologically

func (*Queries) GetMonthlyTransferAmounts

func (q *Queries) GetMonthlyTransferAmounts(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyTransferAmountsRow, error)

GetMonthlyTransferAmounts: Retrieves monthly transfer amounts Purpose: Track total transfer amounts over each month of the selected year Parameters:

$1: reference_date - Any date within the target year (used to define monthly range)

Returns:

month: 3-letter month abbreviation (e.g., 'Jan')
total_transfer_amount: Sum of transfer amounts in that month

Business Logic:

  • Generates complete monthly series for the target year
  • Includes all transfers regardless of method
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Zero-fills months with no transfer activity
  • Useful for visualizing monthly cash flow patterns

func (*Queries) GetMonthlyTransferAmountsByReceiverCardNumber

GetMonthlyTransferAmountsByReceiverCardNumber: Retrieves monthly transfer amounts Purpose: Track total transfer amounts over each month of the selected year Parameters:

$1: card_number  - filter by card_number
$2: reference_date - Any date within the target year (used to define monthly range)

Returns:

month: 3-letter month abbreviation (e.g., 'Jan')
total_transfer_amount: Sum of transfer amounts in that month

Business Logic:

  • Generates complete monthly series for the target year
  • Includes all transfers regardless of method
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Zero-fills months with no transfer activity
  • Useful for visualizing monthly cash flow patterns

func (*Queries) GetMonthlyTransferAmountsBySenderCardNumber

GetMonthlyTransferAmountsBySenderCardNumber: Retrieves monthly transfer amounts Purpose: Track total transfer amounts over each month of the selected year Parameters:

$1: card_number  - filter by card_number
$2: reference_date - Any date within the target year (used to define monthly range)

Returns:

month: 3-letter month abbreviation (e.g., 'Jan')
total_transfer_amount: Sum of transfer amounts in that month

Business Logic:

  • Generates complete monthly series for the target year
  • Includes all transfers regardless of method
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Zero-fills months with no transfer activity
  • Useful for visualizing monthly cash flow patterns

func (*Queries) GetMonthlyWithdrawAmount

func (q *Queries) GetMonthlyWithdrawAmount(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyWithdrawAmountRow, error)

GetMonthlyWithdrawAmount: Retrieves monthly withdraw totals for a given year Purpose: Analyze monthly withdraw patterns and trends Parameters:

$1: reference_date - A date used to determine the year to analyze

Returns:

month: 3-letter month abbreviation
total_withdraw_amount: Sum of withdraws for that month (zero if no data)

Business Logic:

  • Generates complete 12-month series
  • Only includes active withdraws and cards
  • Uses LEFT JOIN to ensure all months appear
  • COALESCE returns 0 for months with no activity
  • Results ordered chronologically

func (*Queries) GetMonthlyWithdrawAmountByCardNumber

GetMonthlyWithdrawAmountByCardNumber: Retrieves monthly withdraw history for a card Purpose: Analyze monthly withdraw patterns for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_date - Date to determine analysis year

Returns:

month: 3-letter month abbreviation
total_withdraw_amount: Monthly withdraw total (0 if none)

Business Logic:

  • Complete 12-month coverage
  • Card-specific filtering
  • Active records only
  • Zero-filled for missing months
  • Helps identify withdraw habit seasonality

func (*Queries) GetMonthlyWithdraws

func (q *Queries) GetMonthlyWithdraws(ctx context.Context, dollar_1 time.Time) ([]*GetMonthlyWithdrawsRow, error)

GetMonthlyWithdraws: Retrieves monthly withdrawal totals for a given year Purpose: Analyze monthly cash withdrawal patterns and trends Parameters:

$1: reference_date - Any date within the target year (used to define the year range)

Returns:

month: 3-letter month abbreviation (e.g., 'Jan')
total_withdraw_amount: Sum of withdrawal amounts for that month (0 if no withdrawals)

Business Logic:

  • Generates complete monthly series for the specified year
  • Includes all withdrawals regardless of card or status
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Zero-fills months with no withdrawal activity
  • Orders results chronologically by month
  • Useful for cash flow analysis and ATM/branch planning

func (*Queries) GetMonthlyWithdrawsByCardNumber

func (q *Queries) GetMonthlyWithdrawsByCardNumber(ctx context.Context, arg GetMonthlyWithdrawsByCardNumberParams) ([]*GetMonthlyWithdrawsByCardNumberRow, error)

GetMonthlyWithdrawsByCardNumber: Retrieves monthly withdrawals for a specific card Purpose: Track monthly cash usage patterns for individual cardholders Parameters:

$1: card_number - The card number to filter withdrawals
$2: reference_date - Any date within the target year

Returns:

month: 3-letter month abbreviation
total_withdraw_amount: Sum of withdrawals for that card by month

Business Logic:

  • Generates complete monthly series for the year
  • Filters withdrawals by specific card number
  • Zero-fills months with no activity for that card
  • Orders chronologically
  • Useful for individual spending pattern analysis

func (*Queries) GetResetToken

func (q *Queries) GetResetToken(ctx context.Context, token string) (*ResetToken, error)

func (*Queries) GetRole

func (q *Queries) GetRole(ctx context.Context, roleID int32) (*Role, error)

GetRole: Retrieves role details by role_id Purpose: Fetch a single role record (regardless of deleted status) Parameters:

$1: Role ID

Returns:

role_id, role_name, and timestamps

func (*Queries) GetRoleByName

func (q *Queries) GetRoleByName(ctx context.Context, roleName string) (*Role, error)

GetRoleByName: Retrieves role by exact role name Purpose: Check role existence or fetch role info based on name Parameters:

$1: Role name (exact match)

Returns:

role_id, role_name, and timestamps

func (*Queries) GetRoles

func (q *Queries) GetRoles(ctx context.Context, arg GetRolesParams) ([]*GetRolesRow, error)

GetRoles: Retrieves all roles (active & trashed) with optional name search and pagination Purpose: General listing of roles regardless of status Parameters:

$1: Search query (role name, nullable)
$2: Limit (number of records per page)
$3: Offset (starting index for pagination)

Returns:

role_id, role_name, timestamps, and total_count (for pagination support)

Business Logic:

  • Supports fuzzy search on role_name
  • Includes both active and trashed roles
  • Useful for admin panels with filters and pagination

func (*Queries) GetSaldoByCardNumber

func (q *Queries) GetSaldoByCardNumber(ctx context.Context, cardNumber string) (*Saldo, error)

GetSaldoByCardNumber: Retrieves saldo information for a specific card Purpose: Get the current balance and details for a particular card Parameters:

$1: card_number - The card number to lookup

Returns:

All saldo fields for the active record matching the card number

Business Logic:

  • Only returns active saldo records (deleted_at IS NULL)
  • Useful for checking card balances before transactions

func (*Queries) GetSaldoByID

func (q *Queries) GetSaldoByID(ctx context.Context, saldoID int32) (*Saldo, error)

GetSaldoByID: Retrieves single active saldo by ID Purpose: Fetch a specific saldo record for display or processing Parameters:

$1: saldo_id - Unique identifier of the saldo

Returns:

Single saldo record if it is active (deleted_at IS NULL)

Business Logic:

  • Ensures only active saldos are returned (soft-deleted saldos are excluded)
  • Used for detail views or transaction lookups

func (*Queries) GetSaldos

func (q *Queries) GetSaldos(ctx context.Context, arg GetSaldosParams) ([]*GetSaldosRow, error)

GetSaldos: Retrieves paginated list of active saldos with search capability Purpose: List all active saldos for admin or user dashboard with optional filtering Parameters:

$1: search_term - Optional text to filter saldos by card_number (NULL for no filter)
$2: limit - Maximum number of records to return
$3: offset - Number of records to skip for pagination

Returns:

All saldo fields plus total_count of matching records

Business Logic:

  • Excludes soft-deleted saldos (deleted_at IS NULL)
  • Supports partial text matching on card_number (case-insensitive)
  • Returns saldos ordered by saldo_id
  • Provides total_count for pagination calculations

func (*Queries) GetTopupByID

func (q *Queries) GetTopupByID(ctx context.Context, topupID int32) (*Topup, error)

GetTopupByID: Retrieves a specific topup by ID Purpose: Used to display details of a single topup transaction Parameters:

$1: topup_id - Unique identifier of the topup

Returns:

Topup record matching the ID (if not soft-deleted)

Business Logic:

  • Only returns record if it is active (deleted_at IS NULL)

func (*Queries) GetTopups

func (q *Queries) GetTopups(ctx context.Context, arg GetTopupsParams) ([]*GetTopupsRow, error)

GetTopups: Retrieves paginated list of active topups with search capability Purpose: Provide admin or user access to topup history with search support Parameters:

$1: search_term - Optional filter to match card_number, topup_no, topup_method, or status (NULL for no filter)
$2: limit - Max number of records to return
$3: offset - Records to skip for pagination

Returns:

All topup fields and total_count of matching records

Business Logic:

  • Filters out soft-deleted topups (deleted_at IS NULL)
  • Supports partial, case-insensitive search across multiple fields
  • Results sorted by topup_time (most recent first)
  • total_count is used for frontend pagination

func (*Queries) GetTopupsByCardNumber

func (q *Queries) GetTopupsByCardNumber(ctx context.Context, arg GetTopupsByCardNumberParams) ([]*GetTopupsByCardNumberRow, error)

GetTopupsByCardNumber: Retrieves paginated topups based on card number and optional search keyword Purpose: View all topups for a specific card, with filtering and pagination Parameters:

$1: card_number - Exact card number match
$2: keyword - Optional keyword (nullable), filters topup_no, method, status
$3: limit - Number of records to return
$4: offset - Offset for pagination

Returns:

All matching topup records with total_count using window function

Business Logic:

  • Skips soft-deleted records
  • Ordered by topup_time descending

func (*Queries) GetTotalBalance

func (q *Queries) GetTotalBalance(ctx context.Context) (int64, error)

GetTotalBalance: Calculates the sum of all active card balances Purpose: Get the total balance across all active cards in the system Returns:

Single column 'total_balance' containing the sum of all non-deleted card balances

Business Logic:

  • Only includes balances from active saldos records (s.deleted_at IS NULL)
  • Only includes balances from active cards (c.deleted_at IS NULL)
  • Useful for financial dashboards and system health monitoring
  • Returns NULL if no active balances exist

func (*Queries) GetTotalBalanceByCardNumber

func (q *Queries) GetTotalBalanceByCardNumber(ctx context.Context, cardNumber string) (int64, error)

GetTotalBalanceByCardNumber: Calculates the total balance for a specific card Purpose: Get the current balance of a particular active card Parameters:

$1: card_number - The card number to query balance for

Returns:

Single column 'total_balance' containing the sum balance for the specified card

Business Logic:

  • Only includes balance from active saldos records (s.deleted_at IS NULL)
  • Only includes balance if card is active (c.deleted_at IS NULL)
  • Returns NULL if card doesn't exist or has been deleted
  • Useful for displaying individual card balances

func (*Queries) GetTotalTopupAmount

func (q *Queries) GetTotalTopupAmount(ctx context.Context) (int64, error)

GetTotalTopupAmount: Calculates the sum of all top-up transactions Purpose: Get the total amount ever topped up across all active cards Returns:

Single column 'total_topup_amount' containing sum of all non-deleted topups

Business Logic:

  • Only includes amounts from active topups (t.deleted_at IS NULL)
  • Only includes amounts from active cards (c.deleted_at IS NULL)
  • Useful for financial reporting and reconciliation
  • Returns NULL if no topups exist

func (*Queries) GetTotalTopupAmountByCardNumber

func (q *Queries) GetTotalTopupAmountByCardNumber(ctx context.Context, cardNumber string) (int64, error)

GetTotalTopupAmountByCardNumber: Calculates total top-ups for a specific card Purpose: Get the lifetime top-up amount for a particular card Parameters:

$1: card_number - The card number to query top-ups for

Returns:

Single column 'total_topup_amount' containing sum of all top-ups

Business Logic:

  • Only includes active topup records (t.deleted_at IS NULL)
  • Only includes amounts when card is active (c.deleted_at IS NULL)
  • Useful for card activity analysis and user statements

func (*Queries) GetTotalTransactionAmount

func (q *Queries) GetTotalTransactionAmount(ctx context.Context) (int64, error)

GetTotalTransactionAmount: Calculates the sum of all payment transactions Purpose: Get the total amount processed through all card transactions Returns:

Single column 'total_transaction_amount' containing sum of all non-deleted transactions

Business Logic:

  • Only includes amounts from active transactions (t.deleted_at IS NULL)
  • Only includes amounts from active cards (c.deleted_at IS NULL)
  • Useful for sales reporting and revenue analysis
  • Returns NULL if no transactions exist

func (*Queries) GetTotalTransactionAmountByCardNumber

func (q *Queries) GetTotalTransactionAmountByCardNumber(ctx context.Context, cardNumber string) (int64, error)

GetTotalTransactionAmountByCardNumber: Calculates total transactions for a card Purpose: Get the lifetime transaction amount for a specific card Parameters:

$1: card_number - The card number to query transactions for

Returns:

Single column 'total_transaction_amount' containing sum of all transactions

Business Logic:

  • Only includes active transaction records (t.deleted_at IS NULL)
  • Only includes amounts when card is active (c.deleted_at IS NULL)
  • Useful for spending analysis and card statements

func (*Queries) GetTotalTransferAmount

func (q *Queries) GetTotalTransferAmount(ctx context.Context) (int64, error)

GetTotalTransferAmount: Calculates the sum of all transfer transactions Purpose: Get the total amount transferred between accounts Returns:

Single column 'total_transfer_amount' containing sum of all non-deleted transfers

Business Logic:

  • Includes amounts from both sides of transfers (using UNION ALL)
  • Only includes active transfer records (deleted_at IS NULL)
  • Counts both outgoing and incoming transfers in the total
  • Useful for monitoring money movement in the system
  • Returns NULL if no transfers exist

Note: The current implementation appears to double-count transfers by including

the same table twice in the UNION ALL. This may need review.

func (*Queries) GetTotalTransferAmountByReceiver

func (q *Queries) GetTotalTransferAmountByReceiver(ctx context.Context, transferTo string) (int64, error)

GetTotalTransferAmountByReceiver: Calculates total incoming transfers to an account Purpose: Get the total amount received by a specific card/account Parameters:

$1: transfer_to - The account/card number that received transfers

Returns:

Single column 'total_transfer_amount' containing sum of all incoming transfers

Business Logic:

  • Only includes active transfer records (deleted_at IS NULL)
  • Useful for tracking money received by a particular account

func (*Queries) GetTotalTransferAmountBySender

func (q *Queries) GetTotalTransferAmountBySender(ctx context.Context, transferFrom string) (int64, error)

GetTotalTransferAmountBySender: Calculates total outgoing transfers from an account Purpose: Get the total amount sent from a specific card/account Parameters:

$1: transfer_from - The account/card number that initiated transfers

Returns:

Single column 'total_transfer_amount' containing sum of all outgoing transfers

Business Logic:

  • Only includes active transfer records (deleted_at IS NULL)
  • Useful for tracking money sent by a particular account

func (*Queries) GetTotalWithdrawAmount

func (q *Queries) GetTotalWithdrawAmount(ctx context.Context) (int64, error)

GetTotalWithdrawAmount: Calculates the sum of all withdrawal transactions Purpose: Get the total amount ever withdrawn from all active cards Returns:

Single column 'total_withdraw_amount' containing sum of all non-deleted withdrawals

Business Logic:

  • Only includes amounts from active withdrawals (s.deleted_at IS NULL)
  • Only includes amounts from active cards (c.deleted_at IS NULL)
  • Useful for cash flow analysis and auditing
  • Returns NULL if no withdrawals exist

func (*Queries) GetTotalWithdrawAmountByCardNumber

func (q *Queries) GetTotalWithdrawAmountByCardNumber(ctx context.Context, cardNumber string) (int64, error)

GetTotalWithdrawAmountByCardNumber: Calculates total withdrawals for a card Purpose: Get the lifetime withdrawal amount for a specific card Parameters:

$1: card_number - The card number to query withdrawals for

Returns:

Single column 'total_withdraw_amount' containing sum of all withdrawals

Business Logic:

  • Only includes active withdrawal records (s.deleted_at IS NULL)
  • Only includes amounts when card is active (c.deleted_at IS NULL)
  • Useful for cash flow analysis per card

Note: Verify table name consistency (saldos vs withdraws)

func (*Queries) GetTransactionByCardNumber

func (q *Queries) GetTransactionByCardNumber(ctx context.Context, arg GetTransactionByCardNumberParams) ([]*GetTransactionByCardNumberRow, error)

GetTransactionByCardNumber: Retrieves paginated transactions for a specific card with optional filtering Purpose: View transaction history for a particular card with search capability Parameters:

$1: card_number - The card number to filter transactions (exact match)
$2: search_term - Optional text to filter by payment method (NULL for no filter)
$3: limit - Maximum number of records to return per page
$4: offset - Number of records to skip for pagination

Returns:

All transaction fields plus total_count of matching records

Business Logic:

  • Only returns active transactions (non-deleted records)
  • Strict matching on card_number combined with optional payment method search
  • Case-insensitive partial matching on payment_method when search term provided
  • Orders results by transaction_time (newest transactions first)
  • Includes pagination metadata via total_count
  • Useful for cardholder transaction history views and statements

func (*Queries) GetTransactionByID

func (q *Queries) GetTransactionByID(ctx context.Context, transactionID int32) (*Transaction, error)

GetTransactionByID: Retrieves a single transaction by its ID Purpose: Get detailed information about a specific transaction Parameters:

$1: transaction_id - The ID of the transaction to retrieve

Returns:

All fields for the specified transaction or NULL if not found/deleted

Business Logic:

  • Only returns active transactions (deleted_at IS NULL)
  • Useful for transaction details viewing and verification

func (*Queries) GetTransactions

func (q *Queries) GetTransactions(ctx context.Context, arg GetTransactionsParams) ([]*GetTransactionsRow, error)

GetTransactions: Retrieves paginated transaction records with search capability Purpose: List all transactions for management UI with filtering options Parameters:

$1: search_term - Optional text to filter transactions by card number, payment method, or status (NULL for no filter)
$2: limit - Maximum number of records to return
$3: offset - Number of records to skip for pagination

Returns:

All transaction fields plus total_count of matching records

Business Logic:

  • Excludes soft-deleted transactions (deleted_at IS NULL)
  • Supports partial text matching on multiple fields (case-insensitive)
  • Orders by transaction_time (newest first)
  • Provides total_count for pagination calculations
  • Useful for transaction monitoring and auditing

func (*Queries) GetTransactionsByCardNumber

func (q *Queries) GetTransactionsByCardNumber(ctx context.Context, arg GetTransactionsByCardNumberParams) ([]*GetTransactionsByCardNumberRow, error)

GetTransactionsByCardNumber: Retrieves paginated transactions for a specific card Purpose: List all transactions associated with a particular card Parameters:

$1: card_number - The card number to filter transactions
$2: search_term - Optional text to filter by payment method or status
$3: limit - Maximum number of records to return
$4: offset - Number of records to skip for pagination

Returns:

All transaction fields plus total_count of matching records

Business Logic:

  • Only includes active transactions (deleted_at IS NULL)
  • Strict card number matching combined with optional search filters
  • Orders by transaction_time (newest first)
  • Provides pagination support with total_count
  • Useful for cardholder transaction history

func (*Queries) GetTransactionsByMerchantID

func (q *Queries) GetTransactionsByMerchantID(ctx context.Context, merchantID int32) ([]*Transaction, error)

GetTransactionsByMerchantID: Retrieves transactions for a specific merchant Purpose: List all transactions associated with a merchant Parameters:

$1: merchant_id - The ID of the merchant to filter transactions

Returns:

All transaction fields for the merchant's transactions

Business Logic:

  • Only includes active transactions (deleted_at IS NULL)
  • Orders by transaction_time (newest first)
  • No pagination (assumes manageable number of records per merchant)
  • Useful for merchant transaction reports

func (*Queries) GetTransferByID

func (q *Queries) GetTransferByID(ctx context.Context, transferID int32) (*Transfer, error)

GetTransferByID: Retrieves a single transfer by its ID Purpose: Get detailed information about a specific transfer Parameters:

$1: transfer_id - The ID of the transfer to retrieve

Returns:

All fields for the specified transfer or NULL if not found/deleted

Business Logic:

  • Only returns active transfers (deleted_at IS NULL)
  • Useful for transfer verification and detailed viewing

func (*Queries) GetTransfers

func (q *Queries) GetTransfers(ctx context.Context, arg GetTransfersParams) ([]*GetTransfersRow, error)

GetTransfers: Retrieves paginated transfer records with search capability Purpose: List all active transfers for management UI with filtering options Parameters:

$1: search_term - Optional text to filter transfers by source or destination account (NULL for no filter)
$2: limit - Maximum number of records to return per page
$3: offset - Number of records to skip for pagination

Returns:

All transfer fields plus total_count of matching records

Business Logic:

  • Excludes soft-deleted transfers (deleted_at IS NULL)
  • Supports partial text matching on transfer_from and transfer_to fields (case-insensitive)
  • Orders by transfer_time (newest transfers first)
  • Provides total_count for pagination calculations
  • Useful for transfer monitoring and auditing

func (*Queries) GetTransfersByCardNumber

func (q *Queries) GetTransfersByCardNumber(ctx context.Context, transferFrom string) ([]*Transfer, error)

GetTransfersByCardNumber: Retrieves all transfers where the given card number is either the sender or the receiver Purpose:

Useful for displaying all transfer history related to a specific card

Parameters:

$1: card_number - Card number to search for in both transfer_from and transfer_to

Returns:

All transfer columns for matched records

Business Logic:

  • Excludes soft-deleted records (deleted_at IS NULL)
  • Sorted by most recent transfer first (DESC)

func (*Queries) GetTransfersByDestinationCard

func (q *Queries) GetTransfersByDestinationCard(ctx context.Context, transferTo string) ([]*Transfer, error)

GetTransfersByDestinationCard: Retrieves all transfers where the specified card is the destination (transfer_to) Purpose:

Track incoming transfers for a user or card

Parameters:

$1: card_number - The destination card number

Returns:

All transfer columns for matched records

Business Logic:

  • Excludes soft-deleted records (deleted_at IS NULL)
  • Sorted by most recent transfer first (DESC)

func (*Queries) GetTransfersBySourceCard

func (q *Queries) GetTransfersBySourceCard(ctx context.Context, transferFrom string) ([]*Transfer, error)

GetTransfersBySourceCard: Retrieves all transfers where the specified card is the source (transfer_from) Purpose:

Track outgoing transfer history for auditing or user activity

Parameters:

$1: card_number - The source card number

Returns:

All transfer columns for matched records

Business Logic:

  • Excludes soft-deleted records (deleted_at IS NULL)
  • Sorted by most recent transfer first (DESC)

func (*Queries) GetTrashedCardByID

func (q *Queries) GetTrashedCardByID(ctx context.Context, cardID int32) (*Card, error)

GetTrashedCardByID: Retrieves a single soft-deleted card by its ID Purpose: View details of a specific trashed card for recovery or audit Parameters:

$1: card_id - The ID of the card to retrieve

Returns:

All fields for the specified trashed card or NULL if not found or not deleted

Business Logic:

  • Only returns soft-deleted cards (deleted_at IS NOT NULL)
  • Useful for admin interfaces showing deleted items
  • Can be used before restoring a deleted card

func (*Queries) GetTrashedCardsWithCount

func (q *Queries) GetTrashedCardsWithCount(ctx context.Context, arg GetTrashedCardsWithCountParams) ([]*GetTrashedCardsWithCountRow, error)

GetTrashedCardsWithCount: Retrieves paginated list of soft-deleted cards with search capability Purpose: List all trashed (soft-deleted) cards for recovery or audit purposes Parameters:

$1: search_term - Optional text to filter cards by number, type or provider (NULL for no filter)
$2: limit - Maximum number of records to return
$3: offset - Number of records to skip for pagination

Returns:

All card fields plus total_count of matching records

Business Logic:

  • Includes only soft-deleted cards (deleted_at IS NOT NULL)
  • Supports partial text matching on card_number, card_type and card_provider fields (case-insensitive)
  • Returns cards ordered by card_id
  • Provides total_count for pagination calculations

func (*Queries) GetTrashedMerchantByID

func (q *Queries) GetTrashedMerchantByID(ctx context.Context, merchantID int32) (*Merchant, error)

GetTrashedMerchantByID: Retrieves a soft-deleted merchant by ID Purpose: Access trashed merchant record for potential restoration or inspection Parameters:

$1: merchant_id - Unique identifier of the merchant

Returns:

Trashed merchant record

Business Logic:

  • Includes only merchants that have been soft-deleted (deleted_at IS NOT NULL)

func (*Queries) GetTrashedMerchantDocuments

func (q *Queries) GetTrashedMerchantDocuments(ctx context.Context, arg GetTrashedMerchantDocumentsParams) ([]*GetTrashedMerchantDocumentsRow, error)

func (*Queries) GetTrashedMerchants

func (q *Queries) GetTrashedMerchants(ctx context.Context, arg GetTrashedMerchantsParams) ([]*GetTrashedMerchantsRow, error)

GetTrashedMerchants: Retrieves paginated list of soft-deleted merchants with search capability Purpose: View trashed merchants for potential restoration or permanent deletion Parameters:

$1: search_term - Optional text to filter by name, api_key, or status (NULL for no filter)
$2: limit - Maximum number of records to return
$3: offset - Number of records to skip for pagination

Returns:

All merchant fields plus total_count of matching records

Business Logic:

  • Only includes soft-deleted merchants (deleted_at IS NOT NULL)
  • Supports partial text search (case-insensitive) on name, api_key, and status
  • Returns results ordered by merchant_id
  • Provides total_count for pagination calculations

func (*Queries) GetTrashedRoles

func (q *Queries) GetTrashedRoles(ctx context.Context, arg GetTrashedRolesParams) ([]*GetTrashedRolesRow, error)

GetTrashedRoles: Retrieves only soft-deleted roles with optional search and pagination Purpose: For trash/recycle bin management Parameters:

$1: Search query (nullable)
$2: Limit
$3: Offset

Returns:

role_id, role_name, timestamps, and total_count

func (*Queries) GetTrashedSaldoByID

func (q *Queries) GetTrashedSaldoByID(ctx context.Context, saldoID int32) (*Saldo, error)

GetTrashedSaldoByID: Retrieves a single soft-deleted saldo record by ID Purpose: View details of a trashed saldo for recovery or audit purposes Parameters:

$1: saldo_id - The ID of the saldo record to retrieve

Returns:

All fields for the specified trashed saldo or NULL if not found/not deleted

Business Logic:

  • Only returns soft-deleted saldos (deleted_at IS NOT NULL)
  • Useful for admin interfaces showing deleted items
  • Can be used before restoring a deleted saldo

func (*Queries) GetTrashedSaldos

func (q *Queries) GetTrashedSaldos(ctx context.Context, arg GetTrashedSaldosParams) ([]*GetTrashedSaldosRow, error)

GetTrashedSaldos: Retrieves soft-deleted saldos with search and pagination Purpose: Display trashed saldos for recovery or permanent deletion Parameters:

$1: search_term - Optional search by card_number (NULL for no filter)
$2: limit - Max number of records
$3: offset - Number of rows to skip

Returns:

List of trashed saldos and total_count of matches

Business Logic:

  • Includes only soft-deleted saldos (deleted_at IS NOT NULL)
  • Partial match on card_number
  • Useful for building a "Trash Bin" feature in the UI

func (*Queries) GetTrashedTopupByID

func (q *Queries) GetTrashedTopupByID(ctx context.Context, topupID int32) (*Topup, error)

GetTrashedTopupByID: Retrieves a topup that has been soft-deleted Purpose: Preview or manage trashed entries (e.g., for restore) Parameters:

$1: topup_id - ID of the soft-deleted topup

Returns:

Full topup record if found and deleted_at IS NOT NULL

func (*Queries) GetTrashedTopups

func (q *Queries) GetTrashedTopups(ctx context.Context, arg GetTrashedTopupsParams) ([]*GetTrashedTopupsRow, error)

GetTrashedTopups: Retrieves trashed (soft-deleted) topups with pagination and search Purpose: Allow recovery or permanent deletion of topups Parameters:

$1: search_term - Optional filter to match card_number, topup_no, or topup_method
$2: limit - Max records to return
$3: offset - Rows to skip

Returns:

Trashed topup records with total_count

Business Logic:

  • Only includes topups where deleted_at IS NOT NULL
  • Supports flexible search
  • Results sorted by topup_time descending

func (*Queries) GetTrashedTransactionByID

func (q *Queries) GetTrashedTransactionByID(ctx context.Context, transactionID int32) (*Transaction, error)

GetTrashedTransactionByID: Retrieves a single soft-deleted transaction by ID Purpose: View details of a deleted transaction for recovery or audit Parameters:

$1: transaction_id - The ID of the transaction to retrieve

Returns:

All fields for the specified trashed transaction or NULL if not found/active

Business Logic:

  • Only returns soft-deleted transactions (deleted_at IS NOT NULL)
  • Used in admin interfaces for transaction recovery

func (*Queries) GetTrashedTransactions

func (q *Queries) GetTrashedTransactions(ctx context.Context, arg GetTrashedTransactionsParams) ([]*GetTrashedTransactionsRow, error)

GetTrashedTransactions: Retrieves paginated soft-deleted transactions Purpose: List all deleted transactions for recovery or audit purposes Parameters:

$1: search_term - Optional text to filter deleted transactions
$2: limit - Maximum records to return
$3: offset - Records to skip for pagination

Returns:

All transaction fields plus total_count of matching deleted records

Business Logic:

  • Only includes soft-deleted transactions (deleted_at IS NOT NULL)
  • Same filtering capabilities as active transactions
  • Maintains newest-first ordering
  • Used in admin interfaces for transaction recovery

func (*Queries) GetTrashedTransferByID

func (q *Queries) GetTrashedTransferByID(ctx context.Context, transferID int32) (*Transfer, error)

GetTrashedTransferByID: Retrieves a single soft-deleted transfer by its ID Purpose:

Used for viewing trashed data or restoring transfers

Parameters:

$1: transfer_id - ID of the transfer

Returns:

The transfer row if it exists and is soft-deleted

Business Logic:

  • Includes only soft-deleted records (deleted_at IS NOT NULL)

func (*Queries) GetTrashedTransfers

func (q *Queries) GetTrashedTransfers(ctx context.Context, arg GetTrashedTransfersParams) ([]*GetTrashedTransfersRow, error)

GetTrashedTransfers: Retrieves paginated soft-deleted transfers Purpose: List all deleted transfers for recovery or audit purposes Parameters:

$1: search_term - Optional text to filter deleted transfers
$2: limit - Maximum records to return per page
$3: offset - Records to skip for pagination

Returns:

All transfer fields plus total_count of matching deleted records

Business Logic:

  • Only includes soft-deleted transfers (deleted_at IS NOT NULL)
  • Same filtering capabilities as active transfers
  • Maintains newest-first ordering
  • Used in admin interfaces for transfer recovery

func (*Queries) GetTrashedUserByID

func (q *Queries) GetTrashedUserByID(ctx context.Context, userID int32) (*User, error)

GetTrashedUserByID: Retrieve trashed user by their ID Purpose: Fetch a trashed (soft-deleted) user based on their user_id. Parameters:

$1: user_id - The ID of the trashed user to fetch.

Returns:

  • User record matching the user_id where `deleted_at` is not NULL (indicating the user is trashed).

Business Logic:

  • Filters the users table to find a trashed user based on their `user_id`.
  • Checks that `deleted_at` is NOT NULL to ensure the user is trashed.

func (*Queries) GetTrashedUserRoles

func (q *Queries) GetTrashedUserRoles(ctx context.Context, userID int32) ([]*GetTrashedUserRolesRow, error)

GetTrashedUserRoles: Retrieves all soft-deleted roles for a given user Purpose: Review previously deleted role assignments for recovery or audit Parameters:

$1: User ID

Returns:

user_role_id, user_id, role_id, role_name, timestamps

Business Logic:

  • Joins with roles to show role name
  • Orders by most recently trashed

func (*Queries) GetTrashedUsersWithPagination

func (q *Queries) GetTrashedUsersWithPagination(ctx context.Context, arg GetTrashedUsersWithPaginationParams) ([]*GetTrashedUsersWithPaginationRow, error)

GetTrashedUsersWithPagination: Get Trashed Users with Pagination and Total Count Purpose: Retrieve trashed (soft-deleted) users with pagination and total count Parameters:

$1: search_term - A search term to filter trashed users by firstname, lastname, or email
$2: limit - The maximum number of trashed users to return per page
$3: offset - The number of trashed users to skip (for pagination)

Returns:

  • Trashed user records matching the search term, including firstname, lastname, and email
  • A total count of trashed users, including all pages (using COUNT(*) OVER())

Business Logic:

  • Filters users where `deleted_at` is NOT NULL (only trashed users).
  • Allows filtering by search term across firstname, lastname, or email.
  • Returns paginated trashed users, ordered by `created_at` in descending order.
  • The total count of trashed users is calculated, including those that are not currently on the current page.

func (*Queries) GetTrashedWithdrawByID

func (q *Queries) GetTrashedWithdrawByID(ctx context.Context, withdrawID int32) (*Withdraw, error)

GetTrashedWithdrawByID: Retrieves a single soft-deleted withdrawal by ID Purpose: View details of a deleted withdrawal for recovery or audit Parameters:

$1: withdraw_id - The ID of the withdrawal to retrieve

Returns:

All fields for the specified trashed withdrawal or NULL if not found/active

Business Logic:

  • Only returns soft-deleted withdrawals (deleted_at IS NOT NULL)
  • Used in admin interfaces for withdrawal recovery

func (*Queries) GetTrashedWithdraws

func (q *Queries) GetTrashedWithdraws(ctx context.Context, arg GetTrashedWithdrawsParams) ([]*GetTrashedWithdrawsRow, error)

GetTrashedWithdraws: Retrieves paginated soft-deleted withdrawals Purpose: List all deleted withdrawals for recovery or audit purposes Parameters:

$1: search_term - Optional text to filter deleted withdrawals
$2: limit - Maximum records to return per page
$3: offset - Records to skip for pagination

Returns:

All withdrawal fields plus total_count of matching deleted records

Business Logic:

  • Only includes soft-deleted withdrawals (deleted_at IS NOT NULL)
  • Same filtering capabilities as active withdrawals
  • Maintains newest-first ordering
  • Used in admin interfaces for withdrawal recovery

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (*User, error)

GetUserByEmail: Retrieve a user by their email Purpose: Fetch a specific user based on their email. Parameters:

$1: email - The email of the user to fetch.

Returns:

  • User record matching the provided email with `deleted_at` being NULL (active user).

Business Logic:

  • Filters the users table by email to find a user.
  • Ensures that the `deleted_at` field is NULL, so only active users are returned.

func (*Queries) GetUserByEmailAndVerified

func (q *Queries) GetUserByEmailAndVerified(ctx context.Context, email string) (*User, error)

Purpose: Retrieve a verified user by their email. Parameters:

$1: email - The email of the user to fetch.

Returns:

  • User record where email matches, user is verified, and not deleted.

Business Logic:

  • Must match email exactly.
  • `is_verified` must be true.
  • `deleted_at` must be NULL (not soft-deleted).

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, userID int32) (*User, error)

GetUserByID: Retrieve a user by their ID Purpose: Fetch details of a specific user by their unique user_id. Parameters:

$1: user_id - The ID of the user to fetch.

Returns:

  • User record matching the user_id with the `deleted_at` column being NULL (indicating the user is active).

Business Logic:

  • Filters the users table to find a user based on their `user_id`.
  • Ensures the user is active by checking that `deleted_at` is NULL.

func (*Queries) GetUserByVerificationCode

func (q *Queries) GetUserByVerificationCode(ctx context.Context, verificationCode string) (*User, error)

Purpose: Fetch a user based on their verification code. Parameters:

$1: verification_code - The verification code of the user to fetch.

Returns:

  • User record matching the provided verification code.

Business Logic:

  • Filters the users table to find a user based on their verification code.

func (*Queries) GetUserEmailByCardNumber

func (q *Queries) GetUserEmailByCardNumber(ctx context.Context, cardNumber string) (*GetUserEmailByCardNumberRow, error)

func (*Queries) GetUserRoles

func (q *Queries) GetUserRoles(ctx context.Context, userID int32) ([]*Role, error)

GetUserRoles: Retrieves all roles assigned to a specific user Purpose: Identify the access level(s) of a user Parameters:

$1: User ID

Returns:

List of roles (id, name, timestamps)

func (*Queries) GetUsersWithPagination

func (q *Queries) GetUsersWithPagination(ctx context.Context, arg GetUsersWithPaginationParams) ([]*GetUsersWithPaginationRow, error)

GetUsersWithPagination: Search Users with Pagination and Total Count Purpose: Retrieve users with pagination and total count of users matching the search criteria Parameters:

$1: search_term - A search term to filter users by firstname, lastname, or email
$2: limit - The maximum number of users to return per page
$3: offset - The number of users to skip (for pagination)

Returns:

  • User records matching the search term, including firstname, lastname, and email
  • A total count of matching users, including all pages (using COUNT(*) OVER())

Business Logic:

  • Filters users by search_term (if provided), allowing case-insensitive search.
  • Returns paginated results, ordered by `created_at` in descending order.
  • The total count includes the entire dataset, not limited by pagination.

func (*Queries) GetWithdrawByID

func (q *Queries) GetWithdrawByID(ctx context.Context, withdrawID int32) (*Withdraw, error)

GetWithdrawByID: Retrieves a single withdrawal by its ID Purpose: Get detailed information about a specific withdrawal Parameters:

$1: withdraw_id - The ID of the withdrawal to retrieve

Returns:

All fields for the specified withdrawal or NULL if not found/deleted

Business Logic:

  • Only returns active withdrawals (deleted_at IS NULL)
  • Useful for withdrawal details viewing and verification

func (*Queries) GetWithdraws

func (q *Queries) GetWithdraws(ctx context.Context, arg GetWithdrawsParams) ([]*GetWithdrawsRow, error)

GetWithdraws: Retrieves paginated withdrawal records with search capability Purpose: List all withdrawals for management UI with filtering options Parameters:

$1: search_term - Optional text to filter withdrawals by various fields (NULL for no filter)
$2: limit - Maximum number of records to return per page
$3: offset - Number of records to skip for pagination

Returns:

All withdrawal fields plus total_count of matching records

Business Logic:

  • Excludes soft-deleted withdrawals (deleted_at IS NULL)
  • Supports partial text matching on multiple fields (case-insensitive):
  • card_number
  • withdraw_amount (converted to text)
  • withdraw_time (converted to text)
  • status
  • Orders by withdraw_time (newest withdrawals first)
  • Provides total_count for pagination calculations
  • Useful for withdrawal monitoring and auditing

func (*Queries) GetWithdrawsByCardNumber

func (q *Queries) GetWithdrawsByCardNumber(ctx context.Context, arg GetWithdrawsByCardNumberParams) ([]*GetWithdrawsByCardNumberRow, error)

GetWithdrawsByCardNumber: Retrieves paginated withdrawals for a specific card with search Purpose: List all withdrawals associated with a particular card Parameters:

$1: card_number - The card number to filter withdrawals
$2: search_term - Optional text to filter by amount, time, or status
$3: limit - Maximum number of records to return per page
$4: offset - Number of records to skip for pagination

Returns:

All withdrawal fields plus total_count of matching records

Business Logic:

  • Only includes active withdrawals (deleted_at IS NULL)
  • Strict card number matching combined with optional search filters:
  • withdraw_amount (converted to text for searching)
  • withdraw_time (formatted as string for searching)
  • status
  • Orders by withdraw_time (newest first)
  • Provides pagination support with total_count
  • Useful for cardholder withdrawal history

func (*Queries) GetYearlyAmountByApikey

func (q *Queries) GetYearlyAmountByApikey(ctx context.Context, arg GetYearlyAmountByApikeyParams) ([]*GetYearlyAmountByApikeyRow, error)

GetYearlyAmountByMerchants: Retrieves total transaction amount per year for the last 5 years for a specific merchant Purpose: Show overall yearly revenue trends for a merchant across all payment methods Parameters:

$1: api-key - The merchant to filter transactions
$2: current_year - The latest year to include in the 5-year window

Returns:

  • Year (e.g., 2021, 2022)
  • Total transaction amount

Business Logic:

  • Filters only active (non-deleted) transactions and merchants
  • Filters by specific merchant_id
  • Includes data for the last 5 calendar years up to the current year
  • Groups by calendar year
  • Results are ordered chronologically by year

func (*Queries) GetYearlyAmountByMerchants

func (q *Queries) GetYearlyAmountByMerchants(ctx context.Context, arg GetYearlyAmountByMerchantsParams) ([]*GetYearlyAmountByMerchantsRow, error)

GetYearlyAmountByMerchants: Retrieves total transaction amount per year for the last 5 years for a specific merchant Purpose: Show overall yearly revenue trends for a merchant across all payment methods Parameters:

$1: merchant_id - The merchant to filter transactions
$2: current_year - The latest year to include in the 5-year window

Returns:

  • Year (e.g., 2021, 2022)
  • Total transaction amount

Business Logic:

  • Filters only active (non-deleted) transactions and merchants
  • Filters by specific merchant_id
  • Includes data for the last 5 calendar years up to the current year
  • Groups by calendar year
  • Results are ordered chronologically by year

func (*Queries) GetYearlyAmountMerchant

func (q *Queries) GetYearlyAmountMerchant(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyAmountMerchantRow, error)

GetYearlyAmountMerchant: Retrieves total transaction amount per year for the last 5 years Purpose: Show overall yearly revenue trends across all payment methods Parameters:

$1: current_year - The latest year to include in the 5-year window

Returns:

  • Year (e.g., 2021, 2022)
  • Total transaction amount

Business Logic:

  • Aggregates yearly transaction amounts
  • Filters only active (non-deleted) transactions and merchants
  • Includes data for the last 5 calendar years up to the current year
  • Ordered chronologically by year

func (*Queries) GetYearlyAmounts

func (q *Queries) GetYearlyAmounts(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyAmountsRow, error)

GetYearlyAmounts: Retrieves total transaction amount per year over a 5-year span Purpose:

Analyze annual growth or decline in transaction volume for trend analysis

Parameters:

$1: current_year - The most recent year to include (covers current_year - 4 to current_year)

Returns:

  • year: Year of the transaction
  • total_amount: Total transaction amount for the year

Business Logic:

  • Excludes soft-deleted transactions (deleted_at IS NULL)

func (*Queries) GetYearlyAmountsByCardNumber

func (q *Queries) GetYearlyAmountsByCardNumber(ctx context.Context, arg GetYearlyAmountsByCardNumberParams) ([]*GetYearlyAmountsByCardNumberRow, error)

GetYearlyAmountsByCardNumber: Retrieves total transaction amount per year over a 5-year span Purpose:

Analyze annual growth or decline in transaction volume for trend analysis

Parameters:

$1: card_number  - filter by card_number
$2: current_year - The most recent year to include (covers current_year - 4 to current_year)

Returns:

  • year: Year of the transaction
  • total_amount: Total transaction amount for the year

Business Logic:

  • Excludes soft-deleted transactions (deleted_at IS NULL)

func (*Queries) GetYearlyBalances

func (q *Queries) GetYearlyBalances(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyBalancesRow, error)

GetYearlyBalances: Retrieves yearly balance totals for last 5 years Purpose: Provide annual balance trends for financial reporting Parameters:

$1: reference_year - The target year (includes this year plus previous 4)

Returns:

year: The 4-digit year
total_balance: Sum of balances for that year

Business Logic:

  • Covers a 5-year rolling window (reference_year-4 to reference_year)
  • Only includes active saldos and cards
  • Groups by calendar year
  • Results ordered chronologically

func (*Queries) GetYearlyBalancesByCardNumber

func (q *Queries) GetYearlyBalancesByCardNumber(ctx context.Context, arg GetYearlyBalancesByCardNumberParams) ([]*GetYearlyBalancesByCardNumberRow, error)

GetYearlyBalancesByCardNumber: Retrieves 5-year balance history for a specific card Purpose: Show annual balance trends for individual cardholders Parameters:

$1: reference_year - Central year for 5-year window
$2: card_number - Specific card to analyze

Returns:

year: 4-digit year
total_balance: Annual balance total

Business Logic:

  • Covers reference_year-4 to reference_year (5 years)
  • Strictly filters for specified card
  • Only includes active records
  • Useful for long-term financial planning

func (*Queries) GetYearlyPaymentMethodByApikey

func (q *Queries) GetYearlyPaymentMethodByApikey(ctx context.Context, arg GetYearlyPaymentMethodByApikeyParams) ([]*GetYearlyPaymentMethodByApikeyRow, error)

GetYearlyPaymentMethodByApikey: Retrieves total transaction amount per payment method over the last 5 years for a specific merchant Purpose: Analyze yearly transaction totals grouped by payment method for a merchant Parameters:

$1: api-key - The merchant to filter transactions
$2: current_year - The latest year to include in the 5-year window

Returns:

  • Year (e.g., 2021, 2022)
  • Payment method
  • Total transaction amount

Business Logic:

  • Filters only active (non-deleted) transactions and merchants
  • Filters by specific merchant_id
  • Includes data for the last 5 calendar years up to the current year
  • Groups by calendar year and payment method
  • Results are ordered chronologically by year

func (*Queries) GetYearlyPaymentMethodByMerchants

GetYearlyPaymentMethodByMerchants: Retrieves total transaction amount per payment method over the last 5 years for a specific merchant Purpose: Analyze yearly transaction totals grouped by payment method for a merchant Parameters:

$1: current_year - The latest year to include in the 5-year window
$2: merchant_id - The merchant to filter transactions

Returns:

  • Year (e.g., 2021, 2022)
  • Payment method
  • Total transaction amount

Business Logic:

  • Filters only active (non-deleted) transactions and merchants
  • Filters by specific merchant_id
  • Includes data for the last 5 calendar years up to the current year
  • Groups by calendar year and payment method
  • Results are ordered chronologically by year

func (*Queries) GetYearlyPaymentMethodMerchant

func (q *Queries) GetYearlyPaymentMethodMerchant(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyPaymentMethodMerchantRow, error)

GetYearlyPaymentMethodMerchant: Retrieves yearly transaction totals per payment method (last 5 years) Purpose: Show transaction trends across payment methods over the past 5 years Parameters:

$1: current_year - The latest year to include in the 5-year window

Returns:

  • Year (e.g., 2021, 2022)
  • Payment method
  • Total transaction amount

Business Logic:

  • Aggregates yearly totals for each payment method
  • Includes only active (non-deleted) transactions and merchants
  • Covers a 5-year range: (current_year - 4) to current_year
  • Ordered by year

func (*Queries) GetYearlyPaymentMethods

func (q *Queries) GetYearlyPaymentMethods(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyPaymentMethodsRow, error)

GetYearlyPaymentMethods: Retrieves yearly summary of transaction transactions grouped by payment method over a 5-year span Purpose:

Analyze long-term trends of transaction method usage across years

Parameters:

$1: current_year - The most recent year to include (covers current_year - 4 to current_year)

Returns:

  • year: Year of transaction (e.g., 2020, 2021)
  • payment_method
  • total_transactions: Count of transactions per method per year
  • total_amount: Sum of amounts per method per year

Business Logic:

  • Filters data within a 5-year window
  • Excludes soft-deleted transactions (deleted_at IS NULL)

func (*Queries) GetYearlyPaymentMethodsByCardNumber

GetYearlyPaymentMethodsByCardNumber: Retrieves yearly summary of transaction transactions grouped by payment method over a 5-year span Purpose:

Analyze long-term trends of transaction method usage across years

Parameters:

$1: card_number  - filter by card_number
$2: current_year - The most recent year to include (covers current_year - 4 to current_year)

Returns:

  • year: Year of transaction (e.g., 2020, 2021)
  • payment_method
  • total_transactions: Count of transactions per method per year
  • total_amount: Sum of amounts per method per year

Business Logic:

  • Filters data within a 5-year window
  • Excludes soft-deleted transactions (deleted_at IS NULL)

func (*Queries) GetYearlySaldoBalances

func (q *Queries) GetYearlySaldoBalances(ctx context.Context, dollar_1 interface{}) ([]*GetYearlySaldoBalancesRow, error)

GetYearlySaldoBalances: Retrieves yearly balance totals for a 5-year period Purpose: Show annual balance trends for long-term financial analysis Parameters:

$1: reference_year - The target year (includes this year plus previous 4 years)

Returns:

year: The 4-digit year
total_balance: Sum of balances for that year

Business Logic:

  • Covers a 5-year rolling window (reference_year-4 to reference_year)
  • Only includes active saldo records (deleted_at IS NULL)
  • Groups by calendar year
  • Results ordered chronologically
  • Useful for identifying year-over-year trends and growth patterns

func (*Queries) GetYearlyTopupAmount

func (q *Queries) GetYearlyTopupAmount(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTopupAmountRow, error)

GetYearlyTopupAmount: Retrieves yearly top-up totals for last 5 years Purpose: Analyze long-term top-up trends and growth Parameters:

$1: reference_year - The target year (includes this year plus previous 4)

Returns:

year: The 4-digit year
total_topup_amount: Sum of top-ups for that year

Business Logic:

  • Covers a 5-year rolling window
  • Only includes active topups and cards
  • Groups by calendar year
  • Results ordered chronologically
  • Useful for identifying annual growth patterns

func (*Queries) GetYearlyTopupAmountByCardNumber

func (q *Queries) GetYearlyTopupAmountByCardNumber(ctx context.Context, arg GetYearlyTopupAmountByCardNumberParams) ([]*GetYearlyTopupAmountByCardNumberRow, error)

GetYearlyTopupAmountByCardNumber: Retrieves 5-year top-up history for a card Purpose: Track long-term top-up trends for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_year - Central year for 5-year window

Returns:

year: 4-digit year
total_topup_amount: Annual top-up total

Business Logic:

  • 5-year rolling window analysis
  • Strict card number filtering
  • Active records only
  • Chronological ordering
  • Useful for identifying annual top-up growth/decline

func (*Queries) GetYearlyTopupAmounts

func (q *Queries) GetYearlyTopupAmounts(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTopupAmountsRow, error)

GetYearlyTopupAmounts: Retrieves yearly total of topup amounts Purpose: Analyze yearly growth or decline in topup volume Parameters:

$1: current_year - The latest year to include (e.g., 2024), includes 5-year span (current_year - 4)

Returns:

year: Year extracted from topup_time
total_amount: Sum of all topup amounts in the year

Business Logic:

  • Includes topup data from current year and 4 years prior
  • Excludes soft-deleted records (deleted_at IS NULL)
  • Ideal for trend lines or comparative bar charts by year

func (*Queries) GetYearlyTopupAmountsByCardNumber

GetYearlyTopupAmountsByCardNumber: Retrieves yearly total of topup amounts Purpose: Analyze yearly growth or decline in topup volume Parameters:

$1: card_number  - filter by card_number
$2: current_year - The latest year to include (e.g., 2024), includes 5-year span (current_year - 4)

Returns:

year: Year extracted from topup_time
total_amount: Sum of all topup amounts in the year

Business Logic:

  • Includes topup data from current year and 4 years prior
  • Excludes soft-deleted records (deleted_at IS NULL)
  • Ideal for trend lines or comparative bar charts by year

func (*Queries) GetYearlyTopupMethods

func (q *Queries) GetYearlyTopupMethods(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTopupMethodsRow, error)

GetYearlyTopupMethods: Retrieves yearly breakdown of topup usage by method Purpose: Analyze how different topup methods perform over the past 5 years Parameters:

$1: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)

Returns:

year: Year extracted from topup_time
topup_method: Method used for topup
total_topups: Number of topups using that method in the year
total_amount: Total topup amount for the method in the year

Business Logic:

  • Filters to topups within a 5-year window up to the given year
  • Filters out soft-deleted data (deleted_at IS NULL)
  • Useful for detecting long-term trends across payment methods

func (*Queries) GetYearlyTopupMethodsByCardNumber

GetYearlyTopupMethodsByCardNumber: Retrieves yearly breakdown of topup usage by method Purpose: Analyze how different topup methods perform over the past 5 years Parameters:

$1: card_number  - filter by card_number
$2: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)

Returns:

year: Year extracted from topup_time
topup_method: Method used for topup
total_topups: Number of topups using that method in the year
total_amount: Total topup amount for the method in the year

Business Logic:

  • Filters to topups within a 5-year window up to the given year
  • Filters out soft-deleted data (deleted_at IS NULL)
  • Useful for detecting long-term trends across payment methods

func (*Queries) GetYearlyTopupStatusFailed

func (q *Queries) GetYearlyTopupStatusFailed(ctx context.Context, dollar_1 int32) ([]*GetYearlyTopupStatusFailedRow, error)

GetYearlyTopupStatusFailed: Retrieves yearly failed metrics for topups Purpose: Compare annual failedful topup performance Parameters:

$1: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_failed: Count of failedful topups
total_amount: Sum of failedful topup amounts

Business Logic:

  • Only includes failedful topups (status = 'failed')
  • Compares current year with previous year
  • Zero-fills years with no activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis

func (*Queries) GetYearlyTopupStatusFailedCardNumber

GetYearlyTopupStatusFailedCardNumber: Retrieves yearly failed metrics for topups Purpose: Compare annual failedful topup performance Parameters:

$1: card_number  - filter by card_number
$2: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_failed: Count of failedful topups
total_amount: Sum of failedful topup amounts

Business Logic:

  • Only includes failedful topups (status = 'failed')
  • Compares current year with previous year
  • Zero-fills years with no activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis

func (*Queries) GetYearlyTopupStatusSuccess

func (q *Queries) GetYearlyTopupStatusSuccess(ctx context.Context, dollar_1 int32) ([]*GetYearlyTopupStatusSuccessRow, error)

GetYearlyTopupStatusSuccess: Retrieves yearly success metrics for topups Purpose: Compare annual successful topup performance Parameters:

$1: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_success: Count of successful topups
total_amount: Sum of successful topup amounts

Business Logic:

  • Only includes successful topups (status = 'success')
  • Compares current year with previous year
  • Zero-fills years with no activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis

func (*Queries) GetYearlyTopupStatusSuccessCardNumber

GetYearlyTopupStatusSuccess: Retrieves yearly success metrics for topups Purpose: Compare annual successful topup performance Parameters:

$1: card_number       - Optional filter by card_number (NULL to ignore filter)
$2: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_success: Count of successful topups
total_amount: Sum of successful topup amounts

Business Logic:

  • Only includes successful topups (status = 'success')
  • Compares current year with previous year
  • Zero-fills years with no activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis

func (*Queries) GetYearlyTotalAmountByApikey

func (q *Queries) GetYearlyTotalAmountByApikey(ctx context.Context, arg GetYearlyTotalAmountByApikeyParams) ([]*GetYearlyTotalAmountByApikeyRow, error)

GetYearlyTotalAmountByApikey: Retrieves total transaction amounts for the current and previous year Purpose: Provide yearly transaction summary with fallback to 0 if no transactions exist Parameters:

$1: current_year - The latest year to include in the summary
$2: api-key - The merchant to filter transactions

Returns:

  • Year (as text)
  • Total transaction amount per year

Business Logic:

  • Aggregates total amounts for both the current year and the previous year
  • Filters only active (non-deleted) transactions and merchants
  • Ensures both years appear in the result, even if no data exists (returns 0 in such case)
  • Uses UNION ALL to combine actual data with 0-filled placeholders
  • Results are ordered in descending order by year

func (*Queries) GetYearlyTotalAmountByMerchant

func (q *Queries) GetYearlyTotalAmountByMerchant(ctx context.Context, arg GetYearlyTotalAmountByMerchantParams) ([]*GetYearlyTotalAmountByMerchantRow, error)

GetYearlyTotalAmountByMerchant: Retrieves total transaction amounts for the current and previous year Purpose: Provide yearly transaction summary with fallback to 0 if no transactions exist Parameters:

$1: current_year - The latest year to include in the summary
$2: merchant_id - The merchant to filter transactions

Returns:

  • Year (as text)
  • Total transaction amount per year

Business Logic:

  • Aggregates total amounts for both the current year and the previous year
  • Filters only active (non-deleted) transactions and merchants
  • Ensures both years appear in the result, even if no data exists (returns 0 in such case)
  • Uses UNION ALL to combine actual data with 0-filled placeholders
  • Results are ordered in descending order by year

func (*Queries) GetYearlyTotalAmountMerchant

func (q *Queries) GetYearlyTotalAmountMerchant(ctx context.Context, dollar_1 int32) ([]*GetYearlyTotalAmountMerchantRow, error)

GetYearlyTotalAmountMerchant: Retrieves total transaction amounts for the current and previous year Purpose: Provide yearly transaction summary with fallback to 0 if no transactions exist Parameters:

$1: current_year - The latest year to include in the summary

Returns:

  • Year (as text)
  • Total transaction amount per year

Business Logic:

  • Aggregates total amounts for both the current year and the previous year
  • Filters only active (non-deleted) transactions and merchants
  • Ensures both years appear in the result, even if no data exists (returns 0 in such case)
  • Uses UNION ALL to combine actual data with 0-filled placeholders
  • Results are ordered in descending order by year

func (*Queries) GetYearlyTotalSaldoBalances

func (q *Queries) GetYearlyTotalSaldoBalances(ctx context.Context, dollar_1 int32) ([]*GetYearlyTotalSaldoBalancesRow, error)

GetYearlyTotalSaldoBalances: Retrieves yearly balance totals for current and previous year Purpose: Compare annual balance trends between current and previous year Parameters:

$1: current_year - The year to analyze (includes this year and previous)

Returns:

year: The year as text
total_balance: Annual balance total (0 if no data)

Business Logic:

  • Shows comparison between specified year and previous year
  • Only includes active saldos (deleted_at IS NULL)
  • Ensures both years appear with zero-filling if missing
  • Results ordered by year (newest first)
  • Useful for year-over-year financial analysis

func (*Queries) GetYearlyTransactionAmount

func (q *Queries) GetYearlyTransactionAmount(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTransactionAmountRow, error)

GetYearlyTransactionAmount: Retrieves yearly transaction totals for last 5 years Purpose: Analyze long-term transaction trends and growth Parameters:

$1: reference_year - The target year (includes this year plus previous 4)

Returns:

year: The 4-digit year
total_transaction_amount: Sum of transactions for that year

Business Logic:

  • Covers a 5-year rolling window
  • Only includes active transactions and cards
  • Groups by calendar year
  • Results ordered chronologically
  • Useful for identifying annual growth patterns

func (*Queries) GetYearlyTransactionAmountByCardNumber

GetYearlyTransactionAmountByCardNumber: Retrieves 5-year transaction history for a card Purpose: Track long-term transaction trends for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_year - Central year for 5-year window

Returns:

year: 4-digit year
total_transaction_amount: Annual transaction total

Business Logic:

  • 5-year rolling window analysis
  • Strict card number filtering
  • Active records only
  • Chronological ordering
  • Useful for identifying annual transaction growth/decline

func (*Queries) GetYearlyTransactionStatusFailed

func (q *Queries) GetYearlyTransactionStatusFailed(ctx context.Context, dollar_1 int32) ([]*GetYearlyTransactionStatusFailedRow, error)

GetYearlyTransactionStatusFailed: Retrieves yearly failed metrics for transactions Purpose: Compare annual failedful transaction performance Parameters:

$1: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_failed: Count of failedful transactions
total_amount: Sum of failedful transaction amounts

Business Logic:

  • Only includes failedful transactions (status = 'failed')
  • Compares current year with previous year
  • Zero-fills years with no activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis and financial reporting
  • Helps identify annual transaction volume and revenue trends

func (*Queries) GetYearlyTransactionStatusFailedCardNumber

GetYearlyTransactionStatusFailed: Retrieves yearly failed metrics for transactions Purpose: Compare annual failedful transaction performance Parameters:

$1: card_number  - filter by card_number
$2: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_failed: Count of failedful transactions
total_amount: Sum of failedful transaction amounts

Business Logic:

  • Only includes failedful transactions (status = 'failed')
  • Compares current year with previous year
  • Zero-fills years with no activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis and financial reporting
  • Helps identify annual transaction volume and revenue trends

func (*Queries) GetYearlyTransactionStatusSuccess

func (q *Queries) GetYearlyTransactionStatusSuccess(ctx context.Context, dollar_1 int32) ([]*GetYearlyTransactionStatusSuccessRow, error)

GetYearlyTransactionStatusSuccess: Retrieves yearly success metrics for transactions Purpose: Compare annual successful transaction performance Parameters:

$1: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_success: Count of successful transactions
total_amount: Sum of successful transaction amounts

Business Logic:

  • Only includes successful transactions (status = 'success')
  • Compares current year with previous year
  • Zero-fills years with no activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis and financial reporting
  • Helps identify annual transaction volume and revenue trends

func (*Queries) GetYearlyTransactionStatusSuccessCardNumber

GetYearlyTransactionStatusSuccessCardNumber: Retrieves yearly success metrics for transactions Purpose: Compare annual successful transaction performance Parameters:

$1: card_number  - filter by card_number
$2: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_success: Count of successful transactions
total_amount: Sum of successful transaction amounts

Business Logic:

  • Only includes successful transactions (status = 'success')
  • Compares current year with previous year
  • Zero-fills years with no activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis and financial reporting
  • Helps identify annual transaction volume and revenue trends

func (*Queries) GetYearlyTransferAmountByReceiver

GetYearlyTransferAmountByReceiver: Retrieves 5-year transfer history for a card Purpose: Track long-term transfer trends for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_year - Central year for 5-year window

Returns:

year: 4-digit year
total_sent_amount: Annual transfer total

Business Logic:

  • 5-year rolling window analysis
  • Strict card number filtering
  • Active records only
  • Chronological ordering
  • Useful for identifying annual transfer growth/decline

func (*Queries) GetYearlyTransferAmountBySender

func (q *Queries) GetYearlyTransferAmountBySender(ctx context.Context, arg GetYearlyTransferAmountBySenderParams) ([]*GetYearlyTransferAmountBySenderRow, error)

GetYearlyTransferAmountBySender: Retrieves 5-year transfer history for a card Purpose: Track long-term transfer trends for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_year - Central year for 5-year window

Returns:

year: 4-digit year
total_sent_amount: Annual transfer total

Business Logic:

  • 5-year rolling window analysis
  • Strict card number filtering
  • Active records only
  • Chronological ordering
  • Useful for identifying annual transfer growth/decline

func (*Queries) GetYearlyTransferAmountReceiver

func (q *Queries) GetYearlyTransferAmountReceiver(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTransferAmountReceiverRow, error)

GetYearlyTransferAmountReceiver: Retrieves yearly transfer totals for last 5 years Purpose: Analyze long-term transfer trends and growth Parameters:

$1: reference_year - The target year (includes this year plus previous 4)

Returns:

year: The 4-digit year
total_received_amount: Sum of transfers for that year

Business Logic:

  • Covers a 5-year rolling window
  • Only includes active topups and cards
  • Groups by calendar year
  • Results ordered chronologically
  • Useful for identifying annual growth patterns

func (*Queries) GetYearlyTransferAmountSender

func (q *Queries) GetYearlyTransferAmountSender(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTransferAmountSenderRow, error)

GetYearlyTransferAmountSender: Retrieves yearly transfer totals for last 5 years Purpose: Analyze long-term transfer trends and growth Parameters:

$1: reference_year - The target year (includes this year plus previous 4)

Returns:

year: The 4-digit year
total_sent_amount: Sum of transfers for that year

Business Logic:

  • Covers a 5-year rolling window
  • Only includes active topups and cards
  • Groups by calendar year
  • Results ordered chronologically
  • Useful for identifying annual growth patterns

func (*Queries) GetYearlyTransferAmounts

func (q *Queries) GetYearlyTransferAmounts(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyTransferAmountsRow, error)

GetYearlyTransferAmounts: Retrieves yearly transfer amounts Purpose: Analyze total transfer amounts over a 5-year period Parameters:

$1: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)

Returns:

year: 4-digit year
total_transfer_amount: Sum of transfer amounts in that year

Business Logic:

  • Covers a 5-year window (current_year - 4 to current_year)
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Groups by calendar year
  • Useful for identifying long-term money movement trends

func (*Queries) GetYearlyTransferAmountsByReceiverCardNumber

GetYearlyTransferAmountsByReceiverCardNumber: Retrieves yearly transfer amounts Purpose: Analyze total transfer amounts over a 5-year period Parameters:

$1: card_number  - filter by card_number
$2: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)

Returns:

year: 4-digit year
total_transfer_amount: Sum of transfer amounts in that year

Business Logic:

  • Covers a 5-year window (current_year - 4 to current_year)
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Groups by calendar year
  • Useful for identifying long-term money movement trends

func (*Queries) GetYearlyTransferAmountsBySenderCardNumber

GetYearlyTransferAmountsBySenderCardNumber: Retrieves yearly transfer amounts Purpose: Analyze total transfer amounts over a 5-year period Parameters:

$1: card_number  - filter by card_number
$2: current_year - The final year to include (e.g., 2024), includes 5-year span (current_year - 4)

Returns:

year: 4-digit year
total_transfer_amount: Sum of transfer amounts in that year

Business Logic:

  • Covers a 5-year window (current_year - 4 to current_year)
  • Filters out soft-deleted records (deleted_at IS NULL)
  • Groups by calendar year
  • Useful for identifying long-term money movement trends

func (*Queries) GetYearlyTransferStatusFailed

func (q *Queries) GetYearlyTransferStatusFailed(ctx context.Context, dollar_1 int32) ([]*GetYearlyTransferStatusFailedRow, error)

GetYearlyTransferStatusFailed: Retrieves yearly failed metrics for fund transfers Purpose: Compare annual failedful transfer performance year-over-year Parameters:

$1: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_failed: Count of failedful transfers
total_amount: Sum of failedful transfer amounts

Business Logic:

  • Only includes failedful transfers (status = 'failed')
  • Compares current year with previous year
  • Zero-fills years with no transfer activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis and financial reporting
  • Helps identify annual transfer volume and money movement trends

func (*Queries) GetYearlyTransferStatusFailedCardNumber

GetYearlyTransferStatusFailedCardNumber: Retrieves yearly failed metrics for fund transfers Purpose: Compare annual failedful transfer performance year-over-year Parameters:

$1: card_number  - filter by card_number
$2: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_failed: Count of failedful transfers
total_amount: Sum of failedful transfer amounts

Business Logic:

  • Only includes failedful transfers (status = 'failed')
  • Compares current year with previous year
  • Zero-fills years with no transfer activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis and financial reporting
  • Helps identify annual transfer volume and money movement trends

func (*Queries) GetYearlyTransferStatusSuccess

func (q *Queries) GetYearlyTransferStatusSuccess(ctx context.Context, dollar_1 int32) ([]*GetYearlyTransferStatusSuccessRow, error)

GetYearlyTransferStatusSuccess: Retrieves yearly success metrics for fund transfers Purpose: Compare annual successful transfer performance year-over-year Parameters:

$1: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_success: Count of successful transfers
total_amount: Sum of successful transfer amounts

Business Logic:

  • Only includes successful transfers (status = 'success')
  • Compares current year with previous year
  • Zero-fills years with no transfer activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis and financial reporting
  • Helps identify annual transfer volume and money movement trends

func (*Queries) GetYearlyTransferStatusSuccessCardNumber

GetYearlyTransferStatusSuccessCardNumber: Retrieves yearly success metrics for fund transfers Purpose: Compare annual successful transfer performance year-over-year Parameters:

$1: card_number  - filter by card_number
$2: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_success: Count of successful transfers
total_amount: Sum of successful transfer amounts

Business Logic:

  • Only includes successful transfers (status = 'success')
  • Compares current year with previous year
  • Zero-fills years with no transfer activity
  • Orders by year (newest first)
  • Useful for year-over-year growth analysis and financial reporting
  • Helps identify annual transfer volume and money movement trends

func (*Queries) GetYearlyWithdrawAmount

func (q *Queries) GetYearlyWithdrawAmount(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyWithdrawAmountRow, error)

GetYearlyWithdrawAmount: Retrieves yearly withdraw totals for last 5 years Purpose: Analyze long-term withdraw trends and growth Parameters:

$1: reference_year - The target year (includes this year plus previous 4)

Returns:

year: The 4-digit year
total_withdraw_amount: Sum of withdraws for that year

Business Logic:

  • Covers a 5-year rolling window
  • Only includes active withdraws and cards
  • Groups by calendar year
  • Results ordered chronologically
  • Useful for identifying annual growth patterns

func (*Queries) GetYearlyWithdrawAmountByCardNumber

GetYearlyWithdrawAmountByCardNumber: Retrieves 5-year withdraw history for a card Purpose: Track long-term withdraw trends for individual cards Parameters:

$1: card_number - Specific card to analyze
$2: reference_year - Central year for 5-year window

Returns:

year: 4-digit year
total_withdraw_amount: Annual withdraw total

Business Logic:

  • 5-year rolling window analysis
  • Strict card number filtering
  • Active records only
  • Chronological ordering
  • Useful for identifying annual withdraw growth/decline

func (*Queries) GetYearlyWithdrawStatusFailed

func (q *Queries) GetYearlyWithdrawStatusFailed(ctx context.Context, dollar_1 int32) ([]*GetYearlyWithdrawStatusFailedRow, error)

GetYearlyWithdrawStatusFailed: Retrieves yearly failed metrics for withdrawals Purpose: Compare annual failedful withdrawal performance year-over-year Parameters:

$1: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_failed: Count of failedful withdrawals
total_amount: Sum of failedful withdrawal amounts

Business Logic:

  • Only includes failedful withdrawals (status = 'failed')
  • Compares current year with previous year
  • Zero-fills years with no withdrawal activity
  • Orders by year (newest first)
  • Useful for year-over-year cash flow analysis
  • Helps identify annual withdrawal patterns and liquidity trends

func (*Queries) GetYearlyWithdrawStatusFailedCardNumber

GetYearlyWithdrawStatusFailedCardNumber: Retrieves yearly failed metrics for withdrawals Purpose: Compare annual failedful withdrawal performance year-over-year Parameters:

$1: card_number  - filter by card_number
$2: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_failed: Count of failedful withdrawals
total_amount: Sum of failedful withdrawal amounts

Business Logic:

  • Only includes failedful withdrawals (status = 'failed')
  • Compares current year with previous year
  • Zero-fills years with no withdrawal activity
  • Orders by year (newest first)
  • Useful for year-over-year cash flow analysis
  • Helps identify annual withdrawal patterns and liquidity trends

func (*Queries) GetYearlyWithdrawStatusSuccess

func (q *Queries) GetYearlyWithdrawStatusSuccess(ctx context.Context, dollar_1 int32) ([]*GetYearlyWithdrawStatusSuccessRow, error)

GetYearlyWithdrawStatusSuccess: Retrieves yearly success metrics for withdrawals Purpose: Compare annual successful withdrawal performance year-over-year Parameters:

$1: current_year - The target year (includes this year and previous)

Returns:

year: Year as text (e.g., '2023')
total_success: Count of successful withdrawals
total_amount: Sum of successful withdrawal amounts

Business Logic:

  • Only includes successful withdrawals (status = 'success')
  • Compares current year with previous year
  • Zero-fills years with no withdrawal activity
  • Orders by year (newest first)
  • Useful for year-over-year cash flow analysis
  • Helps identify annual withdrawal patterns and liquidity trends

func (*Queries) GetYearlyWithdraws

func (q *Queries) GetYearlyWithdraws(ctx context.Context, dollar_1 interface{}) ([]*GetYearlyWithdrawsRow, error)

GetYearlyWithdraws: Retrieves yearly withdrawal totals for a 5-year period Purpose: Analyze long-term withdrawal trends Parameters:

$1: current_year - The final year to include (includes this year and previous 4 years)

Returns:

year: 4-digit year
total_withdraw_amount: Sum of withdrawal amounts for that year

Business Logic:

  • Covers a 5-year rolling window (current_year-4 to current_year)
  • Only includes active withdrawal records
  • Groups by calendar year
  • Orders results chronologically
  • Useful for identifying annual cash usage patterns

func (*Queries) GetYearlyWithdrawsByCardNumber

func (q *Queries) GetYearlyWithdrawsByCardNumber(ctx context.Context, arg GetYearlyWithdrawsByCardNumberParams) ([]*GetYearlyWithdrawsByCardNumberRow, error)

GetYearlyWithdrawsByCardNumber: Retrieves yearly withdrawals for a specific card Purpose: Analyze long-term cash usage for individual cardholders Parameters:

$1: card_number - The card number to filter withdrawals
$2: current_year - The final year to include (5-year window)

Returns:

year: 4-digit year
total_withdraw_amount: Sum of withdrawals for that card by year

Business Logic:

  • Covers 5-year period (current_year-4 to current_year)
  • Filters by specific card number
  • Only includes active withdrawals
  • Groups by calendar year
  • Orders chronologically
  • Useful for customer spending habit analysis

func (*Queries) RemoveRoleFromUser

func (q *Queries) RemoveRoleFromUser(ctx context.Context, arg RemoveRoleFromUserParams) error

RemoveRoleFromUser: Permanently removes a role from a user Purpose: Hard delete of a user-role mapping (bypasses trash) Parameters:

$1: User ID
$2: Role ID

Business Logic:

  • Deletes the record instead of soft-deleting
  • Use cautiously if audit/history is important

func (*Queries) RestoreAllCards

func (q *Queries) RestoreAllCards(ctx context.Context) error

RestoreAllCards: Restores all trashed cards Purpose: Bulk-restore all soft-deleted cards Parameters: None Returns: Nothing Business Logic:

  • Sets deleted_at to NULL for all trashed cards

func (*Queries) RestoreAllMerchantDocuments

func (q *Queries) RestoreAllMerchantDocuments(ctx context.Context) error

func (*Queries) RestoreAllMerchants

func (q *Queries) RestoreAllMerchants(ctx context.Context) error

Restore All Trashed Merchants Purpose: Restore all merchants that are soft deleted Business Logic:

  • Resets the `deleted_at` field to NULL for all merchants that have been marked as deleted.
  • Restores all merchants to an active state.

func (*Queries) RestoreAllRoles

func (q *Queries) RestoreAllRoles(ctx context.Context) error

RestoreAllRoles: Restores all soft-deleted roles in bulk Purpose: Bulk recovery of all trashed roles Parameters: None

func (*Queries) RestoreAllSaldos

func (q *Queries) RestoreAllSaldos(ctx context.Context) error

RestoreAllSaldos: Recovers all trashed saldo records Purpose: Mass restoration of deleted saldos Business Logic:

  • Clears deleted_at for all trashed records
  • Useful for system recovery scenarios

func (*Queries) RestoreAllTopups

func (q *Queries) RestoreAllTopups(ctx context.Context) error

RestoreAllTopups: Restores all soft-deleted topups in bulk Purpose: Batch recovery of trashed topup data Business Logic:

  • Sets deleted_at to NULL for all where it was not null

func (*Queries) RestoreAllTransactions

func (q *Queries) RestoreAllTransactions(ctx context.Context) error

RestoreAllTransactions: Recovers all trashed transactions Purpose: Mass restoration of deleted transactions Business Logic:

  • Clears deleted_at for all trashed records
  • Useful for system recovery scenarios
  • Should be used cautiously in production

func (*Queries) RestoreAllTransfers

func (q *Queries) RestoreAllTransfers(ctx context.Context) error

RestoreAllTransfers: Recovers all trashed transfers Purpose: Mass restoration of deleted transfers Business Logic:

  • Clears deleted_at for all trashed transfers
  • Useful for system recovery
  • Use with caution in production

func (*Queries) RestoreAllUsers

func (q *Queries) RestoreAllUsers(ctx context.Context) error

RestoreAllUsers: Restore all trashed users Purpose: Restore all soft-deleted users by clearing their `deleted_at` field. Business Logic:

  • Clears the `deleted_at` field for all trashed users, effectively restoring them.

func (*Queries) RestoreAllWithdraws

func (q *Queries) RestoreAllWithdraws(ctx context.Context) error

RestoreAllWithdraws: Recovers all trashed withdrawals Purpose: Mass restoration of deleted withdrawals Business Logic:

  • Clears deleted_at for all trashed withdrawals
  • Useful for system recovery scenarios
  • Should be used cautiously in production
  • Admin-level operation

func (*Queries) RestoreCard

func (q *Queries) RestoreCard(ctx context.Context, cardID int32) (*Card, error)

RestoreCard: Restores a previously trashed card Purpose: Undo soft-delete of a card Parameters:

$1: card_id - Identifier of the card to restore

Returns: Nothing Business Logic:

  • Sets deleted_at to NULL
  • Only affects cards that are currently trashed

func (*Queries) RestoreMerchant

func (q *Queries) RestoreMerchant(ctx context.Context, merchantID int32) (*Merchant, error)

Restore Trashed Merchant Purpose: Restore a previously trashed (soft deleted) merchant Parameters:

$1: merchant_id - ID of the merchant to restore

Business Logic:

  • Resets the `deleted_at` field to NULL, restoring the merchant to an active state.
  • Ensures the merchant is currently trashed (deleted_at is not NULL).

func (*Queries) RestoreMerchantDocument

func (q *Queries) RestoreMerchantDocument(ctx context.Context, documentID int32) (*MerchantDocument, error)

func (*Queries) RestoreRole

func (q *Queries) RestoreRole(ctx context.Context, roleID int32) (*Role, error)

RestoreRole: Restores a previously trashed role Purpose: Undelete a soft-deleted role Parameters:

$1: Role ID

func (*Queries) RestoreSaldo

func (q *Queries) RestoreSaldo(ctx context.Context, saldoID int32) (*Saldo, error)

RestoreSaldo: Recovers a soft-deleted saldo Purpose: Reactivate a previously trashed saldo record Parameters:

$1: saldo_id - The ID of the saldo to restore

Business Logic:

  • Clears the deleted_at timestamp
  • Only works on currently trashed records

func (*Queries) RestoreTopup

func (q *Queries) RestoreTopup(ctx context.Context, topupID int32) (*Topup, error)

RestoreTopup: Restores a soft-deleted topup by nullifying deleted_at Purpose: Reactivate a previously trashed topup Parameters:

$1: topup_id - ID of the topup to restore

Business Logic:

  • Only applies to records where deleted_at IS NOT NULL

func (*Queries) RestoreTransaction

func (q *Queries) RestoreTransaction(ctx context.Context, transactionID int32) (*Transaction, error)

RestoreTransaction: Recovers a soft-deleted transaction Purpose: Reactivate a previously trashed transaction Parameters:

$1: transaction_id - ID of transaction to restore

Business Logic:

  • Clears the deleted_at timestamp
  • Only works on currently trashed records
  • Used for data recovery purposes

func (*Queries) RestoreTransfer

func (q *Queries) RestoreTransfer(ctx context.Context, transferID int32) (*Transfer, error)

RestoreTransfer: Recovers a soft-deleted transfer Purpose: Reactivate a previously deleted transfer Parameters:

$1: transfer_id - ID of transfer to restore

Business Logic:

  • Clears deleted_at timestamp
  • Only works on trashed transfers

func (*Queries) RestoreUser

func (q *Queries) RestoreUser(ctx context.Context, userID int32) (*User, error)

RestoreUser: Recovers a soft-deleted user Purpose: Reactivate a previously deactivated user Parameters:

$1: user_id - ID of user to restore

Returns: The restored user record Business Logic:

  • Nullifies the deleted_at field
  • Only works on previously deleted users
  • Restores full account access
  • Maintains all original user data

func (*Queries) RestoreUserRole

func (q *Queries) RestoreUserRole(ctx context.Context, userRoleID int32) error

RestoreUserRole: Restores a trashed user-role relation Purpose: Reactivate a previously soft-deleted user-role Parameters:

$1: user_role_id

Business Logic:

  • Clears the deleted_at field to mark as active again

func (*Queries) RestoreWithdraw

func (q *Queries) RestoreWithdraw(ctx context.Context, withdrawID int32) (*Withdraw, error)

RestoreWithdraw: Recovers a soft-deleted withdrawal Purpose: Reactivate a previously deleted withdrawal Parameters:

$1: withdraw_id - ID of withdrawal to restore

Business Logic:

  • Clears the deleted_at timestamp (sets to NULL)
  • Only works on currently trashed withdrawals
  • Used for data recovery purposes

func (*Queries) SearchUsersByEmail

func (q *Queries) SearchUsersByEmail(ctx context.Context, dollar_1 sql.NullString) ([]*User, error)

SearchUsersByEmail: Search users by email with case-insensitive matching Purpose: Allows searching for users whose email matches a given search term (case-insensitive). Parameters:

$1: email_search_term - A partial or full email address to search for.

Returns:

  • List of users whose emails match the search term.
  • The results are ordered by the `created_at` column in descending order.

Business Logic:

  • Uses `ILIKE` to perform a case-insensitive search on the `email` column.
  • Only returns active users (`deleted_at IS NULL`).

func (*Queries) TrashCard

func (q *Queries) TrashCard(ctx context.Context, cardID int32) (*Card, error)

TrashCard: Soft-deletes a card by marking deleted_at Purpose: Temporarily remove a card without deleting it permanently Parameters:

$1: card_id - Identifier of the card to be trashed

Returns: Nothing Business Logic:

  • Sets deleted_at to current timestamp
  • Only affects cards not already trashed

func (*Queries) TrashMerchant

func (q *Queries) TrashMerchant(ctx context.Context, merchantID int32) (*Merchant, error)

Trash Merchant Purpose: Mark a merchant as deleted (soft delete) Parameters:

$1: merchant_id - ID of the merchant to be trashed

Business Logic:

  • Sets the `deleted_at` timestamp to the current time for the specified merchant.
  • Marks the merchant as deleted, without permanently removing it from the database.
  • Ensures the merchant is not already marked as deleted (deleted_at is NULL).

func (*Queries) TrashMerchantDocument

func (q *Queries) TrashMerchantDocument(ctx context.Context, documentID int32) (*MerchantDocument, error)

func (*Queries) TrashRole

func (q *Queries) TrashRole(ctx context.Context, roleID int32) (*Role, error)

TrashRole: Soft-deletes a role (moves to trash) Purpose: Mark role as deleted without removing it permanently Parameters:

$1: Role ID

func (*Queries) TrashSaldo

func (q *Queries) TrashSaldo(ctx context.Context, saldoID int32) (*Saldo, error)

TrashSaldo: Soft-deletes a saldo record Purpose: Remove a saldo from active use without permanent deletion Parameters:

$1: saldo_id - The ID of the saldo to trash

Business Logic:

  • Sets deleted_at timestamp
  • Only affects currently active records
  • Preserves data for possible recovery

func (*Queries) TrashTopup

func (q *Queries) TrashTopup(ctx context.Context, topupID int32) (*Topup, error)

TrashTopup: Soft deletes a topup by setting deleted_at Purpose: Moves topup to trash without losing data Parameters:

$1: topup_id - ID of the topup to soft-delete

Business Logic:

  • Only active (non-deleted) records can be trashed
  • Allows restore in future

func (*Queries) TrashTransaction

func (q *Queries) TrashTransaction(ctx context.Context, transactionID int32) (*Transaction, error)

TrashTransaction: Soft-deletes a transaction record Purpose: Remove transaction from active use without permanent deletion Parameters:

$1: transaction_id - ID of transaction to trash

Business Logic:

  • Sets deleted_at timestamp
  • Preserves data for audit/recovery purposes
  • Only affects currently active records

func (*Queries) TrashTransfer

func (q *Queries) TrashTransfer(ctx context.Context, transferID int32) (*Transfer, error)

TrashTransfer: Soft-deletes a transfer Purpose: Remove transfer from active view without permanent deletion Parameters:

$1: transfer_id - ID of transfer to trash

Business Logic:

  • Sets deleted_at timestamp
  • Only affects active transfers
  • Preserves data for audit/recovery

func (*Queries) TrashUser

func (q *Queries) TrashUser(ctx context.Context, userID int32) (*User, error)

TrashUser: Soft-deletes a user account Purpose: Deactivate user without permanent deletion Parameters:

$1: user_id - ID of user to deactivate

Returns: The soft-deleted user record Business Logic:

  • Sets deleted_at timestamp to current time
  • Only processes currently active users
  • Preserves all user data for potential restoration
  • Prevents login while deleted

func (*Queries) TrashUserRole

func (q *Queries) TrashUserRole(ctx context.Context, userRoleID int32) error

TrashUserRole: Soft deletes a user-role mapping (moves to trash) Purpose: Temporarily disable a role assignment without permanent deletion Parameters:

$1: user_role_id (primary key of the mapping)

Business Logic:

  • Sets deleted_at timestamp, indicating the relation is inactive

func (*Queries) TrashWithdraw

func (q *Queries) TrashWithdraw(ctx context.Context, withdrawID int32) (*Withdraw, error)

TrashWithdraw: Soft-deletes a withdrawal record Purpose: Remove withdrawal from active view without permanent deletion Parameters:

$1: withdraw_id - ID of withdrawal to trash

Business Logic:

  • Sets deleted_at timestamp to current time
  • Only affects active withdrawals
  • Preserves data for audit/recovery purposes
  • Withdrawal remains in database but hidden

func (*Queries) UpdateCard

func (q *Queries) UpdateCard(ctx context.Context, arg UpdateCardParams) (*Card, error)

UpdateCard: Updates an existing card's details Purpose: Modify card attributes for a specific card Parameters:

$1: card_id - Identifier of the card to update
$2: card_type - New card type
$3: expire_date - New expiration date
$4: cvv - New CVV
$5: card_provider - New card provider

Returns: Nothing Business Logic:

  • Automatically updates updated_at timestamp
  • Only updates cards that are not soft-deleted

func (*Queries) UpdateMerchant

func (q *Queries) UpdateMerchant(ctx context.Context, arg UpdateMerchantParams) (*Merchant, error)

Update Merchant Purpose: Update an existing merchant record Parameters:

$1: merchant_id - ID of the merchant to be updated
$2: name - The new name for the merchant
$3: user_id - New user ID associated with the merchant
$4: status - New status for the merchant

Business Logic:

  • Updates the specified merchant's name, user_id, and status.
  • Ensures the merchant is not marked as deleted (deleted_at is NULL).
  • Sets the updated_at timestamp to the current time.

func (*Queries) UpdateMerchantDocument

func (q *Queries) UpdateMerchantDocument(ctx context.Context, arg UpdateMerchantDocumentParams) (*MerchantDocument, error)

func (*Queries) UpdateMerchantDocumentStatus

func (q *Queries) UpdateMerchantDocumentStatus(ctx context.Context, arg UpdateMerchantDocumentStatusParams) (*MerchantDocument, error)

func (*Queries) UpdateMerchantStatus

func (q *Queries) UpdateMerchantStatus(ctx context.Context, arg UpdateMerchantStatusParams) (*Merchant, error)

Purpose: Update only the status of an existing merchant Parameters:

$1: merchant_id - ID of the merchant to update
$2: status - New status to set for the merchant

Business Logic:

  • Updates the status of the specified merchant.
  • Ensures the merchant is not marked as deleted (deleted_at is NULL).
  • Sets the updated_at timestamp to the current time.

func (*Queries) UpdateRefreshTokenByUserId

func (q *Queries) UpdateRefreshTokenByUserId(ctx context.Context, arg UpdateRefreshTokenByUserIdParams) (*RefreshToken, error)

UpdateRefreshTokenByUserId: Updates refresh token for a user Purpose: Rotate/refresh token for a user Parameters:

$1: user_id - ID of the user to update token for
$2: token - New token string
$3: expiration - New expiration timestamp

Business Logic:

  • Updates token and expiration fields
  • Sets updated_at to current time
  • Only modifies active tokens
  • Used during token rotation flows

func (*Queries) UpdateRole

func (q *Queries) UpdateRole(ctx context.Context, arg UpdateRoleParams) (*Role, error)

UpdateRole: Updates role name by ID Purpose: Modify role information (e.g., name correction) Parameters:

$1: Role ID
$2: New role name

Returns:

Updated role's data

func (*Queries) UpdateSaldo

func (q *Queries) UpdateSaldo(ctx context.Context, arg UpdateSaldoParams) (*Saldo, error)

UpdateSaldo: Modifies saldo record details Purpose: Update card number and balance for an existing saldo Parameters:

$1: saldo_id - The ID of the saldo to update
$2: card_number - New card number to associate
$3: total_balance - New balance amount

Business Logic:

  • Only updates active records (deleted_at IS NULL)
  • Automatically updates the modification timestamp
  • Useful for administrative corrections

func (*Queries) UpdateSaldoBalance

func (q *Queries) UpdateSaldoBalance(ctx context.Context, arg UpdateSaldoBalanceParams) (*Saldo, error)

UpdateSaldoBalance: Updates only the balance amount for a card Purpose: Adjust card balance without changing card association Parameters:

$1: card_number - The card number to update
$2: total_balance - New balance amount

Business Logic:

  • Card-specific update (uses card_number instead of saldo_id)
  • Only updates active records
  • Useful for balance adjustments and corrections

func (*Queries) UpdateSaldoWithdraw

func (q *Queries) UpdateSaldoWithdraw(ctx context.Context, arg UpdateSaldoWithdrawParams) (*Saldo, error)

UpdateSaldoWithdraw: Processes a withdrawal transaction Purpose: Record a withdrawal and update the remaining balance Parameters:

$1: card_number - The card used for withdrawal
$2: withdraw_amount - The amount being withdrawn
$3: withdraw_time - Timestamp of the withdrawal

Business Logic:

  • Only processes if sufficient balance exists (total_balance >= $2)
  • Updates both withdrawal amount and remaining balance
  • Records withdrawal timestamp
  • Only affects active records

func (*Queries) UpdateTopup

func (q *Queries) UpdateTopup(ctx context.Context, arg UpdateTopupParams) (*Topup, error)

UpdateTopup: Updates an existing topup transaction Purpose: Modify existing topup information by ID Parameters:

$1: topup_id - ID of the topup to update
$2: card_number - Updated card number
$3: topup_amount - Updated amount
$4: topup_method - Updated payment method
$5: topup_time - Updated transaction time

Business Logic:

  • Skips soft-deleted records (deleted_at IS NULL)
  • Updates updated_at automatically

func (*Queries) UpdateTopupAmount

func (q *Queries) UpdateTopupAmount(ctx context.Context, arg UpdateTopupAmountParams) (*Topup, error)

UpdateTopupAmount: Updates only the topup_amount field for a specific topup Purpose: Allow adjustment of topup amount without affecting other fields Parameters:

$1: topup_id - ID of the target topup
$2: new topup amount

Business Logic:

  • Ignores deleted entries
  • Automatically updates the updated_at timestamp

func (*Queries) UpdateTopupStatus

func (q *Queries) UpdateTopupStatus(ctx context.Context, arg UpdateTopupStatusParams) (*Topup, error)

UpdateTopupStatus: Updates the status of a specific topup Purpose: Mark topup as 'success', 'failed', etc. Parameters:

$1: topup_id - ID of the topup
$2: new status value (e.g., 'success', 'failed')

Business Logic:

  • Applies only to active (non-deleted) records
  • updated_at is refreshed

func (*Queries) UpdateTransaction

func (q *Queries) UpdateTransaction(ctx context.Context, arg UpdateTransactionParams) (*Transaction, error)

UpdateTransaction: Modifies an existing transaction's details Purpose: Update transaction information Parameters:

$1: transaction_id - ID of transaction to update
$2: card_number - Updated card number
$3: amount - Updated transaction amount
$4: payment_method - Updated payment method
$5: merchant_id - Updated merchant ID
$6: transaction_time - Updated transaction timestamp

Business Logic:

  • Only updates active transactions (non-deleted)
  • Automatically updates the modification timestamp
  • Used for correcting transaction details

func (*Queries) UpdateTransactionStatus

func (q *Queries) UpdateTransactionStatus(ctx context.Context, arg UpdateTransactionStatusParams) (*Transaction, error)

UpdateTransactionStatus: Changes a transaction's status Purpose: Update transaction processing status Parameters:

$1: transaction_id - ID of transaction to update
$2: status - New status (e.g., 'success', 'failed', 'pending')

Business Logic:

  • Only updates active transactions
  • Used to reflect transaction processing outcomes
  • Important for reconciliation and reporting

func (*Queries) UpdateTransfer

func (q *Queries) UpdateTransfer(ctx context.Context, arg UpdateTransferParams) (*Transfer, error)

UpdateTransfer: Modifies transfer details Purpose: Update all fields of an existing transfer Parameters:

$1: transfer_id - ID of transfer to update
$2: transfer_from - Updated source account
$3: transfer_to - Updated destination account
$4: transfer_amount - Updated amount
$5: transfer_time - Updated timestamp

Business Logic:

  • Only updates active transfers (non-deleted)
  • Updates modification timestamp automatically
  • Used for correcting transfer details

func (*Queries) UpdateTransferAmount

func (q *Queries) UpdateTransferAmount(ctx context.Context, arg UpdateTransferAmountParams) (*Transfer, error)

UpdateTransferAmount: Changes only the transfer amount Purpose: Adjust the amount of a transfer Parameters:

$1: transfer_id - ID of transfer to update
$2: transfer_amount - New transfer amount

Business Logic:

  • Only updates active transfers
  • Updates both amount and transfer timestamp
  • Used for amount corrections

func (*Queries) UpdateTransferStatus

func (q *Queries) UpdateTransferStatus(ctx context.Context, arg UpdateTransferStatusParams) (*Transfer, error)

UpdateTransferStatus: Changes transfer status Purpose: Update processing status of a transfer Parameters:

$1: transfer_id - ID of transfer to update
$2: status - New status (e.g., 'completed', 'failed')

Business Logic:

  • Only updates active transfers
  • Updates modification timestamp
  • Used to reflect transfer processing outcomes

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (*User, error)

UpdateUser: Modifies user account information Purpose: Update user profile details Parameters:

$1: user_id - ID of user to update
$2: firstname - Updated first name
$3: lastname - Updated last name
$4: email - Updated email address
$5: password - New hashed password (optional)

Returns: Updated user record Business Logic:

  • Auto-updates updated_at timestamp
  • Only modifies active (non-deleted) users
  • Validates email uniqueness
  • Password field optional (can maintain existing)

func (*Queries) UpdateUserIsVerified

func (q *Queries) UpdateUserIsVerified(ctx context.Context, arg UpdateUserIsVerifiedParams) (*User, error)

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (*User, error)

func (*Queries) UpdateWithdraw

func (q *Queries) UpdateWithdraw(ctx context.Context, arg UpdateWithdrawParams) (*Withdraw, error)

UpdateWithdraw: Modifies withdrawal details Purpose: Update withdrawal information Parameters:

$1: withdraw_id - ID of withdrawal to update
$2: card_number - Updated card number
$3: withdraw_amount - Updated withdrawal amount
$4: withdraw_time - Updated withdrawal timestamp

Business Logic:

  • Only updates active withdrawals (non-deleted)
  • Updates modification timestamp automatically
  • Used for correcting withdrawal records
  • Requires original withdrawal record exists

func (*Queries) UpdateWithdrawStatus

func (q *Queries) UpdateWithdrawStatus(ctx context.Context, arg UpdateWithdrawStatusParams) (*Withdraw, error)

UpdateWithdrawStatus: Changes withdrawal status Purpose: Update processing status of a withdrawal Parameters:

$1: withdraw_id - ID of withdrawal to update
$2: status - New status (e.g., 'completed', 'failed', 'pending')

Business Logic:

  • Only updates active withdrawals
  • Updates modification timestamp
  • Used to reflect withdrawal processing outcomes
  • Important for reconciliation purposes

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type RefreshToken

type RefreshToken struct {
	RefreshTokenID int32        `json:"refresh_token_id"`
	UserID         int32        `json:"user_id"`
	Token          string       `json:"token"`
	Expiration     time.Time    `json:"expiration"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
}

type RemoveRoleFromUserParams

type RemoveRoleFromUserParams struct {
	UserID int32 `json:"user_id"`
	RoleID int32 `json:"role_id"`
}

type ResetToken

type ResetToken struct {
	ID         int32     `json:"id"`
	UserID     int64     `json:"user_id"`
	Token      string    `json:"token"`
	ExpiryDate time.Time `json:"expiry_date"`
}

type Role

type Role struct {
	RoleID    int32        `json:"role_id"`
	RoleName  string       `json:"role_name"`
	CreatedAt sql.NullTime `json:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at"`
	DeletedAt sql.NullTime `json:"deleted_at"`
}

type Saldo

type Saldo struct {
	SaldoID        int32         `json:"saldo_id"`
	CardNumber     string        `json:"card_number"`
	TotalBalance   int32         `json:"total_balance"`
	WithdrawAmount sql.NullInt32 `json:"withdraw_amount"`
	WithdrawTime   sql.NullTime  `json:"withdraw_time"`
	CreatedAt      sql.NullTime  `json:"created_at"`
	UpdatedAt      sql.NullTime  `json:"updated_at"`
	DeletedAt      sql.NullTime  `json:"deleted_at"`
}

type Topup

type Topup struct {
	TopupID     int32        `json:"topup_id"`
	TopupNo     uuid.UUID    `json:"topup_no"`
	CardNumber  string       `json:"card_number"`
	TopupAmount int32        `json:"topup_amount"`
	TopupMethod string       `json:"topup_method"`
	TopupTime   time.Time    `json:"topup_time"`
	Status      string       `json:"status"`
	CreatedAt   sql.NullTime `json:"created_at"`
	UpdatedAt   sql.NullTime `json:"updated_at"`
	DeletedAt   sql.NullTime `json:"deleted_at"`
}

type Transaction

type Transaction struct {
	TransactionID   int32        `json:"transaction_id"`
	TransactionNo   uuid.UUID    `json:"transaction_no"`
	CardNumber      string       `json:"card_number"`
	Amount          int32        `json:"amount"`
	PaymentMethod   string       `json:"payment_method"`
	MerchantID      int32        `json:"merchant_id"`
	TransactionTime time.Time    `json:"transaction_time"`
	Status          string       `json:"status"`
	CreatedAt       sql.NullTime `json:"created_at"`
	UpdatedAt       sql.NullTime `json:"updated_at"`
	DeletedAt       sql.NullTime `json:"deleted_at"`
}

type Transfer

type Transfer struct {
	TransferID     int32        `json:"transfer_id"`
	TransferNo     uuid.UUID    `json:"transfer_no"`
	TransferFrom   string       `json:"transfer_from"`
	TransferTo     string       `json:"transfer_to"`
	TransferAmount int32        `json:"transfer_amount"`
	TransferTime   time.Time    `json:"transfer_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
}

type UpdateCardParams

type UpdateCardParams struct {
	CardID       int32     `json:"card_id"`
	CardType     string    `json:"card_type"`
	ExpireDate   time.Time `json:"expire_date"`
	Cvv          string    `json:"cvv"`
	CardProvider string    `json:"card_provider"`
}

type UpdateMerchantDocumentParams

type UpdateMerchantDocumentParams struct {
	DocumentID   int32          `json:"document_id"`
	DocumentType string         `json:"document_type"`
	DocumentUrl  string         `json:"document_url"`
	Status       string         `json:"status"`
	Note         sql.NullString `json:"note"`
}

type UpdateMerchantDocumentStatusParams

type UpdateMerchantDocumentStatusParams struct {
	DocumentID int32          `json:"document_id"`
	Status     string         `json:"status"`
	Note       sql.NullString `json:"note"`
}

type UpdateMerchantParams

type UpdateMerchantParams struct {
	MerchantID int32  `json:"merchant_id"`
	Name       string `json:"name"`
	UserID     int32  `json:"user_id"`
	Status     string `json:"status"`
}

type UpdateMerchantStatusParams

type UpdateMerchantStatusParams struct {
	MerchantID int32  `json:"merchant_id"`
	Status     string `json:"status"`
}

type UpdateRefreshTokenByUserIdParams

type UpdateRefreshTokenByUserIdParams struct {
	UserID     int32     `json:"user_id"`
	Token      string    `json:"token"`
	Expiration time.Time `json:"expiration"`
}

type UpdateRoleParams

type UpdateRoleParams struct {
	RoleID   int32  `json:"role_id"`
	RoleName string `json:"role_name"`
}

type UpdateSaldoBalanceParams

type UpdateSaldoBalanceParams struct {
	CardNumber   string `json:"card_number"`
	TotalBalance int32  `json:"total_balance"`
}

type UpdateSaldoParams

type UpdateSaldoParams struct {
	SaldoID      int32  `json:"saldo_id"`
	CardNumber   string `json:"card_number"`
	TotalBalance int32  `json:"total_balance"`
}

type UpdateSaldoWithdrawParams

type UpdateSaldoWithdrawParams struct {
	CardNumber     string        `json:"card_number"`
	WithdrawAmount sql.NullInt32 `json:"withdraw_amount"`
	WithdrawTime   sql.NullTime  `json:"withdraw_time"`
}

type UpdateTopupAmountParams

type UpdateTopupAmountParams struct {
	TopupID     int32 `json:"topup_id"`
	TopupAmount int32 `json:"topup_amount"`
}

type UpdateTopupParams

type UpdateTopupParams struct {
	TopupID     int32     `json:"topup_id"`
	CardNumber  string    `json:"card_number"`
	TopupAmount int32     `json:"topup_amount"`
	TopupMethod string    `json:"topup_method"`
	TopupTime   time.Time `json:"topup_time"`
}

type UpdateTopupStatusParams

type UpdateTopupStatusParams struct {
	TopupID int32  `json:"topup_id"`
	Status  string `json:"status"`
}

type UpdateTransactionParams

type UpdateTransactionParams struct {
	TransactionID   int32     `json:"transaction_id"`
	CardNumber      string    `json:"card_number"`
	Amount          int32     `json:"amount"`
	PaymentMethod   string    `json:"payment_method"`
	MerchantID      int32     `json:"merchant_id"`
	TransactionTime time.Time `json:"transaction_time"`
}

type UpdateTransactionStatusParams

type UpdateTransactionStatusParams struct {
	TransactionID int32  `json:"transaction_id"`
	Status        string `json:"status"`
}

type UpdateTransferAmountParams

type UpdateTransferAmountParams struct {
	TransferID     int32 `json:"transfer_id"`
	TransferAmount int32 `json:"transfer_amount"`
}

type UpdateTransferParams

type UpdateTransferParams struct {
	TransferID     int32     `json:"transfer_id"`
	TransferFrom   string    `json:"transfer_from"`
	TransferTo     string    `json:"transfer_to"`
	TransferAmount int32     `json:"transfer_amount"`
	TransferTime   time.Time `json:"transfer_time"`
}

type UpdateTransferStatusParams

type UpdateTransferStatusParams struct {
	TransferID int32  `json:"transfer_id"`
	Status     string `json:"status"`
}

type UpdateUserIsVerifiedParams

type UpdateUserIsVerifiedParams struct {
	UserID     int32        `json:"user_id"`
	IsVerified sql.NullBool `json:"is_verified"`
}

type UpdateUserParams

type UpdateUserParams struct {
	UserID    int32  `json:"user_id"`
	Firstname string `json:"firstname"`
	Lastname  string `json:"lastname"`
	Email     string `json:"email"`
	Password  string `json:"password"`
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	UserID   int32  `json:"user_id"`
	Password string `json:"password"`
}

type UpdateWithdrawParams

type UpdateWithdrawParams struct {
	WithdrawID     int32     `json:"withdraw_id"`
	CardNumber     string    `json:"card_number"`
	WithdrawAmount int32     `json:"withdraw_amount"`
	WithdrawTime   time.Time `json:"withdraw_time"`
}

type UpdateWithdrawStatusParams

type UpdateWithdrawStatusParams struct {
	WithdrawID int32  `json:"withdraw_id"`
	Status     string `json:"status"`
}

type User

type User struct {
	UserID           int32        `json:"user_id"`
	Firstname        string       `json:"firstname"`
	Lastname         string       `json:"lastname"`
	Email            string       `json:"email"`
	Password         string       `json:"password"`
	VerificationCode string       `json:"verification_code"`
	IsVerified       sql.NullBool `json:"is_verified"`
	CreatedAt        sql.NullTime `json:"created_at"`
	UpdatedAt        sql.NullTime `json:"updated_at"`
	DeletedAt        sql.NullTime `json:"deleted_at"`
}

type UserRole

type UserRole struct {
	UserRoleID int32        `json:"user_role_id"`
	UserID     int32        `json:"user_id"`
	RoleID     int32        `json:"role_id"`
	CreatedAt  sql.NullTime `json:"created_at"`
	UpdatedAt  sql.NullTime `json:"updated_at"`
	DeletedAt  sql.NullTime `json:"deleted_at"`
}

type Withdraw

type Withdraw struct {
	WithdrawID     int32        `json:"withdraw_id"`
	WithdrawNo     uuid.UUID    `json:"withdraw_no"`
	CardNumber     string       `json:"card_number"`
	WithdrawAmount int32        `json:"withdraw_amount"`
	WithdrawTime   time.Time    `json:"withdraw_time"`
	Status         string       `json:"status"`
	CreatedAt      sql.NullTime `json:"created_at"`
	UpdatedAt      sql.NullTime `json:"updated_at"`
	DeletedAt      sql.NullTime `json:"deleted_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL