Documentation
¶
Index ¶
- type AuthRequest
- type CreateCardRequest
- type CreateMerchantDocumentRequest
- type CreateMerchantRequest
- type CreateRefreshToken
- type CreateResetPasswordRequest
- type CreateResetTokenRequest
- type CreateRoleRequest
- type CreateSaldoRequest
- type CreateTopupRequest
- type CreateTransactionRequest
- type CreateTransferRequest
- type CreateUserRequest
- type CreateUserRoleRequest
- type CreateWithdrawRequest
- type FindAllCards
- type FindAllMerchantDocuments
- type FindAllMerchantTransactions
- type FindAllMerchantTransactionsByApiKey
- type FindAllMerchantTransactionsById
- type FindAllMerchants
- type FindAllRoles
- type FindAllSaldos
- type FindAllTopups
- type FindAllTopupsByCardNumber
- type FindAllTransactionCardNumber
- type FindAllTransactions
- type FindAllTransfers
- type FindAllUsers
- type FindAllWithdrawCardNumber
- type FindAllWithdraws
- type ForgotPasswordRequest
- type JWTToken
- type MerchantRequestPayload
- type MonthStatusTransaction
- type MonthStatusTransactionCardNumber
- type MonthStatusTransfer
- type MonthStatusTransferCardNumber
- type MonthStatusWithdraw
- type MonthStatusWithdrawCardNumber
- type MonthTopupStatus
- type MonthTopupStatusCardNumber
- type MonthTotalSaldoBalance
- type MonthYearAmountApiKey
- type MonthYearAmountMerchant
- type MonthYearCardNumber
- type MonthYearCardNumberCard
- type MonthYearPaymentMethod
- type MonthYearPaymentMethodApiKey
- type MonthYearPaymentMethodMerchant
- type MonthYearTotalAmountApiKey
- type MonthYearTotalAmountMerchant
- type RefreshTokenRequest
- type RegisterRequest
- type RemoveUserRoleRequest
- type RoleRequestPayload
- type UpdateCardRequest
- type UpdateMerchantDocumentRequest
- type UpdateMerchantDocumentStatusRequest
- type UpdateMerchantRequest
- type UpdateMerchantStatusRequest
- type UpdateRefreshToken
- type UpdateRoleRequest
- type UpdateSaldoBalance
- type UpdateSaldoRequest
- type UpdateSaldoWithdraw
- type UpdateTopupAmount
- type UpdateTopupRequest
- type UpdateTopupStatus
- type UpdateTransactionRequest
- type UpdateTransactionStatus
- type UpdateTransferAmountRequest
- type UpdateTransferRequest
- type UpdateTransferStatus
- type UpdateUserRequest
- type UpdateWithdrawRequest
- type UpdateWithdrawStatus
- type YearMonthCardNumber
- type YearMonthMethod
- type YearStatusTransactionCardNumber
- type YearStatusTransferCardNumber
- type YearStatusWithdrawCardNumber
- type YearTopupStatusCardNumber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRequest ¶
type AuthRequest struct {
Email string `json:"email" validate:"required,email"` // User's email address (must be valid email format)
Password string `json:"password" validate:"required,min=6"` // User's password (minimum 6 characters)
}
AuthRequest represents the payload for user authentication (login). Used when a user attempts to log in to the system.
func (*AuthRequest) Validate ¶
func (r *AuthRequest) Validate() error
Validate validates the AuthRequest struct using the validator.v10 package.
Returns an error if any of the validation rules fail.
type CreateCardRequest ¶
type CreateCardRequest struct {
UserID int `json:"user_id"` // ID of the user who owns the card
CardType string `json:"card_type" validate:"required"` // Type of card ("credit" or "debit")
ExpireDate time.Time `json:"expire_date" validate:"required"` // Card expiration date
CVV string `json:"cvv" validate:"required"` // Card verification value (should be encrypted at rest)
CardProvider string `json:"card_provider" validate:"required"` // Issuing bank/provider (e.g., "VISA", "MasterCard")
}
CreateCardRequest represents the payload for creating a new payment card. Contains all necessary information to register a payment card in the system.
func (*CreateCardRequest) Validate ¶
func (r *CreateCardRequest) Validate() error
Validate performs validation of CreateCardRequest fields beyond basic struct validation. Ensures card type and provider are valid values. Returns:
- error: if validation fails, describing the specific validation error
type CreateMerchantDocumentRequest ¶
type CreateMerchantDocumentRequest struct {
MerchantID int `json:"merchant_id" validate:"required,min=1"` // ID of the merchant this document belongs to
DocumentType string `json:"document_type" validate:"required"` // Type of document (e.g., "license", "identity_proof")
DocumentUrl string `json:"document_url" validate:"required"` // URL or storage path where the document is saved
}
CreateMerchantDocumentRequest represents the payload for uploading a new merchant document. Contains all necessary information to register a document for a merchant.
func (*CreateMerchantDocumentRequest) Validate ¶
func (r *CreateMerchantDocumentRequest) Validate() error
Validate performs basic validation of CreateMerchantDocumentRequest fields using struct tags. Returns:
- error: if validation fails according to struct tag rules
type CreateMerchantRequest ¶
type CreateMerchantRequest struct {
Name string `json:"name" validate:"required"` // Legal name of the merchant
UserID int `json:"user_id" validate:"required,min=1"` // ID of the user creating the merchant
}
CreateMerchantRequest represents the payload for registering a new merchant. Used in merchant onboarding processes.
func (CreateMerchantRequest) Validate ¶
func (r CreateMerchantRequest) Validate() error
Validate performs validation of CreateMerchantRequest fields. Ensures all required fields are present and valid. Returns:
- error: if validation fails
type CreateRefreshToken ¶
type CreateRefreshToken struct {
UserId int `json:"user_id" validate:"required,min=1"` // ID of the user the token belongs to
Token string `json:"token" validate:"required,min=1"` // The actual refresh token value (should be hashed)
ExpiresAt string `json:"expires_at" validate:"required,min=1"` // Expiration timestamp (RFC3339 format recommended)
}
CreateRefreshToken represents the payload for generating a new refresh token. Used when creating persistent authentication tokens for users.
func (*CreateRefreshToken) Validate ¶
func (r *CreateRefreshToken) Validate() error
Validate performs structural validation of CreateRefreshToken fields. Checks that all required fields meet minimum requirements. Returns:
- error: if validation fails according to struct tag rules
type CreateResetPasswordRequest ¶
type CreateResetPasswordRequest struct {
ResetToken string `json:"reset_token" validate:"required"` // The reset token provided to the user
Password string `json:"password" validate:"required,min=6"` // New password (minimum 6 characters)
ConfirmPassword string `json:"confirm_password" validate:"required,min=6"` // Password confirmation (must match new password)
}
CreateResetPasswordRequest represents the payload for actually resetting a user's password. Used when submitting a new password during the reset flow.
func (*CreateResetPasswordRequest) Validate ¶
func (r *CreateResetPasswordRequest) Validate() error
Validate performs validation of CreateResetPasswordRequest fields. Ensures the reset token is present and passwords meet complexity requirements. Returns:
- error: if validation fails, describing the validation failure
type CreateResetTokenRequest ¶
type CreateResetTokenRequest struct {
UserID int `json:"user_id" validate:"required"` // ID of the user requesting password reset
ResetToken string `json:"reset_token" validate:"required"` // The generated reset token (should be hashed before storage)
ExpiredAt string `json:"expired_at" validate:"required"` // Expiration time of the token (RFC3339 format recommended)
}
CreateResetTokenRequest represents the payload for generating a password reset token. Used when initiating a password reset process for a user.
type CreateRoleRequest ¶
type CreateRoleRequest struct {
Name string `json:"name" validate:"required"` // Name of the new role (e.g., "admin", "user")
}
CreateRoleRequest represents the payload for creating a new role. Used when defining new access control roles in the system.
func (*CreateRoleRequest) Validate ¶
func (r *CreateRoleRequest) Validate() error
Validate performs validation of CreateRoleRequest fields. Ensures the role name is provided and meets requirements. Returns:
- error: if validation fails, describing the validation failure
type CreateSaldoRequest ¶
type CreateSaldoRequest struct {
CardNumber string `json:"card_number" validate:"required"` // Card number associated with the balance
TotalBalance int `json:"total_balance" validate:"required"` // Initial balance amount (in smallest currency unit)
}
CreateSaldoRequest represents the payload for initializing a new saldo record. Used when creating a new balance entry for a card.
func (*CreateSaldoRequest) Validate ¶
func (r *CreateSaldoRequest) Validate() error
Validate performs basic validation of CreateSaldoRequest fields. Ensures required fields are present and properly formatted. Returns:
- error: if validation fails
type CreateTopupRequest ¶
type CreateTopupRequest struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number receiving funds
TopupAmount int `json:"topup_amount" validate:"required,min=50000"` // Amount to add (minimum 50,000 in smallest unit)
TopupMethod string `json:"topup_method" validate:"required"` // Payment method used (e.g., "bank_transfer")
}
CreateTopupRequest represents the payload for creating a new top-up transaction. Used when adding funds to a card/account.
func (*CreateTopupRequest) Validate ¶
func (r *CreateTopupRequest) Validate() error
Validate performs comprehensive validation of CreateTopupRequest fields. Ensures: - Minimum top-up amount (50,000) - Valid payment method - Required fields are present Returns:
- error: if validation fails with specific validation messages
type CreateTransactionRequest ¶
type CreateTransactionRequest struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number used in transaction
Amount int `json:"amount" validate:"required,min=50000"` // Transaction amount (minimum 50,000 in smallest unit)
PaymentMethod string `json:"payment_method" validate:"required"` // Payment method used (e.g., "credit", "debit")
MerchantID *int `json:"merchant_id" validate:"required,min=1"` // ID of merchant receiving payment
TransactionTime time.Time `json:"transaction_time" validate:"required"` // Timestamp of transaction
}
CreateTransactionRequest represents the payload for creating a new transaction. Used when recording payment transactions.
func (*CreateTransactionRequest) Validate ¶
func (r *CreateTransactionRequest) Validate() error
Validate performs comprehensive validation of CreateTransactionRequest fields. Ensures: - Valid payment method - Minimum transaction amount (50,000) - Required fields are present Returns:
- error: if validation fails with specific validation messages
type CreateTransferRequest ¶
type CreateTransferRequest struct {
TransferFrom string `json:"transfer_from" validate:"required"` // Source account/card number
TransferTo string `json:"transfer_to" validate:"required,min=1"` // Destination account/card number (minimum 1 character)
TransferAmount int `json:"transfer_amount" validate:"required,min=50000"` // Amount to transfer (minimum 50,000 in smallest unit)
}
CreateTransferRequest represents the payload for initiating a new transfer. Used when moving funds between accounts/cards.
func (*CreateTransferRequest) Validate ¶
func (r *CreateTransferRequest) Validate() error
Validate performs comprehensive validation of CreateTransferRequest fields. Ensures: - Minimum transfer amount (50,000) - Valid account/card numbers - Required fields are present Returns:
- error: if validation fails with specific validation messages
type CreateUserRequest ¶
type CreateUserRequest struct {
FirstName string `json:"firstname" validate:"required,alpha"` // User's first name (alphabetic characters only)
LastName string `json:"lastname" validate:"required,alpha"` // User's last name (alphabetic characters only)
Email string `json:"email" validate:"required,email"` // User's email address (must be valid format)
Password string `json:"password" validate:"required,min=6"` // Account password (minimum 6 characters)
ConfirmPassword string `json:"confirm_password" validate:"required,eqfield=Password"` // Password confirmation (must match Password field)
}
CreateUserRequest represents the payload for registering a new user. Contains all required information for user account creation.
func (*CreateUserRequest) Validate ¶
func (r *CreateUserRequest) Validate() error
Validate performs structural validation of CreateUserRequest fields. Ensures all required fields are present and meet format requirements. Returns:
- error: if validation fails according to struct tag rules
type CreateUserRoleRequest ¶
type CreateUserRoleRequest struct {
UserId int `json:"user_id" validate:"required"` // ID of the user to receive the role
RoleId int `json:"role_id" validate:"required"` // ID of the role to be assigned
}
CreateUserRoleRequest represents the payload for assigning a role to a user. Used when granting specific permissions or access levels to users.
type CreateWithdrawRequest ¶
type CreateWithdrawRequest struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card/account number for withdrawal
WithdrawAmount int `json:"withdraw_amount" validate:"required,min=50000"` // Amount to withdraw (minimum 50,000 in smallest unit)
WithdrawTime time.Time `json:"withdraw_time" validate:"required"` // Timestamp of withdrawal
}
CreateWithdrawRequest represents the payload for creating a new withdrawal. Used when processing cash withdrawals from cards/accounts.
func (*CreateWithdrawRequest) Validate ¶
func (r *CreateWithdrawRequest) Validate() error
Validate performs comprehensive validation of CreateWithdrawRequest fields. Ensures: - Minimum withdrawal amount (50,000) - Withdrawal time is not in the future - Required fields are present Returns:
- error: if validation fails with specific validation messages
type FindAllCards ¶
type FindAllCards struct {
Search string `json:"search" validate:"required"` // Search term to filter cards (matches against card number or provider)
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllCards represents the request parameters for searching and paginating card records. Used in card listing operations with search functionality.
type FindAllMerchantDocuments ¶
type FindAllMerchantDocuments struct {
Search string `json:"search" validate:"required"` // Search term to filter documents (matches against document type or status)
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllMerchantDocuments represents the request parameters for searching and paginating merchant documents. Used in document listing operations with search functionality.
type FindAllMerchantTransactions ¶
type FindAllMerchantTransactions struct {
Search string `json:"search" validate:"required"` // Search term to filter transactions
Page int `json:"page" validate:"min=1"` // Page number for pagination
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page
}
FindAllMerchantTransactions represents parameters for searching merchant transactions. Used in global transaction reporting.
type FindAllMerchantTransactionsByApiKey ¶
type FindAllMerchantTransactionsByApiKey struct {
ApiKey string `json:"api_key" validate:"required"` // Merchant's authentication API key
Search string `json:"search" validate:"required"` // Search term to filter transactions
Page int `json:"page" validate:"min=1"` // Page number for pagination
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page
}
FindAllMerchantTransactionsByApiKey represents parameters for searching transactions by API key. Used in merchant-facing transaction reporting.
type FindAllMerchantTransactionsById ¶
type FindAllMerchantTransactionsById struct {
MerchantID int `json:"merchant_id" validate:"required,min=1"` // Specific merchant to filter by
Search string `json:"search" validate:"required"` // Additional search filter
Page int `json:"page" validate:"min=1"` // Page number for pagination
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page
}
FindAllMerchantTransactionsById represents parameters for searching transactions by merchant ID. Used for merchant-specific transaction reporting.
type FindAllMerchants ¶
type FindAllMerchants struct {
Search string `json:"search" validate:"required"` // Search term to filter merchants
Page int `json:"page" validate:"min=1"` // Page number for pagination
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page
}
FindAllMerchants represents parameters for searching and paginating merchant records. Used in merchant administration interfaces.
type FindAllRoles ¶
type FindAllRoles struct {
Search string `json:"search" validate:"required"` // Search term to filter roles (matches against role name)
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllRoles represents parameters for searching and paginating role records. Used in role administration and listing operations.
type FindAllSaldos ¶
type FindAllSaldos struct {
Search string `json:"search" validate:"required"` // Search term to filter records (matches against card numbers)
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllSaldos represents parameters for searching and paginating saldo records. Used to retrieve and filter saldo/balance information with pagination support.
type FindAllTopups ¶
type FindAllTopups struct {
Search string `json:"search" validate:"required"` // Search term to filter records
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllTopups represents parameters for searching and paginating top-up records. Used in top-up administration and reporting interfaces.
type FindAllTopupsByCardNumber ¶
type FindAllTopupsByCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Specific card number to filter by
Search string `json:"search" validate:"required"` // Additional search filter
Page int `json:"page" validate:"min=1"` // Page number for pagination
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page
}
FindAllTopupsByCardNumber represents parameters for searching top-ups by card number. Used to retrieve top-up history for specific cards.
type FindAllTransactionCardNumber ¶
type FindAllTransactionCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Specific card number to filter by
Search string `json:"search" validate:"required"` // Additional search filter
Page int `json:"page" validate:"min=1"` // Page number for pagination
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page
}
FindAllTransactionCardNumber represents parameters for searching transactions by card number. Used to retrieve transaction history for specific cards.
type FindAllTransactions ¶
type FindAllTransactions struct {
Search string `json:"search" validate:"required"` // Search term to filter transactions
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllTransactions represents parameters for searching and paginating transaction records. Used in transaction administration interfaces.
type FindAllTransfers ¶
type FindAllTransfers struct {
Search string `json:"search" validate:"required"` // Search term to filter transfers
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllTransfers represents parameters for searching and paginating transfer records. Used in transfer administration interfaces.
type FindAllUsers ¶
type FindAllUsers struct {
Search string `json:"search" validate:"required"` // Search term to filter users (matches name or email)
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllUsers represents parameters for searching and paginating user records. Used in user administration interfaces to list and filter users.
type FindAllWithdrawCardNumber ¶
type FindAllWithdrawCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Specific card number to filter by
Search string `json:"search" validate:"required"` // Additional search filter
Page int `json:"page" validate:"min=1"` // Page number for pagination
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page
}
FindAllWithdrawCardNumber represents parameters for searching withdrawals by card number. Used to retrieve withdrawal history for specific cards.
type FindAllWithdraws ¶
type FindAllWithdraws struct {
Search string `json:"search" validate:"required"` // Search term to filter withdrawals
Page int `json:"page" validate:"min=1"` // Page number for pagination (1-based index)
PageSize int `json:"page_size" validate:"min=1,max=100"` // Number of items per page (1-100)
}
FindAllWithdraws represents parameters for searching and paginating withdrawal records. Used in withdrawal administration interfaces.
type ForgotPasswordRequest ¶
type ForgotPasswordRequest struct {
Email string `json:"email" validate:"required,email"` // Email address associated with the account
}
ForgotPasswordRequest represents the initial forgot password request payload. Used when a user initiates the password reset process via email.
func (*ForgotPasswordRequest) Validate ¶
func (r *ForgotPasswordRequest) Validate() error
Validate performs validation of ForgotPasswordRequest fields. Ensures the email field is present and properly formatted. Returns:
- error: if validation fails, describing the validation failure
type MerchantRequestPayload ¶
type MerchantRequestPayload struct {
ApiKey string `json:"api_key"` // Merchant's authentication API key
CorrelationID string `json:"correlation_id"` // Unique ID for request tracing
ReplyTopic string `json:"reply_topic"` // Topic name for asynchronous responses
}
MerchantRequestPayload represents the base payload structure for merchant API requests. Used as a foundation for authenticated merchant operations.
type MonthStatusTransaction ¶
type MonthStatusTransaction struct {
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
Month int `json:"month" validate:"required"` // Month for analysis (1-12)
}
MonthStatusTransaction represents parameters for retrieving transaction status by month. Used to get monthly transaction statistics.
type MonthStatusTransactionCardNumber ¶
type MonthStatusTransactionCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to analyze
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
Month int `json:"month" validate:"required"` // Month for analysis (1-12)
}
MonthStatusTransactionCardNumber represents parameters for retrieving card-specific monthly transaction status. Used to get monthly transaction statistics for specific cards.
type MonthStatusTransfer ¶
type MonthStatusTransfer struct {
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
Month int `json:"month" validate:"required"` // Month for analysis (1-12)
}
MonthStatusTransfer represents parameters for retrieving monthly transfer status. Used for general monthly transfer statistics.
type MonthStatusTransferCardNumber ¶
type MonthStatusTransferCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to analyze
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
Month int `json:"month" validate:"required"` // Month for analysis (1-12)
}
MonthStatusTransferCardNumber represents parameters for retrieving monthly transfer status by card. Used to get monthly transfer statistics for specific cards.
type MonthStatusWithdraw ¶
type MonthStatusWithdraw struct {
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
Month int `json:"month" validate:"required"` // Month for analysis (1-12)
}
MonthStatusWithdraw represents parameters for retrieving monthly withdrawal status. Used to get general monthly withdrawal statistics.
type MonthStatusWithdrawCardNumber ¶
type MonthStatusWithdrawCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to analyze
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
Month int `json:"month" validate:"required"` // Month for analysis (1-12)
}
MonthStatusWithdrawCardNumber represents parameters for retrieving card-specific monthly withdrawal status. Used to get monthly withdrawal statistics for specific cards.
type MonthTopupStatus ¶
type MonthTopupStatus struct {
Year int `json:"year" validate:"required"` // Year for the query (YYYY format)
Month int `json:"month" validate:"required"` // Month for the query (1-12)
}
MonthTopupStatus represents parameters for retrieving top-up status by month. Used to query top-up statistics for a specific month and year.
type MonthTopupStatusCardNumber ¶
type MonthTopupStatusCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to query
Year int `json:"year" validate:"required"` // Year for the query (YYYY format)
Month int `json:"month" validate:"required"` // Month for the query (1-12)
}
MonthTopupStatusCardNumber represents parameters for retrieving card-specific top-up status by month. Used to query monthly top-up statistics for a specific card.
type MonthTotalSaldoBalance ¶
type MonthTotalSaldoBalance struct {
Year int `json:"year" validate:"required"` // Year for the balance query (YYYY format)
Month int `json:"month" validate:"required"` // Month for the balance query (1-12)
}
MonthTotalSaldoBalance represents parameters for retrieving monthly balance summaries. Used to fetch aggregated balance information for specific month/year periods.
type MonthYearAmountApiKey ¶
type MonthYearAmountApiKey struct {
Apikey string `json:"api_key" validate:"required,min=1"` // Merchant's authentication API key
Year int `json:"year" validate:"required"` // Year for data aggregation (YYYY format)
}
MonthYearAmountApiKey represents a request for transaction amount statistics by API key and year. Used to retrieve financial summaries for a specific merchant.
type MonthYearAmountMerchant ¶
type MonthYearAmountMerchant struct {
MerchantID int `json:"merchant_id" validate:"required,min=1"` // Unique merchant identifier
Year int `json:"year" validate:"required"` // Year for data aggregation (YYYY format)
}
MonthYearAmountMerchant represents a request for transaction amount statistics by merchant ID and year. Used internally for financial reporting.
type MonthYearCardNumber ¶
type MonthYearCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to query (minimum 1 character)
Year int `json:"year" validate:"required"` // Year for the query (YYYY format)
}
MonthYearCardNumber represents parameters for operations requiring card number and year. Used for card-specific annual data retrieval operations.
type MonthYearCardNumberCard ¶
type MonthYearCardNumberCard struct {
CardNumber string `json:"card_number" validate:"required"` // Full or partial card number (should be masked in logs)
Year int `json:"year" validate:"required"` // Year component of expiration date (YYYY format)
}
MonthYearCardNumberCard represents a request structure for operations requiring card number and year information, typically used for card lookups or expiration checks.
type MonthYearPaymentMethod ¶
type MonthYearPaymentMethod struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to analyze
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
}
MonthYearPaymentMethod represents parameters for retrieving payment method statistics by card and year. Used to analyze payment method usage patterns for specific cards.
type MonthYearPaymentMethodApiKey ¶
type MonthYearPaymentMethodApiKey struct {
Apikey string `json:"api_key" validate:"required,min=1"` // Merchant's authentication API key
Year int `json:"year" validate:"required"` // Year for data aggregation (YYYY format)
}
MonthYearPaymentMethodApiKey represents a request for payment method statistics by API key and year. Used to retrieve aggregated payment method data for a specific merchant.
type MonthYearPaymentMethodMerchant ¶
type MonthYearPaymentMethodMerchant struct {
MerchantID int `json:"merchant_id" validate:"required,min=1"` // Unique merchant identifier
Year int `json:"year" validate:"required"` // Year for data aggregation (YYYY format)
}
MonthYearPaymentMethodMerchant represents a request for payment method statistics by merchant ID and year. Used internally for merchant analytics.
type MonthYearTotalAmountApiKey ¶
type MonthYearTotalAmountApiKey struct {
Apikey string `json:"api_key" validate:"required,min=1"` // Merchant's authentication API key
Year int `json:"year" validate:"required"` // Year for data aggregation (YYYY format)
}
MonthYearTotalAmountApiKey represents a request for total transaction amounts by API key and year. Used for annual financial reporting per merchant.
type MonthYearTotalAmountMerchant ¶
type MonthYearTotalAmountMerchant struct {
MerchantID int `json:"merchant_id" validate:"required,min=1"` // Unique merchant identifier
Year int `json:"year" validate:"required"` // Year for data aggregation (YYYY format)
}
MonthYearTotalAmountMerchant represents a request for total transaction amounts by merchant ID and year. Used for comprehensive merchant financial analysis.
type RefreshTokenRequest ¶
type RefreshTokenRequest struct {
RefreshToken string `json:"refresh_token" validate:"required,min=1"` // The refresh token to validate/redeem
}
RefreshTokenRequest represents the payload for refresh token operations. Used when exchanging a refresh token for new access credentials.
func (*RefreshTokenRequest) Validate ¶
func (r *RefreshTokenRequest) Validate() error
Validate performs structural validation of RefreshTokenRequest fields. Checks that the refresh token is present and meets minimum requirements. Returns:
- error: if validation fails according to struct tag rules
type RegisterRequest ¶
type RegisterRequest struct {
FirstName string `json:"firstname"` // User's first name
LastName string `json:"lastname"` // User's last name
Email string `json:"email" validate:"required,email"` // User's email address (must be valid email format)
Password string `json:"password" validate:"required,min=6"` // User's password (minimum 6 characters)
ConfirmPassword string `json:"confirm_password" validate:"required,min=6"` // Password confirmation (must match password)
VerifiedCode string `json:"verified_code"` // Verification code for email confirmation (optional during registration)
IsVerified bool `json:"is_verified"` // Flag indicating if user has verified their email (typically false initially)
}
RegisterRequest represents the payload for user registration. Contains all necessary information to create a new user account.
func (*RegisterRequest) Validate ¶
func (r *RegisterRequest) Validate() error
Validate validates the RegisterRequest struct using the validator.v10 package.
Returns an error if any of the validation rules fail.
type RemoveUserRoleRequest ¶
type RemoveUserRoleRequest struct {
UserId int `json:"user_id" validate:"required"` // ID of the user losing the role
RoleId int `json:"role_id" validate:"required"` // ID of the role to be removed
}
RemoveUserRoleRequest represents the payload for revoking a role from a user. Used when removing specific permissions or access levels from users.
type RoleRequestPayload ¶
type RoleRequestPayload struct {
UserID int `json:"user_id"` // ID of the user performing the role operation
CorrelationID string `json:"correlation_id"` // Unique identifier for request tracing
ReplyTopic string `json:"reply_topic"` // Topic name for asynchronous response delivery
}
RoleRequestPayload represents the base payload structure for role management requests. Contains common fields used across role-related operations.
type UpdateCardRequest ¶
type UpdateCardRequest struct {
CardID int `json:"card_id" validate:"required,min=1"` // ID of the card being updated
UserID int `json:"user_id" validate:"required,min=1"` // ID of the card owner (for verification)
CardType string `json:"card_type" validate:"required"` // Updated card type ("credit" or "debit")
ExpireDate time.Time `json:"expire_date" validate:"required"` // Updated expiration date
CVV string `json:"cvv" validate:"required"` // Updated card verification value
CardProvider string `json:"card_provider" validate:"required"` // Updated card provider
}
UpdateCardRequest represents the payload for updating an existing payment card. Contains all modifiable fields for a payment card record.
func (*UpdateCardRequest) Validate ¶
func (r *UpdateCardRequest) Validate() error
Validate performs validation of UpdateCardRequest fields beyond basic struct validation. Ensures card type and provider are valid values and IDs are positive. Returns:
- error: if validation fails, describing the specific validation error
type UpdateMerchantDocumentRequest ¶
type UpdateMerchantDocumentRequest struct {
DocumentID *int `json:"document_id"` // ID of the document being updated (optional in some flows)
MerchantID int `json:"merchant_id" validate:"required,min=1"` // ID of the merchant (for verification)
DocumentType string `json:"document_type" validate:"required"` // Updated document type
DocumentUrl string `json:"document_url" validate:"required"` // Updated document URL/path
Status string `json:"status" validate:"required"` // Updated review status (e.g., "pending", "approved")
Note string `json:"note" validate:"required"` // Administrative notes about the document
}
UpdateMerchantDocumentRequest represents the payload for updating an existing merchant document. Contains all modifiable fields for a merchant document record.
func (*UpdateMerchantDocumentRequest) Validate ¶
func (r *UpdateMerchantDocumentRequest) Validate() error
Validate performs basic validation of UpdateMerchantDocumentRequest fields using struct tags. Returns:
- error: if validation fails according to struct tag rules
type UpdateMerchantDocumentStatusRequest ¶
type UpdateMerchantDocumentStatusRequest struct {
DocumentID *int `json:"document_id"` // ID of the document being updated (optional in some flows)
MerchantID int `json:"merchant_id" validate:"required,min=1"` // ID of the merchant (for verification)
Status string `json:"status" validate:"required"` // New review status (e.g., "approved", "rejected")
Note string `json:"note" validate:"required"` // Explanation for status change
}
UpdateMerchantDocumentStatusRequest represents the payload for changing a document's review status. Used specifically for status updates during document review processes.
func (*UpdateMerchantDocumentStatusRequest) Validate ¶
func (r *UpdateMerchantDocumentStatusRequest) Validate() error
Validate performs basic validation of UpdateMerchantDocumentStatusRequest fields using struct tags. Returns:
- error: if validation fails according to struct tag rules
type UpdateMerchantRequest ¶
type UpdateMerchantRequest struct {
MerchantID *int `json:"merchant_id"` // ID of merchant to update (optional in some flows)
Name string `json:"name" validate:"required"` // Updated merchant name
UserID int `json:"user_id" validate:"required,min=1"` // ID of user performing update
Status string `json:"status" validate:"required"` // New status (e.g., "active", "suspended")
}
UpdateMerchantRequest represents the payload for updating merchant details. Used in merchant profile management.
func (UpdateMerchantRequest) Validate ¶
func (r UpdateMerchantRequest) Validate() error
Validate performs validation of UpdateMerchantRequest fields. Ensures all required fields are present and valid. Returns:
- error: if validation fails
type UpdateMerchantStatusRequest ¶
type UpdateMerchantStatusRequest struct {
MerchantID *int `json:"merchant_id"` // ID of merchant to update (optional in some flows)
Status string `json:"status" validate:"required"` // New status (e.g., "approved", "rejected")
}
UpdateMerchantStatusRequest represents the payload for changing merchant status. Used specifically for merchant account status management.
func (UpdateMerchantStatusRequest) Validate ¶
func (r UpdateMerchantStatusRequest) Validate() error
Validate performs validation of UpdateMerchantStatusRequest fields. Ensures all required fields are present and valid. Returns:
- error: if validation fails
type UpdateRefreshToken ¶
type UpdateRefreshToken struct {
UserId int `json:"user_id" validate:"required,min=1"` // ID of the user the token belongs to
Token string `json:"token" validate:"required,min=1"` // The new refresh token value (should be hashed)
ExpiresAt string `json:"expires_at" validate:"required,min=1"` // New expiration timestamp (RFC3339 format recommended)
}
UpdateRefreshToken represents the payload for updating an existing refresh token. Used when rotating or extending refresh token validity.
func (*UpdateRefreshToken) Validate ¶
func (r *UpdateRefreshToken) Validate() error
Validate performs structural validation of UpdateRefreshToken fields. Checks that all required fields meet minimum requirements. Returns:
- error: if validation fails according to struct tag rules
type UpdateRoleRequest ¶
type UpdateRoleRequest struct {
ID *int `json:"id"` // ID of the role to update (optional in some flows)
Name string `json:"name" validate:"required"` // New name for the role
}
UpdateRoleRequest represents the payload for modifying an existing role. Used when renaming or updating role definitions.
func (*UpdateRoleRequest) Validate ¶
func (r *UpdateRoleRequest) Validate() error
Validate performs validation of UpdateRoleRequest fields. Ensures the role ID (when provided) and name meet requirements. Returns:
- error: if validation fails, describing the validation failure
type UpdateSaldoBalance ¶
type UpdateSaldoBalance struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number (minimum 1 character)
TotalBalance int `json:"total_balance" validate:"required,min=50000"` // New balance (minimum 50,000 in smallest unit)
}
UpdateSaldoBalance represents the payload for balance adjustment operations. Used specifically for updating card balance amounts.
func (*UpdateSaldoBalance) Validate ¶
func (r *UpdateSaldoBalance) Validate() error
Validate performs validation of UpdateSaldoBalance fields. Ensures balance meets minimum requirements and card number is valid. Returns:
- error: if validation fails
type UpdateSaldoRequest ¶
type UpdateSaldoRequest struct {
SaldoID *int `json:"saldo_id"` // ID of the saldo record (optional in some flows)
CardNumber string `json:"card_number" validate:"required"` // Card number associated with the balance
TotalBalance int `json:"total_balance" validate:"required"` // Updated balance amount (in smallest currency unit)
}
UpdateSaldoRequest represents the payload for modifying an existing saldo record. Used for comprehensive updates to balance information.
func (*UpdateSaldoRequest) Validate ¶
func (r *UpdateSaldoRequest) Validate() error
Validate performs basic validation of UpdateSaldoRequest fields. Ensures required fields are present and properly formatted. Returns:
- error: if validation fails
type UpdateSaldoWithdraw ¶
type UpdateSaldoWithdraw struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number (minimum 1 character)
TotalBalance int `json:"total_balance" validate:"required,min=50000"` // Current balance (minimum 50,000)
WithdrawAmount *int `json:"withdraw_amount" validate:"omitempty,gte=0"` // Amount to withdraw (optional, must be ≥ 0)
WithdrawTime *time.Time `json:"withdraw_time" validate:"omitempty"` // Timestamp of withdrawal (optional)
}
UpdateSaldoWithdraw represents the payload for withdrawal operations. Used when processing balance withdrawals from cards.
func (*UpdateSaldoWithdraw) Validate ¶
func (r *UpdateSaldoWithdraw) Validate() error
Validate performs comprehensive validation of UpdateSaldoWithdraw fields. Ensures: - Withdrawal amount and time are either both provided or both omitted - Withdrawal amount doesn't exceed available balance - All required fields meet minimum requirements Returns:
- error: if validation fails with specific validation messages
type UpdateTopupAmount ¶
type UpdateTopupAmount struct {
TopupID int `json:"topup_id" validate:"required,min=1"` // ID of top-up record
TopupAmount int `json:"topup_amount" validate:"required,min=50000"` // New amount (minimum 50,000)
}
UpdateTopupAmount represents the payload for adjusting a top-up amount. Used specifically for amount corrections.
func (*UpdateTopupAmount) Validate ¶
func (r *UpdateTopupAmount) Validate() error
Validate performs validation of UpdateTopupAmount fields. Ensures: - Valid top-up ID - Minimum top-up amount (50,000) Returns:
- error: if validation fails
type UpdateTopupRequest ¶
type UpdateTopupRequest struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number associated with top-up
TopupID *int `json:"topup_id"` // ID of top-up record to update
TopupAmount int `json:"topup_amount" validate:"required,min=50000"` // Updated amount (minimum 50,000)
TopupMethod string `json:"topup_method" validate:"required"` // Updated payment method
}
UpdateTopupRequest represents the payload for updating a top-up transaction. Used to modify existing top-up records.
func (*UpdateTopupRequest) Validate ¶
func (r *UpdateTopupRequest) Validate() error
Validate performs comprehensive validation of UpdateTopupRequest fields. Ensures: - Valid top-up ID - Minimum top-up amount (50,000) - Valid payment method Returns:
- error: if validation fails with specific validation messages
type UpdateTopupStatus ¶
type UpdateTopupStatus struct {
TopupID int `json:"topup_id" validate:"required,min=1"` // ID of top-up record
Status string `json:"status" validate:"required"` // New status (e.g., "completed", "failed")
}
UpdateTopupStatus represents the payload for changing a top-up status. Used to update processing status of top-up transactions.
func (*UpdateTopupStatus) Validate ¶
func (r *UpdateTopupStatus) Validate() error
Validate performs basic validation of UpdateTopupStatus fields. Ensures required fields are present. Returns:
- error: if validation fails
type UpdateTransactionRequest ¶
type UpdateTransactionRequest struct {
TransactionID *int `json:"transaction_id"` // ID of transaction to update
CardNumber string `json:"card_number" validate:"required,min=1"` // Updated card number
Amount int `json:"amount" validate:"required,min=50000"` // Updated amount (minimum 50,000)
PaymentMethod string `json:"payment_method" validate:"required"` // Updated payment method
MerchantID *int `json:"merchant_id" validate:"required,min=1"` // Updated merchant ID
TransactionTime time.Time `json:"transaction_time" validate:"required"` // Updated transaction timestamp
}
UpdateTransactionRequest represents the payload for updating a transaction record. Used to modify existing transaction details.
func (*UpdateTransactionRequest) Validate ¶
func (r *UpdateTransactionRequest) Validate() error
Validate performs comprehensive validation of UpdateTransactionRequest fields. Ensures: - Valid payment method - Minimum transaction amount (50,000) - Required fields are present Returns:
- error: if validation fails with specific validation messages
type UpdateTransactionStatus ¶
type UpdateTransactionStatus struct {
TransactionID int `json:"transaction_id" validate:"required,min=1"` // ID of transaction to update
Status string `json:"status" validate:"required"` // New status (e.g., "completed", "failed")
}
UpdateTransactionStatus represents the payload for changing a transaction status. Used to update processing status of transactions.
func (*UpdateTransactionStatus) Validate ¶
func (r *UpdateTransactionStatus) Validate() error
Validate performs basic validation of UpdateTransactionStatus fields. Ensures required fields are present. Returns:
- error: if validation fails
type UpdateTransferAmountRequest ¶
type UpdateTransferAmountRequest struct {
TransferID int `json:"transfer_id" validate:"required,min=1"` // ID of transfer record
TransferAmount int `json:"transfer_amount" validate:"required,gt=0"` // New amount (must be greater than 0)
}
UpdateTransferAmountRequest represents the payload for adjusting a transfer amount. Used specifically for amount corrections.
func (*UpdateTransferAmountRequest) Validate ¶
func (r *UpdateTransferAmountRequest) Validate() error
Validate performs validation of UpdateTransferAmountRequest fields. Ensures: - Valid transfer ID - Positive transfer amount Returns:
- error: if validation fails
type UpdateTransferRequest ¶
type UpdateTransferRequest struct {
TransferID *int `json:"transfer_id"` // ID of transfer to update
TransferFrom string `json:"transfer_from" validate:"required"` // Updated source account/card
TransferTo string `json:"transfer_to" validate:"required,min=1"` // Updated destination account/card
TransferAmount int `json:"transfer_amount" validate:"required,min=50000"` // Updated transfer amount (minimum 50,000)
}
UpdateTransferRequest represents the payload for modifying a transfer record. Used to update existing transfer details.
func (*UpdateTransferRequest) Validate ¶
func (r *UpdateTransferRequest) Validate() error
Validate performs comprehensive validation of UpdateTransferRequest fields. Ensures: - Valid transfer ID - Minimum transfer amount (50,000) - Valid account/card numbers Returns:
- error: if validation fails with specific validation messages
type UpdateTransferStatus ¶
type UpdateTransferStatus struct {
TransferID int `json:"transfer_id" validate:"required,min=1"` // ID of transfer to update
Status string `json:"status" validate:"required"` // New status (e.g., "completed", "failed")
}
UpdateTransferStatus represents the payload for changing a transfer status. Used to update processing status of transfers.
func (*UpdateTransferStatus) Validate ¶
func (r *UpdateTransferStatus) Validate() error
Validate performs basic validation of UpdateTransferStatus fields. Ensures required fields are present. Returns:
- error: if validation fails
type UpdateUserRequest ¶
type UpdateUserRequest struct {
UserID *int `json:"user_id"` // ID of user to update (optional in some flows)
FirstName string `json:"firstname" validate:"required,alpha"` // Updated first name
LastName string `json:"lastname" validate:"required,alpha"` // Updated last name
Email string `json:"email" validate:"required,email"` // Updated email address
Password string `json:"password" validate:"required,min=6"` // New password
ConfirmPassword string `json:"confirm_password" validate:"required,eqfield=Password"` // Password confirmation
}
UpdateUserRequest represents the payload for modifying an existing user's information. Used when updating user profile details or credentials.
func (*UpdateUserRequest) Validate ¶
func (r *UpdateUserRequest) Validate() error
Validate performs structural validation of UpdateUserRequest fields. Ensures all required fields are present and meet format requirements. Returns:
- error: if validation fails according to struct tag rules
type UpdateWithdrawRequest ¶
type UpdateWithdrawRequest struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card/account number
WithdrawID *int `json:"withdraw_id"` // ID of withdrawal to update
WithdrawAmount int `json:"withdraw_amount" validate:"required,min=50000"` // Updated withdrawal amount
WithdrawTime time.Time `json:"withdraw_time" validate:"required"` // Updated withdrawal timestamp
}
UpdateWithdrawRequest represents the payload for modifying a withdrawal record. Used to update existing withdrawal details.
func (*UpdateWithdrawRequest) Validate ¶
func (r *UpdateWithdrawRequest) Validate() error
Validate performs comprehensive validation of UpdateWithdrawRequest fields. Ensures: - Minimum withdrawal amount (50,000) - Withdrawal time is not in the future - Required fields are present Returns:
- error: if validation fails with specific validation messages
type UpdateWithdrawStatus ¶
type UpdateWithdrawStatus struct {
WithdrawID int `json:"withdraw_id" validate:"required,min=1"` // ID of withdrawal to update
Status string `json:"status" validate:"required"` // New status (e.g., "completed", "failed")
}
UpdateWithdrawStatus represents the payload for changing a withdrawal status. Used to update processing status of withdrawals.
func (*UpdateWithdrawStatus) Validate ¶
func (r *UpdateWithdrawStatus) Validate() error
Validate performs basic validation of UpdateWithdrawStatus fields. Ensures required fields are present. Returns:
- error: if validation fails
type YearMonthCardNumber ¶
type YearMonthCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to query (minimum 1 character)
Year int `json:"year" validate:"required"` // Year for the query (YYYY format)
}
YearMonthCardNumber represents parameters for operations requiring card number and year. Used for card-specific annual data retrieval operations.
type YearMonthMethod ¶
type YearMonthMethod struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to query
Year int `json:"year" validate:"required"` // Year for the query (YYYY format)
}
YearMonthMethod represents parameters for retrieving top-up methods by year and card. Used to analyze payment method trends for specific cards.
type YearStatusTransactionCardNumber ¶
type YearStatusTransactionCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to analyze
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
}
YearStatusTransactionCardNumber represents parameters for retrieving card-specific annual transaction status. Used to get yearly transaction statistics for specific cards.
type YearStatusTransferCardNumber ¶
type YearStatusTransferCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to analyze
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
}
YearStatusTransferCardNumber represents parameters for retrieving annual transfer status by card. Used to get yearly transfer statistics for specific cards.
type YearStatusWithdrawCardNumber ¶
type YearStatusWithdrawCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to analyze
Year int `json:"year" validate:"required"` // Year for analysis (YYYY format)
}
YearStatusWithdrawCardNumber represents parameters for retrieving card-specific annual withdrawal status. Used to get yearly withdrawal statistics for specific cards.
type YearTopupStatusCardNumber ¶
type YearTopupStatusCardNumber struct {
CardNumber string `json:"card_number" validate:"required,min=1"` // Card number to query
Year int `json:"year" validate:"required"` // Year for the query (YYYY format)
}
YearTopupStatusCardNumber represents parameters for retrieving card-specific top-up status by year. Used to query annual top-up statistics for a specific card.