README
¶
📦 Package protomapper
Source Path: shared/mapper/proto
🧩 Types
AuthProtoMapper
AuthProtoMapper defines a set of methods to map authentication-related responses to their corresponding gRPC protobuf message formats.
type AuthProtoMapper interface {
ToProtoResponseVerifyCode func(status string, message string) (*pb.ApiResponseVerifyCode)
ToProtoResponseForgotPassword func(status string, message string) (*pb.ApiResponseForgotPassword)
ToProtoResponseResetPassword func(status string, message string) (*pb.ApiResponseResetPassword)
ToProtoResponseLogin func(status string, message string, response *response.TokenResponse) (*pb.ApiResponseLogin)
ToProtoResponseRegister func(status string, message string, response *response.UserResponse) (*pb.ApiResponseRegister)
ToProtoResponseRefreshToken func(status string, message string, response *response.TokenResponse) (*pb.ApiResponseRefreshToken)
ToProtoResponseGetMe func(status string, message string, response *response.UserResponse) (*pb.ApiResponseGetMe)
}
CardProtoMapper
CardProtoMapper defines methods for mapping card-related domain responses to gRPC protobuf response messages.
type CardProtoMapper interface {
ToProtoResponseCard func(status string, message string, card *response.CardResponse) (*pb.ApiResponseCard)
ToProtoResponsePaginationCard func(pagination *pb.PaginationMeta, status string, message string, cards []*response.CardResponse) (*pb.ApiResponsePaginationCard)
ToProtoResponseCardDeleteAt func(status string, message string) (*pb.ApiResponseCardDelete)
ToProtoResponseCardAll func(status string, message string) (*pb.ApiResponseCardAll)
ToProtoResponsePaginationCardDeletedAt func(pagination *pb.PaginationMeta, status string, message string, cards []*response.CardResponseDeleteAt) (*pb.ApiResponsePaginationCardDeleteAt)
ToProtoResponseDashboardCard func(status string, message string, dash *response.DashboardCard) (*pb.ApiResponseDashboardCard)
ToProtoResponseDashboardCardCardNumber func(status string, message string, dash *response.DashboardCardCardNumber) (*pb.ApiResponseDashboardCardNumber)
ToProtoResponseMonthlyBalances func(status string, message string, cards []*response.CardResponseMonthBalance) (*pb.ApiResponseMonthlyBalance)
ToProtoResponseYearlyBalances func(status string, message string, cards []*response.CardResponseYearlyBalance) (*pb.ApiResponseYearlyBalance)
ToProtoResponseMonthlyAmounts func(status string, message string, cards []*response.CardResponseMonthAmount) (*pb.ApiResponseMonthlyAmount)
ToProtoResponseYearlyAmounts func(status string, message string, cards []*response.CardResponseYearAmount) (*pb.ApiResponseYearlyAmount)
}
MerchantDocumentProtoMapper
MerchantDocumentProtoMapper defines methods for mapping merchant document-related responses into gRPC protobuf response messages.
type MerchantDocumentProtoMapper interface {
ToProtoResponseMerchantDocument func(status string, message string, doc *response.MerchantDocumentResponse) (*pb.ApiResponseMerchantDocument)
ToProtoResponsesMerchantDocument func(status string, message string, docs []*response.MerchantDocumentResponse) (*pb.ApiResponsesMerchantDocument)
ToProtoResponsePaginationMerchantDocument func(pagination *pb.PaginationMeta, status string, message string, docs []*response.MerchantDocumentResponse) (*pb.ApiResponsePaginationMerchantDocument)
ToProtoResponsePaginationMerchantDocumentDeleteAt func(pagination *pb.PaginationMeta, status string, message string, docs []*response.MerchantDocumentResponseDeleteAt) (*pb.ApiResponsePaginationMerchantDocumentAt)
ToProtoResponseMerchantDocumentDelete func(status string, message string) (*pb.ApiResponseMerchantDocumentDelete)
ToProtoResponseMerchantDocumentAll func(status string, message string) (*pb.ApiResponseMerchantDocumentAll)
}
MerchantProtoMapper
MerchantProtoMapper defines methods for mapping merchant-related domain responses to gRPC protobuf response messages.
type MerchantProtoMapper interface {
ToProtoResponsePaginationMerchant func(pagination *pb.PaginationMeta, status string, message string, merchants []*response.MerchantResponse) (*pb.ApiResponsePaginationMerchant)
ToProtoResponseMerchants func(status string, message string, res []*response.MerchantResponse) (*pb.ApiResponsesMerchant)
ToProtoResponseMerchant func(status string, message string, res *response.MerchantResponse) (*pb.ApiResponseMerchant)
ToProtoResponseMerchantAll func(status string, message string) (*pb.ApiResponseMerchantAll)
ToProtoResponseMerchantDelete func(status string, message string) (*pb.ApiResponseMerchantDelete)
ToProtoResponsePaginationMerchantDeleteAt func(pagination *pb.PaginationMeta, status string, message string, merchants []*response.MerchantResponseDeleteAt) (*pb.ApiResponsePaginationMerchantDeleteAt)
ToProtoResponsePaginationMerchantTransaction func(pagination *pb.PaginationMeta, status string, message string, merchants []*response.MerchantTransactionResponse) (*pb.ApiResponsePaginationMerchantTransaction)
ToProtoResponseMonthlyPaymentMethods func(status string, message string, ms []*response.MerchantResponseMonthlyPaymentMethod) (*pb.ApiResponseMerchantMonthlyPaymentMethod)
ToProtoResponseYearlyPaymentMethods func(status string, message string, ms []*response.MerchantResponseYearlyPaymentMethod) (*pb.ApiResponseMerchantYearlyPaymentMethod)
ToProtoResponseMonthlyAmounts func(status string, message string, ms []*response.MerchantResponseMonthlyAmount) (*pb.ApiResponseMerchantMonthlyAmount)
ToProtoResponseYearlyAmounts func(status string, message string, ms []*response.MerchantResponseYearlyAmount) (*pb.ApiResponseMerchantYearlyAmount)
ToProtoResponseMonthlyTotalAmounts func(status string, message string, ms []*response.MerchantResponseMonthlyTotalAmount) (*pb.ApiResponseMerchantMonthlyTotalAmount)
ToProtoResponseYearlyTotalAmounts func(status string, message string, ms []*response.MerchantResponseYearlyTotalAmount) (*pb.ApiResponseMerchantYearlyTotalAmount)
}
ProtoMapper
type ProtoMapper struct {
AuthProtoMapper AuthProtoMapper
RoleProtoMapper RoleProtoMapper
CardProtoMapper CardProtoMapper
MerchantProtoMapper MerchantProtoMapper
MerchantDocumentProtoMapper MerchantDocumentProtoMapper
SaldoProtoMapper SaldoProtoMapper
TopupProtoMapper TopupProtoMapper
TransactionProtoMapper TransactionProtoMapper
TransferProtoMapper TransferProtoMapper
UserProtoMapper UserProtoMapper
WithdrawalProtoMapper WithdrawalProtoMapper
}
RoleProtoMapper
RoleProtoMapper defines methods to map role-related data structures into gRPC protobuf response messages.
type RoleProtoMapper interface {
ToProtoResponseRoleAll func(status string, message string) (*pb.ApiResponseRoleAll)
ToProtoResponseRoleDelete func(status string, message string) (*pb.ApiResponseRoleDelete)
ToProtoResponseRole func(status string, message string, pbResponse *response.RoleResponse) (*pb.ApiResponseRole)
ToProtoResponsesRole func(status string, message string, pbResponse []*response.RoleResponse) (*pb.ApiResponsesRole)
ToProtoResponsePaginationRole func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.RoleResponse) (*pb.ApiResponsePaginationRole)
ToProtoResponsePaginationRoleDeleteAt func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.RoleResponseDeleteAt) (*pb.ApiResponsePaginationRoleDeleteAt)
}
SaldoProtoMapper
SaldoProtoMapper defines methods for mapping saldo (balance)-related responses into gRPC protobuf response messages.
type SaldoProtoMapper interface {
ToProtoResponseSaldo func(status string, message string, pbResponse *response.SaldoResponse) (*pb.ApiResponseSaldo)
ToProtoResponsesSaldo func(status string, message string, pbResponse []*response.SaldoResponse) (*pb.ApiResponsesSaldo)
ToProtoResponseSaldoDelete func(status string, message string) (*pb.ApiResponseSaldoDelete)
ToProtoResponseSaldoAll func(status string, message string) (*pb.ApiResponseSaldoAll)
ToProtoResponseMonthTotalSaldo func(status string, message string, pbResponse []*response.SaldoMonthTotalBalanceResponse) (*pb.ApiResponseMonthTotalSaldo)
ToProtoResponseYearTotalSaldo func(status string, message string, pbResponse []*response.SaldoYearTotalBalanceResponse) (*pb.ApiResponseYearTotalSaldo)
ToProtoResponseMonthSaldoBalances func(status string, message string, pbResponse []*response.SaldoMonthBalanceResponse) (*pb.ApiResponseMonthSaldoBalances)
ToProtoResponseYearSaldoBalances func(status string, message string, pbResponse []*response.SaldoYearBalanceResponse) (*pb.ApiResponseYearSaldoBalances)
ToProtoResponsePaginationSaldo func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.SaldoResponse) (*pb.ApiResponsePaginationSaldo)
ToProtoResponsePaginationSaldoDeleteAt func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.SaldoResponseDeleteAt) (*pb.ApiResponsePaginationSaldoDeleteAt)
}
TopupProtoMapper
TopupProtoMapper defines methods for mapping top-up-related domain responses into gRPC protobuf response messages.
type TopupProtoMapper interface {
ToProtoResponseTopup func(status string, message string, s *response.TopupResponse) (*pb.ApiResponseTopup)
ToProtoResponseTopupDeletAt func(status string, message string, s *response.TopupResponseDeleteAt) (*pb.ApiResponseTopupDeleteAt)
ToProtoResponseTopupDelete func(status string, message string) (*pb.ApiResponseTopupDelete)
ToProtoResponseTopupAll func(status string, message string) (*pb.ApiResponseTopupAll)
ToProtoResponsePaginationTopup func(pagination *pb.PaginationMeta, status string, message string, s []*response.TopupResponse) (*pb.ApiResponsePaginationTopup)
ToProtoResponsePaginationTopupDeleteAt func(pagination *pb.PaginationMeta, status string, message string, s []*response.TopupResponseDeleteAt) (*pb.ApiResponsePaginationTopupDeleteAt)
ToProtoResponseTopupMonthStatusSuccess func(status string, message string, s []*response.TopupResponseMonthStatusSuccess) (*pb.ApiResponseTopupMonthStatusSuccess)
ToProtoResponseTopupYearStatusSuccess func(status string, message string, s []*response.TopupResponseYearStatusSuccess) (*pb.ApiResponseTopupYearStatusSuccess)
ToProtoResponseTopupMonthStatusFailed func(status string, message string, s []*response.TopupResponseMonthStatusFailed) (*pb.ApiResponseTopupMonthStatusFailed)
ToProtoResponseTopupYearStatusFailed func(status string, message string, s []*response.TopupResponseYearStatusFailed) (*pb.ApiResponseTopupYearStatusFailed)
ToProtoResponseTopupMonthMethod func(status string, message string, s []*response.TopupMonthMethodResponse) (*pb.ApiResponseTopupMonthMethod)
ToProtoResponseTopupYearMethod func(status string, message string, s []*response.TopupYearlyMethodResponse) (*pb.ApiResponseTopupYearMethod)
ToProtoResponseTopupMonthAmount func(status string, message string, s []*response.TopupMonthAmountResponse) (*pb.ApiResponseTopupMonthAmount)
ToProtoResponseTopupYearAmount func(status string, message string, s []*response.TopupYearlyAmountResponse) (*pb.ApiResponseTopupYearAmount)
}
TransactionProtoMapper
TransactionProtoMapper defines methods for mapping transaction-related domain responses into gRPC protobuf response messages.
type TransactionProtoMapper interface {
ToProtoResponseTransactionMonthStatusSuccess func(status string, message string, pbResponse []*response.TransactionResponseMonthStatusSuccess) (*pb.ApiResponseTransactionMonthStatusSuccess)
ToProtoResponseTransactionYearStatusSuccess func(status string, message string, pbResponse []*response.TransactionResponseYearStatusSuccess) (*pb.ApiResponseTransactionYearStatusSuccess)
ToProtoResponseTransactionMonthStatusFailed func(status string, message string, pbResponse []*response.TransactionResponseMonthStatusFailed) (*pb.ApiResponseTransactionMonthStatusFailed)
ToProtoResponseTransactionYearStatusFailed func(status string, message string, pbResponse []*response.TransactionResponseYearStatusFailed) (*pb.ApiResponseTransactionYearStatusFailed)
ToProtoResponseTransactionMonthMethod func(status string, message string, pbResponse []*response.TransactionMonthMethodResponse) (*pb.ApiResponseTransactionMonthMethod)
ToProtoResponseTransactionYearMethod func(status string, message string, pbResponse []*response.TransactionYearMethodResponse) (*pb.ApiResponseTransactionYearMethod)
ToProtoResponseTransactionMonthAmount func(status string, message string, pbResponse []*response.TransactionMonthAmountResponse) (*pb.ApiResponseTransactionMonthAmount)
ToProtoResponseTransactionYearAmount func(status string, message string, pbResponse []*response.TransactionYearlyAmountResponse) (*pb.ApiResponseTransactionYearAmount)
ToProtoResponseTransaction func(status string, message string, pbResponse *response.TransactionResponse) (*pb.ApiResponseTransaction)
ToProtoResponseTransactions func(status string, message string, pbResponse []*response.TransactionResponse) (*pb.ApiResponseTransactions)
ToProtoResponseTransactionDelete func(status string, message string) (*pb.ApiResponseTransactionDelete)
ToProtoResponseTransactionAll func(status string, message string) (*pb.ApiResponseTransactionAll)
ToProtoResponsePaginationTransaction func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.TransactionResponse) (*pb.ApiResponsePaginationTransaction)
ToProtoResponsePaginationTransactionDeleteAt func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.TransactionResponseDeleteAt) (*pb.ApiResponsePaginationTransactionDeleteAt)
}
TransferProtoMapper
type TransferProtoMapper interface {
ToProtoResponseTransferMonthStatusSuccess func(status string, message string, pbResponse []*response.TransferResponseMonthStatusSuccess) (*pb.ApiResponseTransferMonthStatusSuccess)
ToProtoResponseTransferYearStatusSuccess func(status string, message string, pbResponse []*response.TransferResponseYearStatusSuccess) (*pb.ApiResponseTransferYearStatusSuccess)
ToProtoResponseTransferMonthStatusFailed func(status string, message string, pbResponse []*response.TransferResponseMonthStatusFailed) (*pb.ApiResponseTransferMonthStatusFailed)
ToProtoResponseTransferYearStatusFailed func(status string, message string, pbResponse []*response.TransferResponseYearStatusFailed) (*pb.ApiResponseTransferYearStatusFailed)
ToProtoResponseTransferMonthAmount func(status string, message string, pbResponse []*response.TransferMonthAmountResponse) (*pb.ApiResponseTransferMonthAmount)
ToProtoResponseTransferYearAmount func(status string, message string, pbResponse []*response.TransferYearAmountResponse) (*pb.ApiResponseTransferYearAmount)
ToProtoResponseTransfer func(status string, message string, pbResponse *response.TransferResponse) (*pb.ApiResponseTransfer)
ToProtoResponseTransfers func(status string, message string, pbResponse []*response.TransferResponse) (*pb.ApiResponseTransfers)
ToProtoResponseTransferDelete func(status string, message string) (*pb.ApiResponseTransferDelete)
ToProtoResponseTransferAll func(status string, message string) (*pb.ApiResponseTransferAll)
ToProtoResponsePaginationTransfer func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.TransferResponse) (*pb.ApiResponsePaginationTransfer)
ToProtoResponsePaginationTransferDeleteAt func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.TransferResponseDeleteAt) (*pb.ApiResponsePaginationTransferDeleteAt)
}
UserProtoMapper
UserProtoMapper defines methods for converting user-related data structures into gRPC protobuf response messages.
type UserProtoMapper interface {
ToProtoResponsesUser func(status string, message string, pbResponse []*response.UserResponse) (*pb.ApiResponsesUser)
ToProtoResponseUser func(status string, message string, pbResponse *response.UserResponse) (*pb.ApiResponseUser)
ToProtoResponseUserDeleteAt func(status string, message string, pbResponse *response.UserResponseDeleteAt) (*pb.ApiResponseUserDeleteAt)
ToProtoResponseUserDelete func(status string, message string) (*pb.ApiResponseUserDelete)
ToProtoResponseUserAll func(status string, message string) (*pb.ApiResponseUserAll)
ToProtoResponsePaginationUserDeleteAt func(pagination *pb.PaginationMeta, status string, message string, users []*response.UserResponseDeleteAt) (*pb.ApiResponsePaginationUserDeleteAt)
ToProtoResponsePaginationUser func(pagination *pb.PaginationMeta, status string, message string, users []*response.UserResponse) (*pb.ApiResponsePaginationUser)
}
WithdrawalProtoMapper
type WithdrawalProtoMapper interface {
ToProtoResponseWithdraw func(status string, message string, withdraw *response.WithdrawResponse) (*pb.ApiResponseWithdraw)
ToProtoResponsesWithdraw func(status string, message string, pbResponse []*response.WithdrawResponse) (*pb.ApiResponsesWithdraw)
ToProtoResponseWithdrawDelete func(status string, message string) (*pb.ApiResponseWithdrawDelete)
ToProtoResponseWithdrawAll func(status string, message string) (*pb.ApiResponseWithdrawAll)
ToProtoResponsePaginationWithdraw func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.WithdrawResponse) (*pb.ApiResponsePaginationWithdraw)
ToProtoResponsePaginationWithdrawDeleteAt func(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.WithdrawResponseDeleteAt) (*pb.ApiResponsePaginationWithdrawDeleteAt)
ToProtoResponseWithdrawMonthStatusSuccess func(status string, message string, pbResponse []*response.WithdrawResponseMonthStatusSuccess) (*pb.ApiResponseWithdrawMonthStatusSuccess)
ToProtoResponseWithdrawYearStatusSuccess func(status string, message string, pbResponse []*response.WithdrawResponseYearStatusSuccess) (*pb.ApiResponseWithdrawYearStatusSuccess)
ToProtoResponseWithdrawMonthStatusFailed func(status string, message string, pbResponse []*response.WithdrawResponseMonthStatusFailed) (*pb.ApiResponseWithdrawMonthStatusFailed)
ToProtoResponseWithdrawYearStatusFailed func(status string, message string, pbResponse []*response.WithdrawResponseYearStatusFailed) (*pb.ApiResponseWithdrawYearStatusFailed)
ToProtoResponseWithdrawMonthAmount func(status string, message string, pbResponse []*response.WithdrawMonthlyAmountResponse) (*pb.ApiResponseWithdrawMonthAmount)
ToProtoResponseWithdrawYearAmount func(status string, message string, pbResponse []*response.WithdrawYearlyAmountResponse) (*pb.ApiResponseWithdrawYearAmount)
}
authProtoMapper
type authProtoMapper struct {
}
Methods
ToProtoResponseForgotPasswordToProtoResponseForgotPassword maps the response to the proto type.
Args:
status: The status of the response.
message: The message of the response.
Returns:
A pointer to the proto type.
func (s *authProtoMapper) ToProtoResponseForgotPassword(status string, message string) *pb.ApiResponseForgotPassword
ToProtoResponseGetMeToProtoResponseGetMe maps a user profile response to the protobuf format.
Args:
status: The status of the response.
message: The message associated with the response.
response: The UserResponse containing the user's details.
Returns:
A pointer to the ApiResponseGetMe protobuf type containing the status, message, and user data.
func (s *authProtoMapper) ToProtoResponseGetMe(status string, message string, response *response.UserResponse) *pb.ApiResponseGetMe
ToProtoResponseLoginToProtoResponseLogin maps the response to the proto type.
Args:
status: The status of the response.
message: The message of the response.
response: The response containing the access and refresh tokens.
Returns:
A pointer to the proto type.
func (s *authProtoMapper) ToProtoResponseLogin(status string, message string, response *response.TokenResponse) *pb.ApiResponseLogin
ToProtoResponseRefreshTokenfunc (s *authProtoMapper) ToProtoResponseRefreshToken(status string, message string, response *response.TokenResponse) *pb.ApiResponseRefreshToken
ToProtoResponseRegisterfunc (s *authProtoMapper) ToProtoResponseRegister(status string, message string, response *response.UserResponse) *pb.ApiResponseRegister
ToProtoResponseResetPasswordToProtoResponseResetPassword maps the response to the proto type.
Args:
status: The status of the response.
message: The message of the response.
Returns:
A pointer to the proto type.
func (s *authProtoMapper) ToProtoResponseResetPassword(status string, message string) *pb.ApiResponseResetPassword
ToProtoResponseVerifyCodeToProtoResponseVerifyCode maps the response to the proto type.
Args:
status: The status of the response.
message: The message of the response.
Returns:
A pointer to the proto type.
func (s *authProtoMapper) ToProtoResponseVerifyCode(status string, message string) *pb.ApiResponseVerifyCode
cardProtoMapper
type cardProtoMapper struct {
}
Methods
ToProtoResponseCardToProtoResponseCard maps a *response.CardResponse to a *pb.ApiResponseCard proto response.
It is used to generate the response for the CardService.GetCard rpc method.
func (s *cardProtoMapper) ToProtoResponseCard(status string, message string, card *response.CardResponse) *pb.ApiResponseCard
ToProtoResponseCardAllToProtoResponseCardAll maps a status and message to a *pb.ApiResponseCardAll proto response.
It is used to generate the response for the CardService.GetAllCard rpc method.
func (s *cardProtoMapper) ToProtoResponseCardAll(status string, message string) *pb.ApiResponseCardAll
ToProtoResponseCardDeleteAtToProtoResponseCardDeleteAt maps a status and message to a *pb.ApiResponseCardDelete proto response.
It is used to generate the response for the CardService.DeleteCard rpc method.
func (s *cardProtoMapper) ToProtoResponseCardDeleteAt(status string, message string) *pb.ApiResponseCardDelete
ToProtoResponseDashboardCardToProtoResponseDashboardCard maps a status, message and a *response.DashboardCard to a *pb.ApiResponseDashboardCard proto response.
It is used to generate the response for the CardService.GetDashboardCard rpc method.
func (s *cardProtoMapper) ToProtoResponseDashboardCard(status string, message string, dash *response.DashboardCard) *pb.ApiResponseDashboardCard
ToProtoResponseDashboardCardCardNumberToProtoResponseDashboardCardCardNumber maps a status, message, and a *response.DashboardCardCardNumber to a *pb.ApiResponseDashboardCardNumber proto response.
It is used to generate the response for the CardService.GetDashboardCardCardNumber rpc method.
func (s *cardProtoMapper) ToProtoResponseDashboardCardCardNumber(status string, message string, dash *response.DashboardCardCardNumber) *pb.ApiResponseDashboardCardNumber
ToProtoResponseMonthlyAmountsToProtoResponseMonthlyAmounts maps a status, message and a list of *response.CardResponseMonthAmount to a *pb.ApiResponseMonthlyAmount proto response.
It is used to generate the response for the CardService.GetMonthlyAmount rpc method.
func (s *cardProtoMapper) ToProtoResponseMonthlyAmounts(status string, message string, cards []*response.CardResponseMonthAmount) *pb.ApiResponseMonthlyAmount
ToProtoResponseMonthlyBalancesToProtoResponseMonthlyBalances maps a status, message and a list of *response.CardResponseMonthBalance to a *pb.ApiResponseMonthlyBalance proto response.
It is used to generate the response for the CardService.GetMonthlyBalance rpc method.
func (s *cardProtoMapper) ToProtoResponseMonthlyBalances(status string, message string, cards []*response.CardResponseMonthBalance) *pb.ApiResponseMonthlyBalance
ToProtoResponsePaginationCardToProtoResponsePaginationCard maps a pagination meta, status, message and a list of *response.CardResponse to a *pb.ApiResponsePaginationCard proto response.
It is used to generate the response for the CardService.ListCard rpc method.
func (s *cardProtoMapper) ToProtoResponsePaginationCard(pagination *pb.PaginationMeta, status string, message string, cards []*response.CardResponse) *pb.ApiResponsePaginationCard
ToProtoResponsePaginationCardDeletedAtToProtoResponsePaginationCardDeletedAt maps a pagination meta, status, message and a list of *response.CardResponseDeleteAt to a *pb.ApiResponsePaginationCardDeleteAt proto response.
It is used to generate the response for the CardService.ListDeletedCard rpc method.
func (s *cardProtoMapper) ToProtoResponsePaginationCardDeletedAt(pagination *pb.PaginationMeta, status string, message string, cards []*response.CardResponseDeleteAt) *pb.ApiResponsePaginationCardDeleteAt
ToProtoResponseYearlyAmountsToProtoResponseYearlyAmounts maps a status, message and a list of *response.CardResponseYearAmount to a *pb.ApiResponseYearlyAmount proto response.
It is used to generate the response for the CardService.GetYearlyAmount rpc method.
func (s *cardProtoMapper) ToProtoResponseYearlyAmounts(status string, message string, cards []*response.CardResponseYearAmount) *pb.ApiResponseYearlyAmount
ToProtoResponseYearlyBalancesToProtoResponseYearlyBalances maps a status, message and a list of *response.CardResponseYearlyBalance to a *pb.ApiResponseYearlyBalance proto response.
It is used to generate the response for the CardService.GetYearlyBalance rpc method.
func (s *cardProtoMapper) ToProtoResponseYearlyBalances(status string, message string, cards []*response.CardResponseYearlyBalance) *pb.ApiResponseYearlyBalance
mapCardResponsemapCardResponse maps a *response.CardResponse to a *pb.CardResponse proto response.
It is used to generate the response for the CardService.GetCard rpc method.
func (s *cardProtoMapper) mapCardResponse(card *response.CardResponse) *pb.CardResponse
mapCardResponseDeleteAtmapCardResponseDeleteAt maps a *response.CardResponseDeleteAt to a *pb.CardResponseDeleteAt proto response.
This function converts a CardResponseDeleteAt, which includes deletion information, into its protobuf representation. It handles the conversion of all fields including a nullable DeletedAt field.
func (s *cardProtoMapper) mapCardResponseDeleteAt(card *response.CardResponseDeleteAt) *pb.CardResponseDeleteAt
mapCardResponsesmapCardResponses maps a list of *response.CardResponse to a list of *pb.CardResponse proto response.
It is used to generate the response for the CardService.ListCard rpc method.
func (s *cardProtoMapper) mapCardResponses(roles []*response.CardResponse) []*pb.CardResponse
mapCardResponsesDeleteAtmapCardResponsesDeleteAt maps a list of *response.CardResponseDeleteAt to a list of *pb.CardResponseDeleteAt proto response.
It is used to generate the response for the CardService.ListDeletedCard rpc method.
func (s *cardProtoMapper) mapCardResponsesDeleteAt(roles []*response.CardResponseDeleteAt) []*pb.CardResponseDeleteAt
mapDashboardCardmapDashboardCard maps a *response.DashboardCard to a *pb.CardResponseDashboard proto response.
This function converts a DashboardCard from the response domain model to its protobuf representation, handling the mapping of all financial metrics fields.
func (s *cardProtoMapper) mapDashboardCard(dash *response.DashboardCard) *pb.CardResponseDashboard
mapDashboardCardCardNumbermapDashboardCardCardNumber maps a *response.DashboardCardCardNumber to a *pb.CardResponseDashboardCardNumber proto response.
This function converts a DashboardCardCardNumber from the response domain model to its protobuf representation, handling the mapping of all financial metrics fields for a specific card.
func (s *cardProtoMapper) mapDashboardCardCardNumber(dash *response.DashboardCardCardNumber) *pb.CardResponseDashboardCardNumber
mapMonthlyAmountmapMonthlyAmount maps a *response.CardResponseMonthAmount to a *pb.CardResponseMonthlyAmount proto response.
It is used to generate the response for the CardService.GetMonthlyAmount rpc method.
func (s *cardProtoMapper) mapMonthlyAmount(card *response.CardResponseMonthAmount) *pb.CardResponseMonthlyAmount
mapMonthlyAmountsmapMonthlyAmounts maps a list of *response.CardResponseMonthAmount to a list of *pb.CardResponseMonthlyAmount proto responses.
It iterates over each CardResponseMonthAmount in the input slice, converting them to their protobuf equivalent using the mapMonthlyAmount function. This function is used to generate the response data for monthly amount RPC methods.
func (s *cardProtoMapper) mapMonthlyAmounts(roles []*response.CardResponseMonthAmount) []*pb.CardResponseMonthlyAmount
mapMonthlyBalancemapMonthlyBalance maps a *response.CardResponseMonthBalance to a *pb.CardResponseMonthlyBalance proto response.
It is used to generate the response for the CardService.GetMonthlyBalance rpc method.
func (s *cardProtoMapper) mapMonthlyBalance(card *response.CardResponseMonthBalance) *pb.CardResponseMonthlyBalance
mapMonthlyBalancesmapMonthlyBalances maps a list of *response.CardResponseMonthBalance to a list of *pb.CardResponseMonthlyBalance proto responses.
It iterates over each CardResponseMonthBalance in the input slice, converting them to their protobuf equivalent using the mapMonthlyBalance function. This function is used to generate the response data for monthly balance RPC methods.
func (s *cardProtoMapper) mapMonthlyBalances(roles []*response.CardResponseMonthBalance) []*pb.CardResponseMonthlyBalance
mapYearlyAmountmapYearlyAmount maps a *response.CardResponseYearAmount to a *pb.CardResponseYearlyAmount proto response.
This function takes a CardResponseYearAmount from the response domain model and converts it into its protobuf representation, ensuring that the year and total amount fields are accurately mapped.
func (s *cardProtoMapper) mapYearlyAmount(card *response.CardResponseYearAmount) *pb.CardResponseYearlyAmount
mapYearlyAmountsmapYearlyAmounts maps a list of *response.CardResponseYearAmount to a list of *pb.CardResponseYearlyAmount proto responses.
It iterates over each CardResponseYearAmount in the input slice, converting them to their protobuf equivalent using the mapYearlyAmount function. This function is used to generate the response data for yearly amount RPC methods.
func (s *cardProtoMapper) mapYearlyAmounts(roles []*response.CardResponseYearAmount) []*pb.CardResponseYearlyAmount
mapYearlyBalancemapYearlyBalance maps a *response.CardResponseYearlyBalance to a *pb.CardResponseYearlyBalance proto response.
This function takes a CardResponseYearlyBalance from the response domain model and converts it into its protobuf representation, ensuring that the year and total balance fields are accurately mapped.
func (s *cardProtoMapper) mapYearlyBalance(card *response.CardResponseYearlyBalance) *pb.CardResponseYearlyBalance
mapYearlyBalancesmapYearlyBalances maps a list of *response.CardResponseYearlyBalance to a list of *pb.CardResponseYearlyBalance proto responses.
It iterates over each CardResponseYearlyBalance in the input slice, converting them to their protobuf equivalent using the mapYearlyBalance function. This function is used to generate the response data for yearly balance RPC methods.
func (s *cardProtoMapper) mapYearlyBalances(roles []*response.CardResponseYearlyBalance) []*pb.CardResponseYearlyBalance
merchantDocumentProtoMapper
type merchantDocumentProtoMapper struct {
}
Methods
ToProtoResponseMerchantDocumentToProtoResponseMerchantDocument converts a MerchantDocumentResponse to its protobuf representation. It includes the status, message, and mapped document data. Parameters:
- status: The status of the API response.
- message: A descriptive message of the API response.
- doc: The MerchantDocumentResponse that needs to be converted.
Returns:
A pointer to ApiResponseMerchantDocument containing the status, message, and document data.
func (m *merchantDocumentProtoMapper) ToProtoResponseMerchantDocument(status string, message string, doc *response.MerchantDocumentResponse) *pb.ApiResponseMerchantDocument
ToProtoResponseMerchantDocumentAllToProtoResponseMerchantDocumentAll converts a status and message to its protobuf representation specifically for bulk merchant document operations. It includes the status and message of the API response. Parameters:
- status: The status of the API response.
- message: A descriptive message of the API response.
Returns:
A pointer to ApiResponseMerchantDocumentAll containing the status and message.
func (m *merchantDocumentProtoMapper) ToProtoResponseMerchantDocumentAll(status string, message string) *pb.ApiResponseMerchantDocumentAll
ToProtoResponseMerchantDocumentDeleteToProtoResponseMerchantDocumentDelete converts a response message to its protobuf representation specifically for merchant document deletion operations. It includes the status and message of the API response. Parameters:
- status: The status of the API response.
- message: A descriptive message of the API response.
Returns:
A pointer to ApiResponseMerchantDocumentDelete containing the status and message.
func (m *merchantDocumentProtoMapper) ToProtoResponseMerchantDocumentDelete(status string, message string) *pb.ApiResponseMerchantDocumentDelete
ToProtoResponsePaginationMerchantDocumentToProtoResponsePaginationMerchantDocument converts a list of MerchantDocumentResponse to its protobuf representation with pagination data. It includes the status, message, mapped document data, and pagination data. Parameters:
- pagination: The pagination data for the paginated response.
- status: The status of the API response.
- message: A descriptive message of the API response.
- docs: The list of MerchantDocumentResponse that needs to be converted.
Returns:
A pointer to ApiResponsePaginationMerchantDocument containing the status, message, document data, and pagination data.
func (m *merchantDocumentProtoMapper) ToProtoResponsePaginationMerchantDocument(pagination *pb.PaginationMeta, status string, message string, docs []*response.MerchantDocumentResponse) *pb.ApiResponsePaginationMerchantDocument
ToProtoResponsePaginationMerchantDocumentDeleteAtToProtoResponsePaginationMerchantDocumentDeleteAt converts a list of MerchantDocumentResponseDeleteAt to its protobuf representation with pagination data. It includes the status, message, mapped document data, and pagination data. Parameters:
- pagination: The pagination data for the paginated response.
- status: The status of the API response.
- message: A descriptive message of the API response.
- docs: The list of MerchantDocumentResponseDeleteAt that needs to be converted.
Returns:
A pointer to ApiResponsePaginationMerchantDocumentAt containing the status, message, document data, and pagination data.
func (m *merchantDocumentProtoMapper) ToProtoResponsePaginationMerchantDocumentDeleteAt(pagination *pb.PaginationMeta, status string, message string, docs []*response.MerchantDocumentResponseDeleteAt) *pb.ApiResponsePaginationMerchantDocumentAt
ToProtoResponsesMerchantDocumentToProtoResponsesMerchantDocument converts a list of MerchantDocumentResponse to its protobuf representation. It includes the status, message, and mapped document data. Parameters:
- status: The status of the API response.
- message: A descriptive message of the API response.
- docs: The list of MerchantDocumentResponse that needs to be converted.
Returns:
A pointer to ApiResponsesMerchantDocument containing the status, message, and document data.
func (m *merchantDocumentProtoMapper) ToProtoResponsesMerchantDocument(status string, message string, docs []*response.MerchantDocumentResponse) *pb.ApiResponsesMerchantDocument
mapMerchantDocumentmapMerchantDocument maps a MerchantDocumentResponse to its protobuf representation. Parameters:
- doc: The MerchantDocumentResponse that needs to be converted.
Returns:
A pointer to MerchantDocument containing the document data.
func (m *merchantDocumentProtoMapper) mapMerchantDocument(doc *response.MerchantDocumentResponse) *pb.MerchantDocument
mapMerchantDocumentDeleteAtmapMerchantDocumentDeleteAt maps a MerchantDocumentResponseDeleteAt to its protobuf representation. It handles the conversion of document metadata including deletion information. Parameters:
- doc: The MerchantDocumentResponseDeleteAt that needs to be converted.
Returns:
A pointer to MerchantDocumentDeleteAt containing the converted document data.
func (m *merchantDocumentProtoMapper) mapMerchantDocumentDeleteAt(doc *response.MerchantDocumentResponseDeleteAt) *pb.MerchantDocumentDeleteAt
mapMerchantDocumentsmapMerchantDocuments maps a list of MerchantDocumentResponse to its protobuf representation. Parameters:
- docs: The list of MerchantDocumentResponse that needs to be converted.
Returns:
A slice of pointers to MerchantDocument containing the document data.
func (m *merchantDocumentProtoMapper) mapMerchantDocuments(docs []*response.MerchantDocumentResponse) []*pb.MerchantDocument
mapMerchantDocumentsDeleteAtmapMerchantDocumentsDeleteAt maps a list of MerchantDocumentResponseDeleteAt to their protobuf representation. It processes each document in the input slice and converts it to a MerchantDocumentDeleteAt, including all necessary metadata and deletion information. Parameters:
- docs: A slice of MerchantDocumentResponseDeleteAt to be converted.
Returns:
A slice of pointers to MerchantDocumentDeleteAt containing the converted document data.
func (m *merchantDocumentProtoMapper) mapMerchantDocumentsDeleteAt(docs []*response.MerchantDocumentResponseDeleteAt) []*pb.MerchantDocumentDeleteAt
merchantProtoMapper
type merchantProtoMapper struct {
}
Methods
ToProtoResponseMerchantToProtoResponseMerchant maps a status, message and a *response.MerchantResponse to a *pb.ApiResponseMerchant proto response.
It is used to generate the response for the MerchantService.GetMerchant rpc method.
func (m *merchantProtoMapper) ToProtoResponseMerchant(status string, message string, res *response.MerchantResponse) *pb.ApiResponseMerchant
ToProtoResponseMerchantAllToProtoResponseMerchantAll maps a status and message to its protobuf representation specifically for bulk merchant operations. It includes the status and message of the API response. Parameters:
- status: The status of the API response.
- message: A descriptive message for the API response.
Returns:
A pointer to ApiResponseMerchantAll containing the status and message.
func (m *merchantProtoMapper) ToProtoResponseMerchantAll(status string, message string) *pb.ApiResponseMerchantAll
ToProtoResponseMerchantDeleteToProtoResponseMerchantDelete converts a status and message to its protobuf representation specifically for merchant deletion operations. It includes the status and message of the API response. Parameters:
- status: The status of the API response.
- message: A descriptive message of the API response.
Returns:
A pointer to ApiResponseMerchantDelete containing the status and message.
func (m *merchantProtoMapper) ToProtoResponseMerchantDelete(status string, message string) *pb.ApiResponseMerchantDelete
ToProtoResponseMerchantsToProtoResponseMerchants maps a status, message and a list of *response.MerchantResponse to a *pb.ApiResponsesMerchant proto response.
It is used to generate the response for the MerchantService.ListMerchants rpc method.
func (m *merchantProtoMapper) ToProtoResponseMerchants(status string, message string, res []*response.MerchantResponse) *pb.ApiResponsesMerchant
ToProtoResponseMonthlyAmountsToProtoResponseMonthlyAmounts maps a status, message and a list of *response.MerchantResponseMonthlyAmount to a *pb.ApiResponseMerchantMonthlyAmount proto response.
It is used to generate the response for the MerchantService.GetMonthlyAmount rpc method.
func (m *merchantProtoMapper) ToProtoResponseMonthlyAmounts(status string, message string, ms []*response.MerchantResponseMonthlyAmount) *pb.ApiResponseMerchantMonthlyAmount
ToProtoResponseMonthlyPaymentMethodsToProtoResponseMonthlyPaymentMethods maps a status, message and a list of *response.MerchantResponseMonthlyPaymentMethod to a *pb.ApiResponseMerchantMonthlyPaymentMethod proto response.
It is used to generate the response for the MerchantService.GetMonthlyPaymentMethod rpc method.
func (m *merchantProtoMapper) ToProtoResponseMonthlyPaymentMethods(status string, message string, ms []*response.MerchantResponseMonthlyPaymentMethod) *pb.ApiResponseMerchantMonthlyPaymentMethod
ToProtoResponseMonthlyTotalAmountsToProtoResponseMonthlyTotalAmounts maps a status, message and a list of *response.MerchantResponseMonthlyTotalAmount to a *pb.ApiResponseMerchantMonthlyTotalAmount proto response.
It is used to generate the response for the MerchantService.GetMonthlyTotalAmount rpc method.
func (m *merchantProtoMapper) ToProtoResponseMonthlyTotalAmounts(status string, message string, ms []*response.MerchantResponseMonthlyTotalAmount) *pb.ApiResponseMerchantMonthlyTotalAmount
ToProtoResponsePaginationMerchantToProtoResponsePaginationMerchant converts a list of MerchantResponse and pagination metadata into a protobuf ApiResponsePaginationMerchant. It includes the status and message for the API response. Parameters:
- pagination: The pagination metadata for the response.
- status: The status of the API response.
- message: A descriptive message for the API response.
- merchants: A list of MerchantResponse objects to be included in the response.
Returns:
A pointer to ApiResponsePaginationMerchant containing the status, message, merchant data, and pagination data.
func (m *merchantProtoMapper) ToProtoResponsePaginationMerchant(pagination *pb.PaginationMeta, status string, message string, merchants []*response.MerchantResponse) *pb.ApiResponsePaginationMerchant
ToProtoResponsePaginationMerchantDeleteAtToProtoResponsePaginationMerchantDeleteAt maps a pagination meta, status, message and a list of *response.MerchantResponseDeleteAt to a *pb.ApiResponsePaginationMerchantDeleteAt proto response.
It is used to generate the response for the MerchantService.ListDeletedMerchant rpc method.
func (m *merchantProtoMapper) ToProtoResponsePaginationMerchantDeleteAt(pagination *pb.PaginationMeta, status string, message string, merchants []*response.MerchantResponseDeleteAt) *pb.ApiResponsePaginationMerchantDeleteAt
ToProtoResponsePaginationMerchantTransactionToProtoResponsePaginationMerchantTransaction maps a pagination meta, status, message and a list of *response.MerchantTransactionResponse to a *pb.ApiResponsePaginationMerchantTransaction proto response.
It is used to generate the response for the MerchantService.ListMerchantTransaction rpc method.
func (m *merchantProtoMapper) ToProtoResponsePaginationMerchantTransaction(pagination *pb.PaginationMeta, status string, message string, merchants []*response.MerchantTransactionResponse) *pb.ApiResponsePaginationMerchantTransaction
ToProtoResponseYearlyAmountsToProtoResponseYearlyAmounts maps a status, message and a list of *response.MerchantResponseYearlyAmount to a *pb.ApiResponseMerchantYearlyAmount proto response.
It is used to generate the response for the MerchantService.GetYearlyAmount rpc method.
func (m *merchantProtoMapper) ToProtoResponseYearlyAmounts(status string, message string, ms []*response.MerchantResponseYearlyAmount) *pb.ApiResponseMerchantYearlyAmount
ToProtoResponseYearlyPaymentMethodsToProtoResponseYearlyPaymentMethods maps a status, message and a list of *response.MerchantResponseYearlyPaymentMethod to a *pb.ApiResponseMerchantYearlyPaymentMethod proto response.
It is used to generate the response for the MerchantService.GetYearlyPaymentMethod rpc method.
func (m *merchantProtoMapper) ToProtoResponseYearlyPaymentMethods(status string, message string, ms []*response.MerchantResponseYearlyPaymentMethod) *pb.ApiResponseMerchantYearlyPaymentMethod
ToProtoResponseYearlyTotalAmountsToProtoResponseYearlyTotalAmounts maps a status, message, and a list of *response.MerchantResponseYearlyTotalAmount to a *pb.ApiResponseMerchantYearlyTotalAmount proto response.
It is used to generate the response for the MerchantService.GetYearlyTotalAmount rpc method.
func (m *merchantProtoMapper) ToProtoResponseYearlyTotalAmounts(status string, message string, ms []*response.MerchantResponseYearlyTotalAmount) *pb.ApiResponseMerchantYearlyTotalAmount
mapMerchantResponsemapMerchantResponse maps a *response.MerchantResponse to a *pb.MerchantResponse proto message.
It is used to generate the response for the MerchantService.GetMerchant rpc method.
func (m *merchantProtoMapper) mapMerchantResponse(merchant *response.MerchantResponse) *pb.MerchantResponse
mapMerchantResponseDeleteAtmapMerchantResponseDeleteAt maps a *response.MerchantResponseDeleteAt to a *pb.MerchantResponseDeleteAt proto message.
It is used to generate the response for the MerchantService.ListDeletedMerchant rpc method.
func (m *merchantProtoMapper) mapMerchantResponseDeleteAt(merchant *response.MerchantResponseDeleteAt) *pb.MerchantResponseDeleteAt
mapMerchantResponsesmapMerchantResponses maps a list of *response.MerchantResponse to a list of *pb.MerchantResponse proto responses.
It iterates over each MerchantResponse in the input slice, converting them to their protobuf equivalent using the mapMerchantResponse function. This function is used to generate the response data for merchant-related RPC methods.
func (s *merchantProtoMapper) mapMerchantResponses(roles []*response.MerchantResponse) []*pb.MerchantResponse
mapMerchantResponsesDeleteAtmapMerchantResponsesDeleteAt maps a list of *response.MerchantResponseDeleteAt to a list of *pb.MerchantResponseDeleteAt proto responses.
It iterates over each MerchantResponseDeleteAt in the input slice, converting them to their protobuf equivalent using the mapMerchantResponseDeleteAt function. This function is used to generate the response data for the MerchantService.ListDeletedMerchant rpc method.
func (s *merchantProtoMapper) mapMerchantResponsesDeleteAt(roles []*response.MerchantResponseDeleteAt) []*pb.MerchantResponseDeleteAt
mapMerchantTransactionResponsemapMerchantTransactionResponse maps a *response.MerchantTransactionResponse to a *pb.MerchantTransactionResponse proto message.
It is used to generate the response for the MerchantService.ListMerchantTransaction rpc method.
func (m *merchantProtoMapper) mapMerchantTransactionResponse(merchant *response.MerchantTransactionResponse) *pb.MerchantTransactionResponse
mapMerchantTransactionResponsesmapMerchantTransactionResponses maps a list of *response.MerchantTransactionResponse to a list of *pb.MerchantTransactionResponse proto responses.
It iterates over each MerchantTransactionResponse in the input slice, converting them to their protobuf equivalent using the mapMerchantTransactionResponse function. This function is used to generate the response data for merchant transaction-related RPC methods.
func (s *merchantProtoMapper) mapMerchantTransactionResponses(roles []*response.MerchantTransactionResponse) []*pb.MerchantTransactionResponse
mapResponseMonthlyAmountmapResponseMonthlyAmount maps a *response.MerchantResponseMonthlyAmount to a *pb.MerchantResponseMonthlyAmount proto message.
It is used to generate the response for the MerchantService.GetMonthlyAmount rpc method.
func (m *merchantProtoMapper) mapResponseMonthlyAmount(ms *response.MerchantResponseMonthlyAmount) *pb.MerchantResponseMonthlyAmount
mapResponseMonthlyPaymentMethodmapResponseMonthlyPaymentMethod maps a *response.MerchantResponseMonthlyPaymentMethod to a *pb.MerchantResponseMonthlyPaymentMethod proto message.
It is used to generate the response for the MerchantService.GetMonthlyPaymentMethod rpc method.
func (m *merchantProtoMapper) mapResponseMonthlyPaymentMethod(ms *response.MerchantResponseMonthlyPaymentMethod) *pb.MerchantResponseMonthlyPaymentMethod
mapResponseMonthlyTotalAmountmapResponseMonthlyTotalAmount maps a *response.MerchantResponseMonthlyTotalAmount to a *pb.MerchantResponseMonthlyTotalAmount proto message.
It is used to generate the response for the MerchantService.GetMonthlyTotalAmount rpc method.
func (m *merchantProtoMapper) mapResponseMonthlyTotalAmount(ms *response.MerchantResponseMonthlyTotalAmount) *pb.MerchantResponseMonthlyTotalAmount
mapResponseYearlyAmountmapResponseYearlyAmount maps a *response.MerchantResponseYearlyAmount to a *pb.MerchantResponseYearlyAmount proto message.
It is used to generate the response for the MerchantService.GetYearlyAmount rpc method.
func (m *merchantProtoMapper) mapResponseYearlyAmount(ms *response.MerchantResponseYearlyAmount) *pb.MerchantResponseYearlyAmount
mapResponseYearlyPaymentMethodmapResponseYearlyPaymentMethod maps a *response.MerchantResponseYearlyPaymentMethod to a *pb.MerchantResponseYearlyPaymentMethod proto message.
It is used to generate the response for the MerchantService.GetYearlyPaymentMethod rpc method.
func (m *merchantProtoMapper) mapResponseYearlyPaymentMethod(ms *response.MerchantResponseYearlyPaymentMethod) *pb.MerchantResponseYearlyPaymentMethod
mapResponseYearlyTotalAmountmapResponseYearlyTotalAmount maps a *response.MerchantResponseYearlyTotalAmount to a *pb.MerchantResponseYearlyTotalAmount proto message.
It is used to generate the response for the MerchantService.GetYearlyTotalAmount rpc method.
func (m *merchantProtoMapper) mapResponseYearlyTotalAmount(ms *response.MerchantResponseYearlyTotalAmount) *pb.MerchantResponseYearlyTotalAmount
mapResponsesMonthlyAmountmapResponsesMonthlyAmount maps a list of *response.MerchantResponseMonthlyAmount to a list of *pb.MerchantResponseMonthlyAmount proto responses.
It iterates over each MerchantResponseMonthlyAmount in the input slice, converting them to their protobuf equivalent using the mapResponseMonthlyAmount function. This function is used to generate the response data for monthly amount RPC methods.
func (s *merchantProtoMapper) mapResponsesMonthlyAmount(roles []*response.MerchantResponseMonthlyAmount) []*pb.MerchantResponseMonthlyAmount
mapResponsesMonthlyPaymentMethodmapResponsesMonthlyPaymentMethod maps a list of *response.MerchantResponseMonthlyPaymentMethod to a list of *pb.MerchantResponseMonthlyPaymentMethod proto responses.
It iterates over each MerchantResponseMonthlyPaymentMethod in the input slice, converting them to their protobuf equivalent using the mapResponseMonthlyPaymentMethod function. This function is used to generate the response data for monthly payment method RPC methods.
func (s *merchantProtoMapper) mapResponsesMonthlyPaymentMethod(roles []*response.MerchantResponseMonthlyPaymentMethod) []*pb.MerchantResponseMonthlyPaymentMethod
mapResponsesMonthlyTotalAmountmapResponsesMonthlyTotalAmount maps a list of *response.MerchantResponseMonthlyTotalAmount to a list of *pb.MerchantResponseMonthlyTotalAmount proto responses.
It iterates over each MerchantResponseMonthlyTotalAmount in the input slice, converting them to their protobuf equivalent using the mapResponseMonthlyTotalAmount function. This function is used to generate the response data for monthly total amount RPC methods.
func (s *merchantProtoMapper) mapResponsesMonthlyTotalAmount(roles []*response.MerchantResponseMonthlyTotalAmount) []*pb.MerchantResponseMonthlyTotalAmount
mapResponsesYearlyAmountmapResponsesYearlyAmount maps a list of *response.MerchantResponseYearlyAmount to a list of *pb.MerchantResponseYearlyAmount proto responses.
It iterates over each MerchantResponseYearlyAmount in the input slice, converting them to their protobuf equivalent using the mapResponseYearlyAmount function. This function is used to generate the response data for yearly amount RPC methods.
func (s *merchantProtoMapper) mapResponsesYearlyAmount(roles []*response.MerchantResponseYearlyAmount) []*pb.MerchantResponseYearlyAmount
mapResponsesYearlyPaymentMethodmapResponsesYearlyPaymentMethod maps a list of *response.MerchantResponseYearlyPaymentMethod to a list of *pb.MerchantResponseYearlyPaymentMethod proto responses.
It iterates over each MerchantResponseYearlyPaymentMethod in the input slice, converting them to their protobuf equivalent using the mapResponseYearlyPaymentMethod function. This function is used to generate the response data for yearly payment method RPC methods.
func (s *merchantProtoMapper) mapResponsesYearlyPaymentMethod(roles []*response.MerchantResponseYearlyPaymentMethod) []*pb.MerchantResponseYearlyPaymentMethod
mapResponsesYearlyTotalAmountmapResponsesYearlyTotalAmount maps a list of *response.MerchantResponseYearlyTotalAmount to a list of *pb.MerchantResponseYearlyTotalAmount proto responses.
It iterates over each MerchantResponseYearlyTotalAmount in the input slice, converting them to their protobuf equivalent using the mapResponseYearlyTotalAmount function. This function is used to generate the response data for yearly total amount RPC methods.
func (s *merchantProtoMapper) mapResponsesYearlyTotalAmount(roles []*response.MerchantResponseYearlyTotalAmount) []*pb.MerchantResponseYearlyTotalAmount
roleProtoMapper
type roleProtoMapper struct {
}
Methods
ToProtoResponsePaginationRoleToProtoResponsePaginationRole maps paginated role responses to a protobuf message.
Args:
- pagination: A pointer to the pagination metadata for the response.
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
- pbResponse: A slice of pointers to RoleResponse to be mapped.
Returns:
- A pointer to a pb.ApiResponsePaginationRole containing the mapped data.
func (s *roleProtoMapper) ToProtoResponsePaginationRole(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.RoleResponse) *pb.ApiResponsePaginationRole
ToProtoResponsePaginationRoleDeleteAtToProtoResponsePaginationRoleDeleteAt maps paginated soft-deleted role responses to a protobuf message.
Args:
- pagination: A pointer to the pagination metadata for the response.
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
- pbResponse: A slice of pointers to RoleResponseDeleteAt to be mapped.
Returns:
- A pointer to a pb.ApiResponsePaginationRoleDeleteAt containing the mapped data.
func (s *roleProtoMapper) ToProtoResponsePaginationRoleDeleteAt(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.RoleResponseDeleteAt) *pb.ApiResponsePaginationRoleDeleteAt
ToProtoResponseRoleToProtoResponseRole converts a single role response to a protobuf message.
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
- pbResponse: A pointer to the role response to be mapped.
Returns:
- A pointer to a pb.ApiResponseRole containing the mapped data.
func (s *roleProtoMapper) ToProtoResponseRole(status string, message string, pbResponse *response.RoleResponse) *pb.ApiResponseRole
ToProtoResponseRoleAllToProtoResponseRoleAll returns a protobuf message for all roles without pagination.
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
Returns:
- A pointer to a pb.ApiResponseRoleAll containing the mapped data.
func (s *roleProtoMapper) ToProtoResponseRoleAll(status string, message string) *pb.ApiResponseRoleAll
ToProtoResponseRoleDeleteToProtoResponseRoleDelete returns a protobuf message indicating a role has been deleted.
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
Returns:
- A pointer to a pb.ApiResponseRoleDelete containing the status and message.
func (s *roleProtoMapper) ToProtoResponseRoleDelete(status string, message string) *pb.ApiResponseRoleDelete
ToProtoResponsesRoleToProtoResponsesRole converts a list of role responses to a protobuf message.
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
- pbResponse: A slice of pointers to RoleResponse to be mapped.
Returns:
- A pointer to a pb.ApiResponsesRole containing the mapped data.
func (s *roleProtoMapper) ToProtoResponsesRole(status string, message string, pbResponse []*response.RoleResponse) *pb.ApiResponsesRole
mapResponseRolemapResponseRole maps a single role response to a protobuf message.
Args:
- role: A pointer to the role response to be mapped.
Returns:
- A pointer to a pb.RoleResponse containing the mapped data.
func (s *roleProtoMapper) mapResponseRole(role *response.RoleResponse) *pb.RoleResponse
mapResponseRoleDeleteAtmapResponseRoleDeleteAt maps a RoleResponseDeleteAt to its protobuf representation.
Args:
- role: A pointer to a RoleResponseDeleteAt containing the details of the role.
Returns:
- A pointer to a pb.RoleResponseDeleteAt containing the mapped data, including ID, Name, CreatedAt, UpdatedAt, and potentially DeletedAt, if available.
func (s *roleProtoMapper) mapResponseRoleDeleteAt(role *response.RoleResponseDeleteAt) *pb.RoleResponseDeleteAt
mapResponsesRolemapResponsesRole maps a list of *response.RoleResponse to a list of *pb.RoleResponse proto responses.
It iterates over each RoleResponse in the input slice, converting them to their protobuf equivalent using the mapResponseRole function. This function is used to generate the response data for role RPC methods.
func (s *roleProtoMapper) mapResponsesRole(roles []*response.RoleResponse) []*pb.RoleResponse
mapResponsesRoleDeleteAtmapResponsesRoleDeleteAt maps a list of *response.RoleResponseDeleteAt to a list of *pb.RoleResponseDeleteAt proto responses.
It iterates over each RoleResponseDeleteAt in the input slice, converting them to their protobuf equivalent using the mapResponseRoleDeleteAt function. This function is used to generate the response data for the RoleService.ListDeletedRole rpc method.
func (s *roleProtoMapper) mapResponsesRoleDeleteAt(roles []*response.RoleResponseDeleteAt) []*pb.RoleResponseDeleteAt
saldoProtoMapper
type saldoProtoMapper struct {
}
Methods
ToProtoResponseMonthSaldoBalancesToProtoResponseMonthSaldoBalances maps a status, message and a list of *response.SaldoMonthBalanceResponse to a *pb.ApiResponseMonthSaldoBalances proto response.
It is used to generate the response for the SaldoService.GetMonthlySaldoBalances rpc method.
func (s *saldoProtoMapper) ToProtoResponseMonthSaldoBalances(status string, message string, pbResponse []*response.SaldoMonthBalanceResponse) *pb.ApiResponseMonthSaldoBalances
ToProtoResponseMonthTotalSaldoToProtoResponseMonthTotalSaldo maps a status, message and a list of *response.SaldoMonthTotalBalanceResponse to a *pb.ApiResponseMonthTotalSaldo proto response.
It is used to generate the response for the SaldoService.GetMonthlyTotalSaldoBalance rpc method.
func (s *saldoProtoMapper) ToProtoResponseMonthTotalSaldo(status string, message string, pbResponse []*response.SaldoMonthTotalBalanceResponse) *pb.ApiResponseMonthTotalSaldo
ToProtoResponsePaginationSaldoToProtoResponsePaginationSaldo maps a status, message, pagination meta, and a list of *response.SaldoResponse to a *pb.ApiResponsePaginationSaldo proto response.
It is used to generate the response for the SaldoService.ListSaldo rpc method.
Args:
pagination: The pagination data for the paginated response.
status: The status of the response.
message: The message accompanying the response.
pbResponse: A slice of SaldoResponse to be converted.
Returns:
A pointer to an ApiResponsePaginationSaldo containing the status, message, data, and pagination data.
func (s *saldoProtoMapper) ToProtoResponsePaginationSaldo(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.SaldoResponse) *pb.ApiResponsePaginationSaldo
ToProtoResponsePaginationSaldoDeleteAtToProtoResponsePaginationSaldoDeleteAt creates a new instance of ApiResponsePaginationSaldoDeleteAt.
It maps the provided pagination metadata, status, message, and a list of SaldoResponseDeleteAt to its protobuf representation.
Args:
pagination: The pagination data for the paginated response.
status: The status of the API response.
message: A descriptive message of the API response.
pbResponse: The list of SaldoResponseDeleteAt that needs to be converted.
Returns:
A pointer to ApiResponsePaginationSaldoDeleteAt containing the status, message, saldo data, and pagination data.
func (s *saldoProtoMapper) ToProtoResponsePaginationSaldoDeleteAt(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.SaldoResponseDeleteAt) *pb.ApiResponsePaginationSaldoDeleteAt
ToProtoResponseSaldoToProtoResponseSaldo maps a SaldoResponse to an ApiResponseSaldo proto message.
Args:
status: The status of the response.
message: The message accompanying the response.
pbResponse: The SaldoResponse to be converted.
Returns:
A pointer to an ApiResponseSaldo containing the mapped data.
func (s *saldoProtoMapper) ToProtoResponseSaldo(status string, message string, pbResponse *response.SaldoResponse) *pb.ApiResponseSaldo
ToProtoResponseSaldoAllToProtoResponseSaldoAll maps a status and message to an ApiResponseSaldoAll proto response.
Args:
status: The status of the response.
message: The message accompanying the response.
Returns:
A pointer to an ApiResponseSaldoAll containing the mapped data.
func (s *saldoProtoMapper) ToProtoResponseSaldoAll(status string, message string) *pb.ApiResponseSaldoAll
ToProtoResponseSaldoDeleteToProtoResponseSaldoDelete maps a status and message to an ApiResponseSaldoDelete proto response.
It is used to generate the response for the SaldoService.DeleteSaldo rpc method.
func (s *saldoProtoMapper) ToProtoResponseSaldoDelete(status string, message string) *pb.ApiResponseSaldoDelete
ToProtoResponseYearSaldoBalancesToProtoResponseYearSaldoBalances maps a status, message, and a list of *response.SaldoYearBalanceResponse to a *pb.ApiResponseYearSaldoBalances proto response.
It is used to generate the response for the SaldoService.GetYearlySaldoBalances rpc method.
Args:
status: The status of the response.
message: The message accompanying the response.
pbResponse: A slice of SaldoYearBalanceResponse to be converted.
Returns:
A pointer to an ApiResponseYearSaldoBalances containing the mapped data.
func (s *saldoProtoMapper) ToProtoResponseYearSaldoBalances(status string, message string, pbResponse []*response.SaldoYearBalanceResponse) *pb.ApiResponseYearSaldoBalances
ToProtoResponseYearTotalSaldoToProtoResponseYearTotalSaldo maps a status, message and a list of *response.SaldoYearTotalBalanceResponse to a *pb.ApiResponseYearTotalSaldo proto response.
It is used to generate the response for the SaldoService.GetYearlyTotalSaldoBalance rpc method.
func (s *saldoProtoMapper) ToProtoResponseYearTotalSaldo(status string, message string, pbResponse []*response.SaldoYearTotalBalanceResponse) *pb.ApiResponseYearTotalSaldo
ToProtoResponsesSaldoToProtoResponsesSaldo maps a list of SaldoResponse to an ApiResponsesSaldo proto message.
Args:
status: The status of the response.
message: The message accompanying the response.
pbResponse: A slice of SaldoResponse to be converted.
Returns:
A pointer to an ApiResponsesSaldo containing the mapped data.
func (s *saldoProtoMapper) ToProtoResponsesSaldo(status string, message string, pbResponse []*response.SaldoResponse) *pb.ApiResponsesSaldo
mapResponseSaldomapResponseSaldo maps a SaldoResponse to its protobuf representation.
Args:
saldo: The SaldoResponse to be converted.
Returns:
A pointer to SaldoResponse containing the mapped data.
func (s *saldoProtoMapper) mapResponseSaldo(saldo *response.SaldoResponse) *pb.SaldoResponse
mapResponseSaldoDeleteAtmapResponseSaldoDeleteAt maps a single response.SaldoResponseDeleteAt to a single *pb.SaldoResponseDeleteAt proto response.
Args:
saldo: The SaldoResponseDeleteAt to be converted.
Returns:
A pointer to a SaldoResponseDeleteAt containing the mapped data.
func (s *saldoProtoMapper) mapResponseSaldoDeleteAt(saldo *response.SaldoResponseDeleteAt) *pb.SaldoResponseDeleteAt
mapResponsesSaldomapResponsesSaldo maps a list of SaldoResponse to a list of *pb.SaldoResponse proto responses.
It iterates over each SaldoResponse in the input slice, converting them to their protobuf equivalent using the mapResponseSaldo function. This function is used to generate the response data for ListSaldo rpc methods.
func (s *saldoProtoMapper) mapResponsesSaldo(saldos []*response.SaldoResponse) []*pb.SaldoResponse
mapResponsesSaldoDeleteAtmapResponsesSaldoDeleteAt maps a list of *response.SaldoResponseDeleteAt to a list of *pb.SaldoResponseDeleteAt proto responses.
It iterates over each SaldoResponseDeleteAt in the input slice, converting them to their protobuf equivalent using the mapResponseSaldoDeleteAt function. This function is used to generate the response data for Saldo-related RPC methods involving deleted saldo records.
func (s *saldoProtoMapper) mapResponsesSaldoDeleteAt(saldos []*response.SaldoResponseDeleteAt) []*pb.SaldoResponseDeleteAt
mapSaldoMonthBalanceResponsemapSaldoMonthBalanceResponse maps a *response.SaldoMonthBalanceResponse to a *pb.SaldoMonthBalanceResponse proto response.
It takes a SaldoMonthBalanceResponse from the response domain model and converts it into its protobuf representation, ensuring that the month and total balance fields are accurately mapped.
Args:
ss: The SaldoMonthBalanceResponse to be converted.
Returns:
A pointer to a SaldoMonthBalanceResponse containing the mapped data.
func (s *saldoProtoMapper) mapSaldoMonthBalanceResponse(ss *response.SaldoMonthBalanceResponse) *pb.SaldoMonthBalanceResponse
mapSaldoMonthBalanceResponsesmapSaldoMonthBalanceResponses maps a list of *response.SaldoMonthBalanceResponse to a list of *pb.SaldoMonthBalanceResponse proto responses.
It iterates over each SaldoMonthBalanceResponse in the input slice, converting them to their protobuf equivalent using the mapSaldoMonthBalanceResponse function. This function is used to generate the response data for monthly balance RPC methods.
func (s *saldoProtoMapper) mapSaldoMonthBalanceResponses(ss []*response.SaldoMonthBalanceResponse) []*pb.SaldoMonthBalanceResponse
mapSaldoMonthTotalBalanceResponsemapSaldoMonthTotalBalanceResponse maps a *response.SaldoMonthTotalBalanceResponse to a *pb.SaldoMonthTotalBalanceResponse.
It maps the fields of the input response to the corresponding fields of the output response. The TotalBalance field is converted to int32.
Args:
ss: The SaldoMonthTotalBalanceResponse to be converted.
Returns:
A pointer to a SaldoMonthTotalBalanceResponse containing the mapped data.
func (s *saldoProtoMapper) mapSaldoMonthTotalBalanceResponse(ss *response.SaldoMonthTotalBalanceResponse) *pb.SaldoMonthTotalBalanceResponse
mapSaldoMonthTotalBalanceResponsesmapSaldoMonthTotalBalanceResponses maps a list of *response.SaldoMonthTotalBalanceResponse to a list of *pb.SaldoMonthTotalBalanceResponse proto responses.
It iterates over each SaldoMonthTotalBalanceResponse in the input slice, converting them to their protobuf equivalent using the mapSaldoMonthTotalBalanceResponse function. This function is used to generate the response data for monthly total saldo balance RPC methods.
Args:
ss: A slice of SaldoMonthTotalBalanceResponse to be converted.
Returns:
A slice of SaldoMonthTotalBalanceResponse containing the mapped data.
func (s *saldoProtoMapper) mapSaldoMonthTotalBalanceResponses(ss []*response.SaldoMonthTotalBalanceResponse) []*pb.SaldoMonthTotalBalanceResponse
mapSaldoYearBalanceResponsemapSaldoYearBalanceResponse maps a *response.SaldoYearBalanceResponse to a *pb.SaldoYearBalanceResponse proto response.
It takes a SaldoYearBalanceResponse from the response domain model and converts it into its protobuf representation, ensuring that the year and total balance fields are accurately mapped.
Args:
ss: The SaldoYearBalanceResponse to be converted.
Returns:
A pointer to SaldoYearBalanceResponse containing the mapped data.
func (s *saldoProtoMapper) mapSaldoYearBalanceResponse(ss *response.SaldoYearBalanceResponse) *pb.SaldoYearBalanceResponse
mapSaldoYearBalanceResponsesmapSaldoYearBalanceResponses maps a list of *response.SaldoYearBalanceResponse to a list of *pb.SaldoYearBalanceResponse proto responses.
It iterates over each SaldoYearBalanceResponse in the input slice, converting them to their protobuf equivalent using the mapSaldoYearBalanceResponse function. This function is used to generate the response data for yearly balance RPC methods.
func (s *saldoProtoMapper) mapSaldoYearBalanceResponses(ss []*response.SaldoYearBalanceResponse) []*pb.SaldoYearBalanceResponse
mapSaldoYearTotalBalanceResponsemapSaldoYearTotalBalanceResponse maps a *response.SaldoYearTotalBalanceResponse to a *pb.SaldoYearTotalBalanceResponse proto response.
It takes a SaldoYearTotalBalanceResponse from the response domain model and converts it into its protobuf representation, ensuring that the year and total balance fields are accurately mapped.
Args:
ss: The SaldoYearTotalBalanceResponse to be converted.
Returns:
A pointer to a SaldoYearTotalBalanceResponse containing the mapped data.
func (s *saldoProtoMapper) mapSaldoYearTotalBalanceResponse(ss *response.SaldoYearTotalBalanceResponse) *pb.SaldoYearTotalBalanceResponse
mapSaldoYearTotalBalanceResponsesmapSaldoYearTotalBalanceResponses maps a list of *response.SaldoYearTotalBalanceResponse to a list of *pb.SaldoYearTotalBalanceResponse proto responses.
It iterates over each SaldoYearTotalBalanceResponse in the input slice, converting them to their protobuf equivalent using the mapSaldoYearTotalBalanceResponse function. This function is used to generate the response data for yearly total saldo balance RPC methods.
func (s *saldoProtoMapper) mapSaldoYearTotalBalanceResponses(ss []*response.SaldoYearTotalBalanceResponse) []*pb.SaldoYearTotalBalanceResponse
topupProtoMapper
topupProtoMapper is responsible for mapping Topup responses to their corresponding protobuf representations.
type topupProtoMapper struct {
}
Methods
ToProtoResponsePaginationTopupToProtoResponsePaginationTopup maps paginated top-up records to a protobuf response.
Args:
- pagination: The pagination metadata for the response.
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupResponse that needs to be converted.
Returns:
A pointer to ApiResponsePaginationTopup containing the status, message, top-up data, and pagination data.
func (t *topupProtoMapper) ToProtoResponsePaginationTopup(pagination *pb.PaginationMeta, status string, message string, s []*response.TopupResponse) *pb.ApiResponsePaginationTopup
ToProtoResponsePaginationTopupDeleteAtToProtoResponsePaginationTopupDeleteAt maps paginated soft-deleted top-up records to a protobuf response.
Args:
- pagination: The pagination metadata for the response.
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupResponseDeleteAt that needs to be converted.
Returns:
A pointer to ApiResponsePaginationTopupDeleteAt containing the status, message, top-up data, and pagination data.
func (t *topupProtoMapper) ToProtoResponsePaginationTopupDeleteAt(pagination *pb.PaginationMeta, status string, message string, s []*response.TopupResponseDeleteAt) *pb.ApiResponsePaginationTopupDeleteAt
ToProtoResponseTopupToProtoResponseTopup maps a single top-up record to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A pointer to TopupResponse that needs to be converted.
Returns:
A pointer to ApiResponseTopup containing the status, message, and top-up data.
func (t *topupProtoMapper) ToProtoResponseTopup(status string, message string, s *response.TopupResponse) *pb.ApiResponseTopup
ToProtoResponseTopupAllToProtoResponseTopupAll returns all top-up records in a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
Returns:
- A pointer to ApiResponseTopupAll containing the status and message.
func (t topupProtoMapper) ToProtoResponseTopupAll(status string, message string) *pb.ApiResponseTopupAll
ToProtoResponseTopupDeletAtToProtoResponseTopupDeletAt maps a soft-deleted top-up record to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A pointer to TopupResponseDeleteAt that needs to be converted.
Returns:
- A pointer to ApiResponseTopupDeleteAt containing the status, message, and mapped top-up data.
func (t *topupProtoMapper) ToProtoResponseTopupDeletAt(status string, message string, s *response.TopupResponseDeleteAt) *pb.ApiResponseTopupDeleteAt
ToProtoResponseTopupDeleteToProtoResponseTopupDelete returns a response indicating a top-up record has been deleted.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
Returns:
A pointer to ApiResponseTopupDelete containing the status and message.
func (t topupProtoMapper) ToProtoResponseTopupDelete(status string, message string) *pb.ApiResponseTopupDelete
ToProtoResponseTopupMonthAmountToProtoResponseTopupMonthAmount maps monthly top-up amounts to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupMonthAmountResponse that needs to be converted.
Returns:
- A pointer to ApiResponseTopupMonthAmount containing the status, message, and mapped top-up amount data.
func (t *topupProtoMapper) ToProtoResponseTopupMonthAmount(status string, message string, s []*response.TopupMonthAmountResponse) *pb.ApiResponseTopupMonthAmount
ToProtoResponseTopupMonthMethodToProtoResponseTopupMonthMethod maps monthly top-up methods to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupMonthMethodResponse that needs to be converted.
Returns:
A pointer to ApiResponseTopupMonthMethod containing the status, message, and top-up data.
func (t *topupProtoMapper) ToProtoResponseTopupMonthMethod(status string, message string, s []*response.TopupMonthMethodResponse) *pb.ApiResponseTopupMonthMethod
ToProtoResponseTopupMonthStatusFailedToProtoResponseTopupMonthStatusFailed maps monthly failed top-ups to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupResponseMonthStatusFailed that needs to be converted.
Returns:
A pointer to ApiResponseTopupMonthStatusFailed containing the status, message, and top-up data.
func (t *topupProtoMapper) ToProtoResponseTopupMonthStatusFailed(status string, message string, s []*response.TopupResponseMonthStatusFailed) *pb.ApiResponseTopupMonthStatusFailed
ToProtoResponseTopupMonthStatusSuccessToProtoResponseTopupMonthStatusSuccess maps monthly successful top-ups to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupResponseMonthStatusSuccess that needs to be converted.
Returns:
A pointer to ApiResponseTopupMonthStatusSuccess containing the status, message, and top-up data.
func (t *topupProtoMapper) ToProtoResponseTopupMonthStatusSuccess(status string, message string, s []*response.TopupResponseMonthStatusSuccess) *pb.ApiResponseTopupMonthStatusSuccess
ToProtoResponseTopupYearAmountToProtoResponseTopupYearAmount maps yearly top-up amounts to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupYearlyAmountResponse that needs to be converted.
Returns:
- A pointer to ApiResponseTopupYearAmount containing the status, message, and mapped top-up amount data.
func (t *topupProtoMapper) ToProtoResponseTopupYearAmount(status string, message string, s []*response.TopupYearlyAmountResponse) *pb.ApiResponseTopupYearAmount
ToProtoResponseTopupYearMethodToProtoResponseTopupYearMethod maps yearly top-up methods to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupYearlyMethodResponse that needs to be converted.
Returns:
A pointer to ApiResponseTopupYearMethod containing the status, message, and top-up data.
func (t *topupProtoMapper) ToProtoResponseTopupYearMethod(status string, message string, s []*response.TopupYearlyMethodResponse) *pb.ApiResponseTopupYearMethod
ToProtoResponseTopupYearStatusFailedToProtoResponseTopupYearStatusFailed maps yearly failed top-ups to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupResponseYearStatusFailed that needs to be converted.
Returns:
A pointer to ApiResponseTopupYearStatusFailed containing the status, message, and top-up data.
func (t *topupProtoMapper) ToProtoResponseTopupYearStatusFailed(status string, message string, s []*response.TopupResponseYearStatusFailed) *pb.ApiResponseTopupYearStatusFailed
ToProtoResponseTopupYearStatusSuccessToProtoResponseTopupYearStatusSuccess maps yearly successful top-ups to a protobuf response.
Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- s: A slice of TopupResponseYearStatusSuccess that needs to be converted.
Returns:
A pointer to ApiResponseTopupYearStatusSuccess containing the status, message, and top-up data.
func (t *topupProtoMapper) ToProtoResponseTopupYearStatusSuccess(status string, message string, s []*response.TopupResponseYearStatusSuccess) *pb.ApiResponseTopupYearStatusSuccess
mapResponseTopupmapResponseTopup maps a single TopupResponse to its corresponding protobuf response.
Args:
- topup: A pointer to TopupResponse that needs to be converted.
Returns:
- A pointer to TopupResponse containing the mapped top-up data.
func (t *topupProtoMapper) mapResponseTopup(topup *response.TopupResponse) *pb.TopupResponse
mapResponseTopupDeleteAtmapResponseTopupDeleteAt maps a single TopupResponseDeleteAt to its corresponding protobuf response.
Args:
- topup: A pointer to TopupResponseDeleteAt that needs to be converted.
Returns:
- A pointer to TopupResponseDeleteAt containing the mapped top-up data.
func (t *topupProtoMapper) mapResponseTopupDeleteAt(topup *response.TopupResponseDeleteAt) *pb.TopupResponseDeleteAt
mapResponseTopupMonthStatusFailedmapResponseTopupMonthStatusFailed maps a TopupResponseMonthStatusFailed to a TopupMonthStatusFailedResponse protobuf message.
Args:
- s: A pointer to TopupResponseMonthStatusFailed that needs to be converted.
Returns:
- A pointer to TopupMonthStatusFailedResponse containing the mapped monthly top-up failure data.
func (t *topupProtoMapper) mapResponseTopupMonthStatusFailed(s *response.TopupResponseMonthStatusFailed) *pb.TopupMonthStatusFailedResponse
mapResponseTopupMonthStatusSuccessmapResponseTopupMonthStatusSuccess maps a TopupResponseMonthStatusSuccess to a TopupMonthStatusSuccessResponse.
Args:
- s: A pointer to TopupResponseMonthStatusSuccess that needs to be converted.
Returns:
- A pointer to TopupMonthStatusSuccessResponse containing the mapped top-up data.
func (t *topupProtoMapper) mapResponseTopupMonthStatusSuccess(s *response.TopupResponseMonthStatusSuccess) *pb.TopupMonthStatusSuccessResponse
mapResponseTopupMonthlyAmountmapResponseTopupMonthlyAmount maps a TopupMonthAmountResponse to a TopupMonthAmountResponse protobuf message.
Args:
- s: A pointer to TopupMonthAmountResponse that needs to be converted.
Returns:
- A pointer to TopupMonthAmountResponse containing the mapped monthly top-up amount data.
func (t *topupProtoMapper) mapResponseTopupMonthlyAmount(s *response.TopupMonthAmountResponse) *pb.TopupMonthAmountResponse
mapResponseTopupMonthlyAmountsmapResponseTopupMonthlyAmounts maps a slice of TopupMonthAmountResponse to a slice of TopupMonthAmountResponse protobuf messages.
Args:
- s: A slice of TopupMonthAmountResponse that needs to be converted.
Returns:
- A slice of TopupMonthAmountResponse containing the mapped monthly top-up amount data.
func (t *topupProtoMapper) mapResponseTopupMonthlyAmounts(s []*response.TopupMonthAmountResponse) []*pb.TopupMonthAmountResponse
mapResponseTopupMonthlyMethodmapResponseTopupMonthlyMethod maps a TopupMonthMethodResponse to a TopupMonthMethodResponse protobuf message.
Args:
- s: A pointer to TopupMonthMethodResponse that needs to be converted.
Returns:
- A pointer to TopupMonthMethodResponse containing the mapped monthly top-up method data.
func (t *topupProtoMapper) mapResponseTopupMonthlyMethod(s *response.TopupMonthMethodResponse) *pb.TopupMonthMethodResponse
mapResponseTopupMonthlyMethodsmapResponseTopupMonthlyMethods maps a slice of TopupMonthMethodResponse to a slice of TopupMonthMethodResponse protobuf messages.
Args:
- s: A slice of TopupMonthMethodResponse that needs to be converted.
Returns:
- A slice of TopupMonthMethodResponse containing the mapped monthly top-up method data.
func (t *topupProtoMapper) mapResponseTopupMonthlyMethods(s []*response.TopupMonthMethodResponse) []*pb.TopupMonthMethodResponse
mapResponseTopupYearlyAmountmapResponseTopupYearlyAmount maps a TopupYearlyAmountResponse to a TopupYearlyAmountResponse protobuf message.
Args:
- s: A pointer to TopupYearlyAmountResponse that needs to be converted.
Returns:
- A pointer to TopupYearlyAmountResponse containing the mapped yearly top-up amount data.
func (t *topupProtoMapper) mapResponseTopupYearlyAmount(s *response.TopupYearlyAmountResponse) *pb.TopupYearlyAmountResponse
mapResponseTopupYearlyAmountsmapResponseTopupYearlyAmounts maps a slice of TopupYearlyAmountResponse to a slice of TopupYearlyAmountResponse protobuf messages.
Args:
- s: A slice of TopupYearlyAmountResponse that needs to be converted.
Returns:
- A slice of TopupYearlyAmountResponse containing the mapped yearly top-up amount data.
func (t *topupProtoMapper) mapResponseTopupYearlyAmounts(s []*response.TopupYearlyAmountResponse) []*pb.TopupYearlyAmountResponse
mapResponseTopupYearlyMethodmapResponseTopupYearlyMethod maps a TopupYearlyMethodResponse to a TopupYearlyMethodResponse protobuf message.
Args:
- s: A pointer to TopupYearlyMethodResponse that needs to be converted.
Returns:
- A pointer to TopupYearlyMethodResponse containing the mapped yearly top-up method data.
func (t *topupProtoMapper) mapResponseTopupYearlyMethod(s *response.TopupYearlyMethodResponse) *pb.TopupYearlyMethodResponse
mapResponseTopupYearlyMethodsmapResponseTopupYearlyMethods maps a slice of TopupYearlyMethodResponse to a slice of TopupYearlyMethodResponse protobuf messages.
Args:
- s: A slice of TopupYearlyMethodResponse that needs to be converted.
Returns:
- A slice of TopupYearlyMethodResponse containing the mapped yearly top-up method data.
func (t *topupProtoMapper) mapResponseTopupYearlyMethods(s []*response.TopupYearlyMethodResponse) []*pb.TopupYearlyMethodResponse
mapResponsesTopupmapResponsesTopup maps a slice of TopupResponse to a slice of TopupResponse.
Args:
- topups: A slice of TopupResponse that needs to be converted.
Returns:
- A slice of TopupResponse containing the mapped top-up data.
func (t *topupProtoMapper) mapResponsesTopup(topups []*response.TopupResponse) []*pb.TopupResponse
mapResponsesTopupDeleteAtmapResponsesTopupDeleteAt maps a slice of TopupResponseDeleteAt to a slice of TopupResponseDeleteAt.
Args:
- topups: A slice of TopupResponseDeleteAt that needs to be converted.
Returns:
- A slice of TopupResponseDeleteAt containing the mapped top-up data.
func (t *topupProtoMapper) mapResponsesTopupDeleteAt(topups []*response.TopupResponseDeleteAt) []*pb.TopupResponseDeleteAt
mapResponsesTopupMonthStatusFailedmapResponsesTopupMonthStatusFailed converts a slice of TopupResponseMonthStatusFailed into a slice of TopupMonthStatusFailedResponse protobuf messages.
Args:
- topups: A slice of TopupResponseMonthStatusFailed to be converted.
Returns:
- A slice of TopupMonthStatusFailedResponse containing the mapped data for each monthly top-up failure entry.
func (t *topupProtoMapper) mapResponsesTopupMonthStatusFailed(topups []*response.TopupResponseMonthStatusFailed) []*pb.TopupMonthStatusFailedResponse
mapResponsesTopupMonthStatusSuccessmapResponsesTopupMonthStatusSuccess maps a slice of TopupResponseMonthStatusSuccess to a slice of TopupMonthStatusSuccessResponse protobuf messages.
Args:
- topups: A slice of TopupResponseMonthStatusSuccess that needs to be converted.
Returns:
- A slice of TopupMonthStatusSuccessResponse containing the mapped monthly top-up success data.
func (t *topupProtoMapper) mapResponsesTopupMonthStatusSuccess(topups []*response.TopupResponseMonthStatusSuccess) []*pb.TopupMonthStatusSuccessResponse
mapTopupResponseYearStatusFailedmapTopupResponseYearStatusFailed maps a TopupResponseYearStatusFailed to a TopupYearStatusFailedResponse.
Args:
- s: A pointer to TopupResponseYearStatusFailed that needs to be converted.
Returns:
- A pointer to TopupYearStatusFailedResponse containing the mapped yearly top-up failure data.
func (t *topupProtoMapper) mapTopupResponseYearStatusFailed(s *response.TopupResponseYearStatusFailed) *pb.TopupYearStatusFailedResponse
mapTopupResponseYearStatusSuccessmapTopupResponseYearStatusSuccess maps a TopupResponseYearStatusSuccess to a TopupYearStatusSuccessResponse.
Args:
- s: A pointer to TopupResponseYearStatusSuccess that needs to be converted.
Returns:
- A pointer to TopupYearStatusSuccessResponse containing the mapped yearly top-up success data.
func (t *topupProtoMapper) mapTopupResponseYearStatusSuccess(s *response.TopupResponseYearStatusSuccess) *pb.TopupYearStatusSuccessResponse
mapTopupResponsesYearStatusFailedmapTopupResponsesYearStatusFailed maps a slice of TopupResponseYearStatusFailed into a slice of TopupYearStatusFailedResponse protobuf messages.
Args:
- topups: A slice of TopupResponseYearStatusFailed to be converted.
Returns:
- A slice of TopupYearStatusFailedResponse containing the mapped yearly top-up failure data for each yearly top-up failure entry.
func (t *topupProtoMapper) mapTopupResponsesYearStatusFailed(topups []*response.TopupResponseYearStatusFailed) []*pb.TopupYearStatusFailedResponse
mapTopupResponsesYearStatusSuccessmapTopupResponsesYearStatusSuccess maps a slice of TopupResponseYearStatusSuccess to a slice of TopupYearStatusSuccessResponse protobuf messages.
Args:
- topups: A slice of TopupResponseYearStatusSuccess that needs to be converted.
Returns:
- A slice of TopupYearStatusSuccessResponse containing the mapped yearly top-up success data.
func (t *topupProtoMapper) mapTopupResponsesYearStatusSuccess(topups []*response.TopupResponseYearStatusSuccess) []*pb.TopupYearStatusSuccessResponse
transactionProtoMapper
transactionProtoMapper is responsible for mapping Transaction responses to their corresponding protobuf representations.
type transactionProtoMapper struct {
}
Methods
ToProtoResponsePaginationTransactionToProtoResponsePaginationTransaction maps a pagination meta, status, message and a list of *response.TransactionResponse to a *pb.ApiResponsePaginationTransaction proto response.
It is used to generate the response for the TransactionService.ListTransaction rpc method.
func (m *transactionProtoMapper) ToProtoResponsePaginationTransaction(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.TransactionResponse) *pb.ApiResponsePaginationTransaction
ToProtoResponsePaginationTransactionDeleteAtToProtoResponsePaginationTransactionDeleteAt maps a pagination meta, status, message and a list of *response.TransactionResponseDeleteAt to a *pb.ApiResponsePaginationTransactionDeleteAt proto response.
It is used to generate the response for the TransactionService.ListTransactionDeleteAt rpc method.
func (m *transactionProtoMapper) ToProtoResponsePaginationTransactionDeleteAt(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.TransactionResponseDeleteAt) *pb.ApiResponsePaginationTransactionDeleteAt
ToProtoResponseTransactionToProtoResponseTransaction converts a status, message, and a TransactionResponse to its protobuf representation.
It includes the status, message, and mapped transaction data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The TransactionResponse that needs to be converted.
Returns:
A pointer to ApiResponseTransaction containing the status, message, and transaction data.
func (m *transactionProtoMapper) ToProtoResponseTransaction(status string, message string, pbResponse *response.TransactionResponse) *pb.ApiResponseTransaction
ToProtoResponseTransactionAllToProtoResponseTransactionAll generates a protobuf API response for all transactions.
It includes the status and message for the API response. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
Returns:
A pointer to ApiResponseTransactionAll containing the status and message.
func (m *transactionProtoMapper) ToProtoResponseTransactionAll(status string, message string) *pb.ApiResponseTransactionAll
ToProtoResponseTransactionDeleteToProtoResponseTransactionDelete generates a protobuf API response for a transaction delete operation.
It includes the status and message for the API response. Args:
- status: The status of the API response.
- message: A descriptive message for the API response.
Returns:
A pointer to ApiResponseTransactionDelete containing the status and message.
func (m *transactionProtoMapper) ToProtoResponseTransactionDelete(status string, message string) *pb.ApiResponseTransactionDelete
ToProtoResponseTransactionMonthAmountToProtoResponseTransactionMonthAmount converts a status, message, and a list of TransactionMonthAmountResponse to its protobuf representation.
It includes the status, message, and mapped transaction month amount data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionMonthAmountResponse that needs to be converted.
Returns:
A pointer to ApiResponseTransactionMonthAmount containing the status, message, and transaction month amount data.
func (m *transactionProtoMapper) ToProtoResponseTransactionMonthAmount(status string, message string, pbResponse []*response.TransactionMonthAmountResponse) *pb.ApiResponseTransactionMonthAmount
ToProtoResponseTransactionMonthMethodToProtoResponseTransactionMonthMethod converts a status, message, and a list of TransactionMonthMethodResponse to its protobuf representation.
It includes the status, message, and mapped transaction method data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionMonthMethodResponse that needs to be converted.
Returns:
A pointer to ApiResponseTransactionMonthMethod containing the status, message, and transaction method data.
func (m *transactionProtoMapper) ToProtoResponseTransactionMonthMethod(status string, message string, pbResponse []*response.TransactionMonthMethodResponse) *pb.ApiResponseTransactionMonthMethod
ToProtoResponseTransactionMonthStatusFailedToProtoResponseTransactionMonthStatusFailed converts a status, message, and a list of TransactionResponseMonthStatusFailed to its protobuf representation.
It includes the status, message, and mapped transaction data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionResponseMonthStatusFailed that needs to be converted.
Returns:
A pointer to ApiResponseTransactionMonthStatusFailed containing the status, message, and transaction data.
func (m *transactionProtoMapper) ToProtoResponseTransactionMonthStatusFailed(status string, message string, pbResponse []*response.TransactionResponseMonthStatusFailed) *pb.ApiResponseTransactionMonthStatusFailed
ToProtoResponseTransactionMonthStatusSuccessToProtoResponseTransactionMonthStatusSuccess converts a status, message, and a list of TransactionResponseMonthStatusSuccess to its protobuf representation.
It includes the status, message, and mapped transaction data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionResponseMonthStatusSuccess that needs to be converted.
Returns:
A pointer to ApiResponseTransactionMonthStatusSuccess containing the status, message, and transaction data.
func (m *transactionProtoMapper) ToProtoResponseTransactionMonthStatusSuccess(status string, message string, pbResponse []*response.TransactionResponseMonthStatusSuccess) *pb.ApiResponseTransactionMonthStatusSuccess
ToProtoResponseTransactionYearAmountToProtoResponseTransactionYearAmount converts a status, message, and a list of TransactionYearlyAmountResponse to its protobuf representation.
It includes the status, message, and mapped transaction year amount data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionYearlyAmountResponse that needs to be converted.
Returns:
A pointer to ApiResponseTransactionYearAmount containing the status, message, and transaction year amount data.
func (m *transactionProtoMapper) ToProtoResponseTransactionYearAmount(status string, message string, pbResponse []*response.TransactionYearlyAmountResponse) *pb.ApiResponseTransactionYearAmount
ToProtoResponseTransactionYearMethodToProtoResponseTransactionYearMethod converts a status, message, and a list of TransactionYearMethodResponse to its protobuf representation.
It includes the status, message, and mapped transaction method data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionYearMethodResponse that needs to be converted.
Returns:
A pointer to ApiResponseTransactionYearMethod containing the status, message, and transaction method data.
func (m *transactionProtoMapper) ToProtoResponseTransactionYearMethod(status string, message string, pbResponse []*response.TransactionYearMethodResponse) *pb.ApiResponseTransactionYearMethod
ToProtoResponseTransactionYearStatusFailedToProtoResponseTransactionYearStatusFailed converts a status, message, and a list of TransactionResponseYearStatusFailed to its protobuf representation.
It includes the status, message, and mapped transaction data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionResponseYearStatusFailed that needs to be converted.
Returns:
A pointer to ApiResponseTransactionYearStatusFailed containing the status, message, and transaction data.
func (m *transactionProtoMapper) ToProtoResponseTransactionYearStatusFailed(status string, message string, pbResponse []*response.TransactionResponseYearStatusFailed) *pb.ApiResponseTransactionYearStatusFailed
ToProtoResponseTransactionYearStatusSuccessToProtoResponseTransactionYearStatusSuccess converts a status, message, and a list of TransactionResponseYearStatusSuccess to its protobuf representation.
It includes the status, message, and mapped transaction data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionResponseYearStatusSuccess that needs to be converted.
Returns:
A pointer to ApiResponseTransactionYearStatusSuccess containing the status, message, and transaction data.
func (m *transactionProtoMapper) ToProtoResponseTransactionYearStatusSuccess(status string, message string, pbResponse []*response.TransactionResponseYearStatusSuccess) *pb.ApiResponseTransactionYearStatusSuccess
ToProtoResponseTransactionsToProtoResponseTransactions converts a status, message, and a list of TransactionResponse to its protobuf representation.
It includes the status, message, and mapped transaction data. Args:
- status: The status of the API response.
- message: A descriptive message of the API response.
- pbResponse: The list of TransactionResponse that needs to be converted.
Returns:
A pointer to ApiResponseTransactions containing the status, message, and transaction data.
func (m *transactionProtoMapper) ToProtoResponseTransactions(status string, message string, pbResponse []*response.TransactionResponse) *pb.ApiResponseTransactions
mapResponseTransactionmapResponseTransaction maps a single response.TransactionResponse to its protobuf representation.
It takes a response.TransactionResponse as input and returns a pointer to the converted TransactionResponse proto object.
func (m *transactionProtoMapper) mapResponseTransaction(transaction *response.TransactionResponse) *pb.TransactionResponse
mapResponseTransactionDeleteAtmapResponseTransactionDeleteAt maps a single response.TransactionResponseDeleteAt to its protobuf representation.
It takes a response.TransactionResponseDeleteAt as input and returns a pointer to the converted TransactionResponseDeleteAt proto object. The mapping includes fields like ID, TransactionNo, CardNumber, Amount, PaymentMethod, TransactionTime, MerchantId, CreatedAt, UpdatedAt, and DeletedAt.
func (m *transactionProtoMapper) mapResponseTransactionDeleteAt(transaction *response.TransactionResponseDeleteAt) *pb.TransactionResponseDeleteAt
mapResponseTransactionMonthAmountmapResponseTransactionMonthAmount maps a *response.TransactionMonthAmountResponse to a *pb.TransactionMonthAmountResponse proto message.
It takes a *response.TransactionMonthAmountResponse as input and returns a pointer to the converted TransactionMonthAmountResponse proto object. The mapping includes fields like Month and TotalAmount.
func (m *transactionProtoMapper) mapResponseTransactionMonthAmount(s *response.TransactionMonthAmountResponse) *pb.TransactionMonthAmountResponse
mapResponseTransactionMonthAmountsmapResponseTransactionMonthAmounts maps a slice of TransactionMonthAmountResponse to a slice of protobuf TransactionMonthAmountResponse.
It iterates through each TransactionMonthAmountResponse, converting it to its protobuf equivalent using the mapResponseTransactionMonthAmount function.
Args:
- s: A slice of TransactionMonthAmountResponse to be converted.
Returns:
- A slice of pointers to TransactionMonthAmountResponse containing the mapped data.
func (m *transactionProtoMapper) mapResponseTransactionMonthAmounts(s []*response.TransactionMonthAmountResponse) []*pb.TransactionMonthAmountResponse
mapResponseTransactionMonthMethodmapResponseTransactionMonthMethod maps a *response.TransactionMonthMethodResponse to a *pb.TransactionMonthMethodResponse proto message.
It takes a *response.TransactionMonthMethodResponse as input and returns a pointer to the converted TransactionMonthMethodResponse proto object. The mapping includes fields like Month, PaymentMethod, TotalTransactions, and TotalAmount.
func (m *transactionProtoMapper) mapResponseTransactionMonthMethod(s *response.TransactionMonthMethodResponse) *pb.TransactionMonthMethodResponse
mapResponseTransactionMonthMethodsmapResponseTransactionMonthMethods maps a slice of TransactionMonthMethodResponse to a slice of protobuf TransactionMonthMethodResponse.
It takes a slice of TransactionMonthMethodResponse as input and returns a slice of corresponding protobuf TransactionMonthMethodResponse. The mapping includes fields like Month, PaymentMethod, TotalTransactions, and TotalAmount.
func (m *transactionProtoMapper) mapResponseTransactionMonthMethods(s []*response.TransactionMonthMethodResponse) []*pb.TransactionMonthMethodResponse
mapResponseTransactionMonthStatusFailedmapResponseTransactionMonthStatusFailed maps a response.TransactionResponseMonthStatusFailed to its protobuf representation.
It takes a response.TransactionResponseMonthStatusFailed as input and returns a pointer to the converted TransactionMonthStatusFailedResponse proto object. The mapping includes fields like Year, Month, TotalFailed, and TotalAmount.
func (t *transactionProtoMapper) mapResponseTransactionMonthStatusFailed(s *response.TransactionResponseMonthStatusFailed) *pb.TransactionMonthStatusFailedResponse
mapResponseTransactionMonthStatusSuccessmapResponseTransactionMonthStatusSuccess maps a response.TransactionResponseMonthStatusSuccess to its protobuf representation.
It takes a response.TransactionResponseMonthStatusSuccess as input and returns a pointer to the converted TransactionMonthStatusSuccessResponse proto object. The mapping includes fields like Year, Month, TotalSuccess, and TotalAmount.
func (t *transactionProtoMapper) mapResponseTransactionMonthStatusSuccess(s *response.TransactionResponseMonthStatusSuccess) *pb.TransactionMonthStatusSuccessResponse
mapResponseTransactionYearMethodmapResponseTransactionYearMethod maps a *response.TransactionYearMethodResponse to a *pb.TransactionYearMethodResponse proto message.
It takes a *response.TransactionYearMethodResponse as input and returns a pointer to the converted TransactionYearMethodResponse proto object. The mapping includes fields like Year, PaymentMethod, TotalTransactions, and TotalAmount.
func (m *transactionProtoMapper) mapResponseTransactionYearMethod(s *response.TransactionYearMethodResponse) *pb.TransactionYearMethodResponse
mapResponseTransactionYearMethodsmapResponseTransactionYearMethods maps a slice of TransactionYearMethodResponse to a slice of protobuf TransactionYearMethodResponse.
It takes a slice of TransactionYearMethodResponse as input and returns a slice of corresponding protobuf TransactionYearMethodResponse. The mapping includes fields like Year, PaymentMethod, TotalTransactions, and TotalAmount.
func (m *transactionProtoMapper) mapResponseTransactionYearMethods(s []*response.TransactionYearMethodResponse) []*pb.TransactionYearMethodResponse
mapResponseTransactionYearlyAmountmapResponseTransactionYearlyAmount maps a *response.TransactionYearlyAmountResponse to a *pb.TransactionYearlyAmountResponse proto message.
It takes a *response.TransactionYearlyAmountResponse as input and returns a pointer to the converted TransactionYearlyAmountResponse proto object. The mapping includes fields like Year and TotalAmount.
func (m *transactionProtoMapper) mapResponseTransactionYearlyAmount(s *response.TransactionYearlyAmountResponse) *pb.TransactionYearlyAmountResponse
mapResponseTransactionYearlyAmountsmapResponseTransactionYearlyAmounts maps a slice of TransactionYearlyAmountResponse to a slice of protobuf TransactionYearlyAmountResponse.
It iterates through each TransactionYearlyAmountResponse, converting it to its protobuf equivalent using the mapResponseTransactionYearlyAmount function.
Args:
- s: A slice of TransactionYearlyAmountResponse to be converted.
Returns:
- A slice of pointers to TransactionYearlyAmountResponse containing the mapped data.
func (m *transactionProtoMapper) mapResponseTransactionYearlyAmounts(s []*response.TransactionYearlyAmountResponse) []*pb.TransactionYearlyAmountResponse
mapResponsesTransactionmapResponsesTransaction maps a slice of response.TransactionResponse to a slice of protobuf TransactionResponse.
It takes a slice of response.TransactionResponse as input and returns a slice of corresponding protobuf TransactionResponse. The mapping includes fields like ID, TransactionNo, CardNumber, Amount, PaymentMethod, TransactionTime, MerchantId, CreatedAt, and UpdatedAt.
func (m *transactionProtoMapper) mapResponsesTransaction(transactions []*response.TransactionResponse) []*pb.TransactionResponse
mapResponsesTransactionDeleteAtmapResponsesTransactionDeleteAt maps a slice of response.TransactionResponseDeleteAt to a slice of protobuf TransactionResponseDeleteAt.
Args:
- transactions: A slice of TransactionResponseDeleteAt to be converted.
Returns:
A slice of pointers to TransactionResponseDeleteAt containing the mapped data.
func (m *transactionProtoMapper) mapResponsesTransactionDeleteAt(transactions []*response.TransactionResponseDeleteAt) []*pb.TransactionResponseDeleteAt
mapResponsesTransactionMonthStatusFailedmapResponsesTransactionMonthStatusFailed converts a slice of TransactionResponseMonthStatusFailed to a slice of protobuf TransactionMonthStatusFailedResponse.
It iterates through each TransactionResponseMonthStatusFailed, mapping it to its protobuf equivalent using the mapResponseTransactionMonthStatusFailed function.
Args:
- Transactions: A slice of TransactionResponseMonthStatusFailed to be converted.
Returns:
A slice of pointers to TransactionMonthStatusFailedResponse containing the mapped data.
func (t *transactionProtoMapper) mapResponsesTransactionMonthStatusFailed(Transactions []*response.TransactionResponseMonthStatusFailed) []*pb.TransactionMonthStatusFailedResponse
mapResponsesTransactionMonthStatusSuccessmapResponsesTransactionMonthStatusSuccess converts a slice of TransactionResponseMonthStatusSuccess to a slice of protobuf TransactionMonthStatusSuccessResponse.
It iterates through each TransactionResponseMonthStatusSuccess, mapping it to its protobuf equivalent using the mapResponseTransactionMonthStatusSuccess function.
Args:
- Transactions: A slice of TransactionResponseMonthStatusSuccess to be converted.
Returns:
A slice of pointers to TransactionMonthStatusSuccessResponse containing the mapped data.
func (t *transactionProtoMapper) mapResponsesTransactionMonthStatusSuccess(Transactions []*response.TransactionResponseMonthStatusSuccess) []*pb.TransactionMonthStatusSuccessResponse
mapTransactionResponseYearStatusFailedmapTransactionResponseYearStatusFailed maps a response.TransactionResponseYearStatusFailed to its protobuf representation.
It takes a response.TransactionResponseYearStatusFailed as input and returns a pointer to the converted TransactionYearStatusFailedResponse proto object. The mapping includes fields like Year, TotalFailed, and TotalAmount.
Args:
- s: A pointer to a TransactionResponseYearStatusFailed to be converted.
Returns:
- A pointer to a TransactionYearStatusFailedResponse containing the mapped data.
func (t *transactionProtoMapper) mapTransactionResponseYearStatusFailed(s *response.TransactionResponseYearStatusFailed) *pb.TransactionYearStatusFailedResponse
mapTransactionResponseYearStatusSuccessmapTransactionResponseYearStatusSuccess maps a response.TransactionResponseYearStatusSuccess to its protobuf representation.
It takes a response.TransactionResponseYearStatusSuccess as input and returns a pointer to the converted TransactionYearStatusSuccessResponse proto object. The mapping includes fields like Year, TotalSuccess, and TotalAmount.
func (t *transactionProtoMapper) mapTransactionResponseYearStatusSuccess(s *response.TransactionResponseYearStatusSuccess) *pb.TransactionYearStatusSuccessResponse
mapTransactionResponsesYearStatusFailedmapTransactionResponsesYearStatusFailed maps a slice of TransactionResponseYearStatusFailed to a slice of protobuf TransactionYearStatusFailedResponse.
It iterates through each TransactionResponseYearStatusFailed, mapping it to its protobuf equivalent using the mapTransactionResponseYearStatusFailed function.
Args:
- Transactions: A slice of TransactionResponseYearStatusFailed to be converted.
Returns:
A slice of pointers to TransactionYearStatusFailedResponse containing the mapped data.
func (t *transactionProtoMapper) mapTransactionResponsesYearStatusFailed(Transactions []*response.TransactionResponseYearStatusFailed) []*pb.TransactionYearStatusFailedResponse
mapTransactionResponsesYearStatusSuccessmapTransactionResponsesYearStatusSuccess maps a slice of TransactionResponseYearStatusSuccess to a slice of protobuf TransactionYearStatusSuccessResponse.
It takes a slice of TransactionResponseYearStatusSuccess as input and returns a slice of corresponding protobuf TransactionYearStatusSuccessResponse. The mapping includes fields like Year, TotalSuccess, and TotalAmount.
func (t *transactionProtoMapper) mapTransactionResponsesYearStatusSuccess(Transactions []*response.TransactionResponseYearStatusSuccess) []*pb.TransactionYearStatusSuccessResponse
transferProtoMapper
transferProtoMapper is responsible for mapping Transfer responses to their corresponding protobuf representations.
type transferProtoMapper struct {
}
Methods
ToProtoResponsePaginationTransferToProtoResponsePaginationTransfer maps a pagination meta, status, message, and a list of TransferResponse to an ApiResponsePaginationTransfer proto message.
Args:
- pagination: The pagination meta that needs to be converted.
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: A slice of TransferResponse to be converted.
Returns:
- A pointer to an ApiResponsePaginationTransfer containing the mapped data.
func (m *transferProtoMapper) ToProtoResponsePaginationTransfer(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.TransferResponse) *pb.ApiResponsePaginationTransfer
ToProtoResponsePaginationTransferDeleteAtToProtoResponsePaginationTransferDeleteAt maps paginated soft-deleted transfer responses to a protobuf message.
Args:
- pagination: The pagination metadata for the response.
- status: The status of the API response.
- message: A descriptive message for the API response.
- pbResponse: A slice of TransferResponseDeleteAt objects to be included in the response.
Returns:
- A pointer to an ApiResponsePaginationTransferDeleteAt containing the status, message, transfer data, and pagination data.
func (m *transferProtoMapper) ToProtoResponsePaginationTransferDeleteAt(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.TransferResponseDeleteAt) *pb.ApiResponsePaginationTransferDeleteAt
ToProtoResponseTransferToProtoResponseTransfer maps a status, message, and a single TransferResponse to an ApiResponseTransfer proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: The TransferResponse to be converted.
Returns:
- A pointer to an ApiResponseTransfer containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransfer(status string, message string, pbResponse *response.TransferResponse) *pb.ApiResponseTransfer
ToProtoResponseTransferAllToProtoResponseTransferAll maps a status, message, and no data to an ApiResponseTransferAll proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
Returns:
- A pointer to an ApiResponseTransferAll containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransferAll(status string, message string) *pb.ApiResponseTransferAll
ToProtoResponseTransferDeleteToProtoResponseTransferDelete maps a status, message, and no data to an ApiResponseTransferDelete proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
Returns:
- A pointer to an ApiResponseTransferDelete containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransferDelete(status string, message string) *pb.ApiResponseTransferDelete
ToProtoResponseTransferMonthAmountToProtoResponseTransferMonthAmount maps a status, message, and a list of TransferMonthAmountResponse to an ApiResponseTransferMonthAmount proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: A slice of TransferMonthAmountResponse to be converted.
Returns:
- A pointer to an ApiResponseTransferMonthAmount containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransferMonthAmount(status string, message string, pbResponse []*response.TransferMonthAmountResponse) *pb.ApiResponseTransferMonthAmount
ToProtoResponseTransferMonthStatusFailedToProtoResponseTransferMonthStatusFailed maps a status, message, and a list of TransferResponseMonthStatusFailed to an ApiResponseTransferMonthStatusFailed proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: A slice of TransferResponseMonthStatusFailed to be converted.
Returns:
- A pointer to an ApiResponseTransferMonthStatusFailed containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransferMonthStatusFailed(status string, message string, pbResponse []*response.TransferResponseMonthStatusFailed) *pb.ApiResponseTransferMonthStatusFailed
ToProtoResponseTransferMonthStatusSuccessToProtoResponseTransferMonthStatusSuccess maps a status, message, and a list of TransferResponseMonthStatusSuccess to an ApiResponseTransferMonthStatusSuccess proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: A slice of TransferResponseMonthStatusSuccess to be converted.
Returns:
- A pointer to an ApiResponseTransferMonthStatusSuccess containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransferMonthStatusSuccess(status string, message string, pbResponse []*response.TransferResponseMonthStatusSuccess) *pb.ApiResponseTransferMonthStatusSuccess
ToProtoResponseTransferYearAmountToProtoResponseTransferYearAmount maps a status, message, and a list of TransferYearAmountResponse to an ApiResponseTransferYearAmount proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: A slice of TransferYearAmountResponse to be converted.
Returns:
- A pointer to an ApiResponseTransferYearAmount containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransferYearAmount(status string, message string, pbResponse []*response.TransferYearAmountResponse) *pb.ApiResponseTransferYearAmount
ToProtoResponseTransferYearStatusFailedToProtoResponseTransferYearStatusFailed maps a status, message, and a list of TransferResponseYearStatusFailed to an ApiResponseTransferYearStatusFailed proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: A slice of TransferResponseYearStatusFailed to be converted.
Returns:
- A pointer to an ApiResponseTransferYearStatusFailed containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransferYearStatusFailed(status string, message string, pbResponse []*response.TransferResponseYearStatusFailed) *pb.ApiResponseTransferYearStatusFailed
ToProtoResponseTransferYearStatusSuccessToProtoResponseTransferYearStatusSuccess maps a status, message, and a list of TransferResponseYearStatusSuccess to an ApiResponseTransferYearStatusSuccess proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: A slice of TransferResponseYearStatusSuccess to be converted.
Returns:
- A pointer to an ApiResponseTransferYearStatusSuccess containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransferYearStatusSuccess(status string, message string, pbResponse []*response.TransferResponseYearStatusSuccess) *pb.ApiResponseTransferYearStatusSuccess
ToProtoResponseTransfersToProtoResponseTransfers maps a status, message, and a list of TransferResponse to an ApiResponseTransfers proto message.
Args:
- status: The status of the response.
- message: The accompanying message of the response.
- pbResponse: A slice of TransferResponse to be converted.
Returns:
- A pointer to an ApiResponseTransfers containing the mapped data.
func (m *transferProtoMapper) ToProtoResponseTransfers(status string, message string, pbResponse []*response.TransferResponse) *pb.ApiResponseTransfers
mapResponseTransfermapResponseTransfer maps a TransferResponse to a TransferResponse proto message.
Args:
- transfer: The TransferResponse to be converted.
Returns:
- A pointer to a TransferResponse containing the mapped data.
func (t *transferProtoMapper) mapResponseTransfer(transfer *response.TransferResponse) *pb.TransferResponse
mapResponseTransferDeleteAtmapResponseTransferDeleteAt maps a TransferResponseDeleteAt to its protobuf representation.
Args:
- transfer: The TransferResponseDeleteAt that needs to be converted.
Returns:
- A pointer to a TransferResponseDeleteAt protobuf message containing the mapped data.
func (t *transferProtoMapper) mapResponseTransferDeleteAt(transfer *response.TransferResponseDeleteAt) *pb.TransferResponseDeleteAt
mapResponseTransferMonthAmountmapResponseTransferMonthAmount maps a TransferMonthAmountResponse to its protobuf representation.
Args:
- s: The TransferMonthAmountResponse that needs to be converted.
Returns:
- A pointer to a TransferMonthAmountResponse protobuf message containing the mapped data.
func (m *transferProtoMapper) mapResponseTransferMonthAmount(s *response.TransferMonthAmountResponse) *pb.TransferMonthAmountResponse
mapResponseTransferMonthAmountsmapResponseTransferMonthAmounts maps a slice of TransferMonthAmountResponse to a slice of TransferMonthAmountResponse protobuf messages.
It iterates over the input slice, converting each TransferMonthAmountResponse to its corresponding protobuf representation using the mapResponseTransferMonthAmount method.
Args:
- s: A slice of TransferMonthAmountResponse to be converted.
Returns:
- A slice of TransferMonthAmountResponse containing the mapped protobuf data.
func (m *transferProtoMapper) mapResponseTransferMonthAmounts(s []*response.TransferMonthAmountResponse) []*pb.TransferMonthAmountResponse
mapResponseTransferMonthStatusFailedmapResponseTransferMonthStatusFailed maps a TransferResponseMonthStatusFailed to its protobuf representation.
Args:
- s: The TransferResponseMonthStatusFailed that needs to be converted.
Returns:
- A pointer to a TransferMonthStatusFailedResponse protobuf message containing the mapped data.
func (t *transferProtoMapper) mapResponseTransferMonthStatusFailed(s *response.TransferResponseMonthStatusFailed) *pb.TransferMonthStatusFailedResponse
mapResponseTransferMonthStatusSuccessmapResponseTransferMonthStatusSuccess maps a TransferResponseMonthStatusSuccess to its protobuf representation.
Args:
- s: The TransferResponseMonthStatusSuccess that needs to be converted.
Returns:
- A pointer to a TransferMonthStatusSuccessResponse protobuf message containing the mapped data.
func (t *transferProtoMapper) mapResponseTransferMonthStatusSuccess(s *response.TransferResponseMonthStatusSuccess) *pb.TransferMonthStatusSuccessResponse
mapResponseTransferYearAmountmapResponseTransferYearAmount maps a TransferYearAmountResponse to its protobuf representation.
Args:
- s: The TransferYearAmountResponse that needs to be converted.
Returns:
- A pointer to a TransferYearAmountResponse protobuf message containing the mapped data.
func (m *transferProtoMapper) mapResponseTransferYearAmount(s *response.TransferYearAmountResponse) *pb.TransferYearAmountResponse
mapResponseTransferYearAmountsmapResponseTransferYearAmounts maps a slice of TransferYearAmountResponse to a slice of TransferYearAmountResponse protobuf messages.
It iterates over the input slice, converting each TransferYearAmountResponse to its corresponding protobuf representation using the mapResponseTransferYearAmount method.
Args:
- s: A slice of TransferYearAmountResponse to be converted.
Returns:
- A slice of TransferYearAmountResponse containing the mapped protobuf data.
func (m *transferProtoMapper) mapResponseTransferYearAmounts(s []*response.TransferYearAmountResponse) []*pb.TransferYearAmountResponse
mapResponsesTransfermapResponsesTransfer maps a slice of TransferResponse to a slice of TransferResponse proto messages.
Args:
- transfers: A slice of TransferResponse to be converted.
Returns:
- A slice of pointers to TransferResponse containing the mapped data.
func (t *transferProtoMapper) mapResponsesTransfer(transfers []*response.TransferResponse) []*pb.TransferResponse
mapResponsesTransferDeleteAtmapResponsesTransferDeleteAt maps a slice of TransferResponseDeleteAt to a slice of their protobuf representations.
Args:
- transfers: A slice of TransferResponseDeleteAt to be converted.
Returns:
- A slice of pointers to TransferResponseDeleteAt protobuf messages containing the mapped data.
func (t *transferProtoMapper) mapResponsesTransferDeleteAt(transfers []*response.TransferResponseDeleteAt) []*pb.TransferResponseDeleteAt
mapResponsesTransferMonthStatusFailedmapResponsesTransferMonthStatusFailed maps a slice of TransferResponseMonthStatusFailed to a slice of TransferMonthStatusFailedResponse protobuf messages.
It iterates over the input slice, converting each TransferResponseMonthStatusFailed to its corresponding protobuf representation using the mapResponseTransferMonthStatusFailed method.
Args:
- Transfers: A slice of TransferResponseMonthStatusFailed to be converted.
Returns:
- A slice of TransferMonthStatusFailedResponse containing the mapped protobuf data.
func (t *transferProtoMapper) mapResponsesTransferMonthStatusFailed(Transfers []*response.TransferResponseMonthStatusFailed) []*pb.TransferMonthStatusFailedResponse
mapResponsesTransferMonthStatusSuccessmapResponsesTransferMonthStatusSuccess maps a slice of TransferResponseMonthStatusSuccess to a slice of TransferMonthStatusSuccessResponse protobuf messages.
It iterates over the input slice, converting each TransferResponseMonthStatusSuccess to its corresponding protobuf representation using the mapResponseTransferMonthStatusSuccess method.
Args:
- Transfers: A slice of TransferResponseMonthStatusSuccess to be converted.
Returns:
- A slice of TransferMonthStatusSuccessResponse containing the mapped protobuf data.
func (t *transferProtoMapper) mapResponsesTransferMonthStatusSuccess(Transfers []*response.TransferResponseMonthStatusSuccess) []*pb.TransferMonthStatusSuccessResponse
mapTransferResponseYearStatusFailedmapTransferResponseYearStatusFailed maps a TransferResponseYearStatusFailed to its protobuf representation.
Args:
- s: The TransferResponseYearStatusFailed that needs to be converted.
Returns:
- A pointer to a TransferYearStatusFailedResponse protobuf message containing the mapped data.
func (t *transferProtoMapper) mapTransferResponseYearStatusFailed(s *response.TransferResponseYearStatusFailed) *pb.TransferYearStatusFailedResponse
mapTransferResponseYearStatusSuccessmapTransferResponseYearStatusSuccess maps a TransferResponseYearStatusSuccess to its protobuf representation.
Args:
- s: The TransferResponseYearStatusSuccess that needs to be converted.
Returns:
- A pointer to a TransferYearStatusSuccessResponse protobuf message containing the mapped data.
func (t *transferProtoMapper) mapTransferResponseYearStatusSuccess(s *response.TransferResponseYearStatusSuccess) *pb.TransferYearStatusSuccessResponse
mapTransferResponsesYearStatusFailedmapTransferResponsesYearStatusFailed maps a slice of TransferResponseYearStatusFailed to a slice of TransferYearStatusFailedResponse protobuf messages.
It iterates over the input slice, converting each TransferResponseYearStatusFailed to its corresponding protobuf representation using the mapTransferResponseYearStatusFailed method.
Args:
- Transfers: A slice of TransferResponseYearStatusFailed to be converted.
Returns:
- A slice of TransferYearStatusFailedResponse containing the mapped protobuf data.
func (t *transferProtoMapper) mapTransferResponsesYearStatusFailed(Transfers []*response.TransferResponseYearStatusFailed) []*pb.TransferYearStatusFailedResponse
mapTransferResponsesYearStatusSuccessmapTransferResponsesYearStatusSuccess maps a slice of TransferResponseYearStatusSuccess to a slice of TransferYearStatusSuccessResponse protobuf messages.
It iterates over the input slice, converting each TransferResponseYearStatusSuccess to its corresponding protobuf representation using the mapTransferResponseYearStatusSuccess method.
Args:
- Transfers: A slice of TransferResponseYearStatusSuccess to be converted.
Returns:
- A slice of TransferYearStatusSuccessResponse containing the mapped protobuf data.
func (t *transferProtoMapper) mapTransferResponsesYearStatusSuccess(Transfers []*response.TransferResponseYearStatusSuccess) []*pb.TransferYearStatusSuccessResponse
userProtoMapper
UserProtoMapper provides methods for mapping domain models to pb.UserResponse
type userProtoMapper struct {
}
Methods
ToProtoResponsePaginationUserToProtoResponsePaginationUser maps a list of UserResponse and pagination metadata to a protobuf ApiResponsePaginationUser. It includes the status and message for the API response.
Args:
- pagination: The pagination metadata for the response.
- status: The status of the API response.
- message: A descriptive message for the API response.
- users: A list of UserResponse objects to be included in the response.
Returns:
A pointer to ApiResponsePaginationUser containing the status, message, user data, and pagination data.
func (u *userProtoMapper) ToProtoResponsePaginationUser(pagination *pb.PaginationMeta, status string, message string, users []*response.UserResponse) *pb.ApiResponsePaginationUser
ToProtoResponsePaginationUserDeleteAtToProtoResponsePaginationUserDeleteAt maps a list of UserResponseDeleteAt and pagination metadata to a protobuf ApiResponsePaginationUserDeleteAt. It includes the status and message for the API response.
Args:
- pagination: The pagination metadata for the response.
- status: The status of the API response.
- message: A descriptive message for the API response.
- users: A list of UserResponseDeleteAt objects to be included in the response.
Returns:
A pointer to ApiResponsePaginationUserDeleteAt containing the status, message, user data, and pagination data.
func (u *userProtoMapper) ToProtoResponsePaginationUserDeleteAt(pagination *pb.PaginationMeta, status string, message string, users []*response.UserResponseDeleteAt) *pb.ApiResponsePaginationUserDeleteAt
ToProtoResponseUserToProtoResponseUser maps a UserResponse to a pb.UserResponse
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
- pbResponse: A pointer to the UserResponse to be mapped.
Returns:
- A pointer to a pb.UserResponse containing the mapped data.
- If pbResponse is nil, returns nil.
func (u *userProtoMapper) ToProtoResponseUser(status string, message string, pbResponse *response.UserResponse) *pb.ApiResponseUser
ToProtoResponseUserAllToProtoResponseUserAll returns a protobuf message for all users without pagination.
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
Returns:
- A pointer to a pb.ApiResponseUserAll containing the mapped data.
func (u *userProtoMapper) ToProtoResponseUserAll(status string, message string) *pb.ApiResponseUserAll
ToProtoResponseUserDeleteToProtoResponseUserDelete maps a UserResponseDelete to a pb.ApiResponseUserDelete proto message.
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
Returns:
- A pointer to a pb.ApiResponseUserDelete containing the mapped data.
func (u *userProtoMapper) ToProtoResponseUserDelete(status string, message string) *pb.ApiResponseUserDelete
ToProtoResponseUserDeleteAtToProtoResponseUserDeleteAt maps a UserResponseDeleteAt to a pb.ApiResponseUserDeleteAt proto message.
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
- pbResponse: A pointer to the UserResponseDeleteAt to be mapped.
Returns:
- A pointer to a pb.ApiResponseUserDeleteAt containing the mapped data.
- If pbResponse is nil, returns nil.
func (u *userProtoMapper) ToProtoResponseUserDeleteAt(status string, message string, pbResponse *response.UserResponseDeleteAt) *pb.ApiResponseUserDeleteAt
ToProtoResponsesUserToProtoResponsesUser maps a list of UserResponse to a pb.ApiResponsesUser proto message.
Args:
- status: A string representing the status of the response.
- message: A string representing the message associated with the response.
- pbResponse: A slice of pointers to UserResponse to be mapped.
Returns:
- A pointer to a pb.ApiResponsesUser containing the mapped data.
- If pbResponse is nil, returns nil.
func (u *userProtoMapper) ToProtoResponsesUser(status string, message string, pbResponse []*response.UserResponse) *pb.ApiResponsesUser
mapResponseUsermapResponseUser maps a UserResponse to a protobuf UserResponse.
Args:
- user: A pointer to a UserResponse to be mapped.
Returns:
- A pointer to a protobuf UserResponse containing the mapped data.
func (u *userProtoMapper) mapResponseUser(user *response.UserResponse) *pb.UserResponse
mapResponseUserDeletemapResponseUserDelete maps a UserResponseDeleteAt to a protobuf UserResponseDeleteAt.
Args:
- user: A pointer to a UserResponseDeleteAt containing the user's details.
Returns:
- A pointer to a protobuf UserResponseDeleteAt containing the mapped data, including ID, Firstname, Lastname, Email, CreatedAt, UpdatedAt, and potentially DeletedAt, if available.
func (u *userProtoMapper) mapResponseUserDelete(user *response.UserResponseDeleteAt) *pb.UserResponseDeleteAt
mapResponsesUsermapResponsesUser maps a slice of UserResponse to a slice of protobuf UserResponse.
Args:
- users: A slice of pointers to UserResponse to be mapped.
Returns:
- A slice of pointers to protobuf UserResponse containing the mapped data for each user.
func (u *userProtoMapper) mapResponsesUser(users []*response.UserResponse) []*pb.UserResponse
mapResponsesUserDeleteAtmapResponsesUserDeleteAt maps a slice of UserResponseDeleteAt to a slice of protobuf UserResponseDeleteAt.
Args:
- users: A slice of pointers to UserResponseDeleteAt to be mapped.
Returns:
- A slice of pointers to protobuf UserResponseDeleteAt containing the mapped data for each user, including ID, Firstname, Lastname, Email, CreatedAt, UpdatedAt, and potentially DeletedAt, if available.
func (u *userProtoMapper) mapResponsesUserDeleteAt(users []*response.UserResponseDeleteAt) []*pb.UserResponseDeleteAt
withdrawProtoMapper
type withdrawProtoMapper struct {
}
Methods
ToProtoResponsePaginationWithdrawToProtoResponsePaginationWithdraw maps a status, message, a pagination meta, and a list of WithdrawResponse to an ApiResponsePaginationWithdraw proto message.
Args:
- pagination: The pagination meta that needs to be converted.
- status: The status of the response.
- message: The message accompanying the response.
- withdraws: The list of WithdrawResponse that needs to be converted.
Returns:
A pointer to an ApiResponsePaginationWithdraw containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponsePaginationWithdraw(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.WithdrawResponse) *pb.ApiResponsePaginationWithdraw
ToProtoResponsePaginationWithdrawDeleteAtToProtoResponsePaginationWithdrawDeleteAt maps a pagination meta, status, message, and a list of WithdrawResponseDeleteAt to an ApiResponsePaginationWithdrawDeleteAt proto message.
Args:
- pagination: The pagination meta that needs to be converted.
- status: The status of the response.
- message: The message accompanying the response.
- withdraws: The list of WithdrawResponseDeleteAt that needs to be converted.
Returns:
A pointer to an ApiResponsePaginationWithdrawDeleteAt containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponsePaginationWithdrawDeleteAt(pagination *pb.PaginationMeta, status string, message string, pbResponse []*response.WithdrawResponseDeleteAt) *pb.ApiResponsePaginationWithdrawDeleteAt
ToProtoResponseWithdrawToProtoResponseWithdraw maps a status, message, and a WithdrawResponse to an ApiResponseWithdraw proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
- withdraw: The WithdrawResponse that needs to be converted.
Returns:
A pointer to an ApiResponseWithdraw containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdraw(status string, message string, withdraw *response.WithdrawResponse) *pb.ApiResponseWithdraw
ToProtoResponseWithdrawAllToProtoResponseWithdrawAll maps a status and message to an ApiResponseWithdrawAll proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
Returns:
A pointer to an ApiResponseWithdrawAll containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdrawAll(status string, message string) *pb.ApiResponseWithdrawAll
ToProtoResponseWithdrawDeleteToProtoResponseWithdrawDelete maps a status and message to an ApiResponseWithdrawDelete proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
Returns:
A pointer to an ApiResponseWithdrawDelete containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdrawDelete(status string, message string) *pb.ApiResponseWithdrawDelete
ToProtoResponseWithdrawMonthAmountToProtoResponseWithdrawMonthAmount maps a status, message, and a list of WithdrawMonthlyAmountResponse to an ApiResponseWithdrawMonthAmount proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
- pbResponse: The list of WithdrawMonthlyAmountResponse that needs to be converted.
Returns:
A pointer to an ApiResponseWithdrawMonthAmount containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdrawMonthAmount(status string, message string, pbResponse []*response.WithdrawMonthlyAmountResponse) *pb.ApiResponseWithdrawMonthAmount
ToProtoResponseWithdrawMonthStatusFailedToProtoResponseWithdrawMonthStatusFailed maps a status, message, and a list of WithdrawResponseMonthStatusFailed to an ApiResponseWithdrawMonthStatusFailed proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
- pbResponse: The list of WithdrawResponseMonthStatusFailed that needs to be converted.
Returns:
A pointer to an ApiResponseWithdrawMonthStatusFailed containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdrawMonthStatusFailed(status string, message string, pbResponse []*response.WithdrawResponseMonthStatusFailed) *pb.ApiResponseWithdrawMonthStatusFailed
ToProtoResponseWithdrawMonthStatusSuccessToProtoResponseWithdrawMonthStatusSuccess maps a status, message, and a list of WithdrawResponseMonthStatusSuccess to an ApiResponseWithdrawMonthStatusSuccess proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
- pbResponse: The list of WithdrawResponseMonthStatusSuccess that needs to be converted.
Returns:
A pointer to an ApiResponseWithdrawMonthStatusSuccess containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdrawMonthStatusSuccess(status string, message string, pbResponse []*response.WithdrawResponseMonthStatusSuccess) *pb.ApiResponseWithdrawMonthStatusSuccess
ToProtoResponseWithdrawYearAmountToProtoResponseWithdrawYearAmount maps a status, message, and a list of WithdrawYearlyAmountResponse to an ApiResponseWithdrawYearAmount proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
- pbResponse: The list of WithdrawYearlyAmountResponse that needs to be converted.
Returns:
A pointer to an ApiResponseWithdrawYearAmount containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdrawYearAmount(status string, message string, pbResponse []*response.WithdrawYearlyAmountResponse) *pb.ApiResponseWithdrawYearAmount
ToProtoResponseWithdrawYearStatusFailedToProtoResponseWithdrawYearStatusFailed maps a status, message, and a list of WithdrawResponseYearStatusFailed to an ApiResponseWithdrawYearStatusFailed proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
- pbResponse: The list of WithdrawResponseYearStatusFailed that needs to be converted.
Returns:
A pointer to an ApiResponseWithdrawYearStatusFailed containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdrawYearStatusFailed(status string, message string, pbResponse []*response.WithdrawResponseYearStatusFailed) *pb.ApiResponseWithdrawYearStatusFailed
ToProtoResponseWithdrawYearStatusSuccessToProtoResponseWithdrawYearStatusSuccess maps a status, message, and a list of WithdrawResponseYearStatusSuccess to an ApiResponseWithdrawYearStatusSuccess proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
- pbResponse: The list of WithdrawResponseYearStatusSuccess that needs to be converted.
Returns:
A pointer to an ApiResponseWithdrawYearStatusSuccess containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponseWithdrawYearStatusSuccess(status string, message string, pbResponse []*response.WithdrawResponseYearStatusSuccess) *pb.ApiResponseWithdrawYearStatusSuccess
ToProtoResponsesWithdrawToProtoResponsesWithdraw maps a status, message, and a list of WithdrawResponse to an ApiResponsesWithdraw proto message.
Args:
- status: The status of the response.
- message: The message accompanying the response.
- withdraws: The list of WithdrawResponse that needs to be converted.
Returns:
A pointer to an ApiResponsesWithdraw containing the mapped data.
func (m *withdrawProtoMapper) ToProtoResponsesWithdraw(status string, message string, pbResponse []*response.WithdrawResponse) *pb.ApiResponsesWithdraw
mapResponseWithdrawMonthStatusFailedmapResponseWithdrawMonthStatusFailed maps a single WithdrawResponseMonthStatusFailed to its protobuf representation.
Args:
- s: The WithdrawResponseMonthStatusFailed that needs to be converted.
Returns:
- A pointer to a WithdrawMonthStatusFailedResponse containing the mapped data, with fields Year, Month, TotalFailed, and TotalAmount.
func (t *withdrawProtoMapper) mapResponseWithdrawMonthStatusFailed(s *response.WithdrawResponseMonthStatusFailed) *pb.WithdrawMonthStatusFailedResponse
mapResponseWithdrawMonthStatusSuccessmapResponseWithdrawMonthStatusSuccess maps a single WithdrawResponseMonthStatusSuccess to its protobuf representation.
Args:
- s: The WithdrawResponseMonthStatusSuccess that needs to be converted.
Returns:
- A pointer to a WithdrawMonthStatusSuccessResponse protobuf message containing the mapped data.
func (t *withdrawProtoMapper) mapResponseWithdrawMonthStatusSuccess(s *response.WithdrawResponseMonthStatusSuccess) *pb.WithdrawMonthStatusSuccessResponse
mapResponseWithdrawMonthlyAmountmapResponseWithdrawMonthlyAmount maps a WithdrawMonthlyAmountResponse to its protobuf representation.
Args:
- s: The WithdrawMonthlyAmountResponse that needs to be converted.
Returns:
- A pointer to a WithdrawMonthlyAmountResponse containing the mapped data, with fields Month and TotalAmount.
func (m *withdrawProtoMapper) mapResponseWithdrawMonthlyAmount(s *response.WithdrawMonthlyAmountResponse) *pb.WithdrawMonthlyAmountResponse
mapResponseWithdrawMonthlyAmountsmapResponseWithdrawMonthlyAmounts maps a slice of WithdrawMonthlyAmountResponse to a slice of protobuf WithdrawMonthlyAmountResponse.
It takes a slice of WithdrawMonthlyAmountResponse as input and returns a slice of corresponding protobuf WithdrawMonthlyAmountResponse. The mapping includes fields like Month and TotalAmount.
func (m *withdrawProtoMapper) mapResponseWithdrawMonthlyAmounts(s []*response.WithdrawMonthlyAmountResponse) []*pb.WithdrawMonthlyAmountResponse
mapResponseWithdrawYearlyAmountmapResponseWithdrawYearlyAmount maps a WithdrawYearlyAmountResponse to its protobuf representation.
Args:
- s: The WithdrawYearlyAmountResponse that needs to be converted.
Returns:
- A pointer to a WithdrawYearlyAmountResponse containing the mapped data, with fields Year and TotalAmount.
func (m *withdrawProtoMapper) mapResponseWithdrawYearlyAmount(s *response.WithdrawYearlyAmountResponse) *pb.WithdrawYearlyAmountResponse
mapResponseWithdrawYearlyAmountsmapResponseWithdrawYearlyAmounts maps a slice of WithdrawYearlyAmountResponse to a slice of protobuf WithdrawYearlyAmountResponse.
It takes a slice of WithdrawYearlyAmountResponse as input and returns a slice of corresponding protobuf WithdrawYearlyAmountResponse. The mapping includes fields like Year and TotalAmount.
func (m *withdrawProtoMapper) mapResponseWithdrawYearlyAmounts(s []*response.WithdrawYearlyAmountResponse) []*pb.WithdrawYearlyAmountResponse
mapResponseWithdrawalmapResponseWithdrawal maps a single WithdrawResponse to its protobuf representation.
Args:
- withdraw: The WithdrawResponse that needs to be converted.
Returns:
- A pointer to a WithdrawResponse protobuf message containing the mapped data.
func (w *withdrawProtoMapper) mapResponseWithdrawal(withdraw *response.WithdrawResponse) *pb.WithdrawResponse
mapResponseWithdrawalDeleteAtmapResponseWithdrawalDeleteAt maps a single WithdrawResponseDeleteAt to its protobuf representation.
Args:
- withdraw: The WithdrawResponseDeleteAt that needs to be converted.
Returns:
- A pointer to a WithdrawResponseDeleteAt protobuf message containing the mapped data.
func (w *withdrawProtoMapper) mapResponseWithdrawalDeleteAt(withdraw *response.WithdrawResponseDeleteAt) *pb.WithdrawResponseDeleteAt
mapResponsesWithdrawMonthStatusFailedmapResponsesWithdrawMonthStatusFailed maps a slice of WithdrawResponseMonthStatusFailed to a slice of protobuf WithdrawMonthStatusFailedResponse.
It takes a slice of WithdrawResponseMonthStatusFailed as input and returns a slice of corresponding protobuf WithdrawMonthStatusFailedResponse. The mapping includes fields like Year, Month, TotalFailed, and TotalAmount.
func (t *withdrawProtoMapper) mapResponsesWithdrawMonthStatusFailed(Withdraws []*response.WithdrawResponseMonthStatusFailed) []*pb.WithdrawMonthStatusFailedResponse
mapResponsesWithdrawMonthStatusSuccessmapResponsesWithdrawMonthStatusSuccess maps a slice of WithdrawResponseMonthStatusSuccess to a slice of protobuf WithdrawMonthStatusSuccessResponse.
It takes a slice of WithdrawResponseMonthStatusSuccess as input and returns a slice of corresponding protobuf WithdrawMonthStatusSuccessResponse. The mapping includes fields like Year, Month, TotalSuccess, and TotalAmount.
func (t *withdrawProtoMapper) mapResponsesWithdrawMonthStatusSuccess(Withdraws []*response.WithdrawResponseMonthStatusSuccess) []*pb.WithdrawMonthStatusSuccessResponse
mapResponsesWithdrawalmapResponsesWithdrawal maps a slice of WithdrawResponse to a slice of protobuf WithdrawResponse.
It takes a slice of WithdrawResponse as input and returns a slice of corresponding protobuf WithdrawResponse. The mapping includes fields like WithdrawId, WithdrawNo, CardNumber, WithdrawAmount, WithdrawTime, CreatedAt, and UpdatedAt.
func (w *withdrawProtoMapper) mapResponsesWithdrawal(withdraws []*response.WithdrawResponse) []*pb.WithdrawResponse
mapResponsesWithdrawalDeleteAtmapResponsesWithdrawalDeleteAt maps a slice of WithdrawResponseDeleteAt to a slice of protobuf WithdrawResponseDeleteAt.
It takes a slice of WithdrawResponseDeleteAt as input and returns a slice of corresponding protobuf WithdrawResponseDeleteAt. The mapping includes fields like WithdrawId, WithdrawNo, CardNumber, WithdrawAmount, WithdrawTime, CreatedAt, UpdatedAt, and DeletedAt.
func (w *withdrawProtoMapper) mapResponsesWithdrawalDeleteAt(withdraws []*response.WithdrawResponseDeleteAt) []*pb.WithdrawResponseDeleteAt
mapWithdrawResponseYearStatusFailedmapWithdrawResponseYearStatusFailed maps a WithdrawResponseYearStatusFailed to a WithdrawYearStatusFailedResponse proto message.
Args:
- s: The WithdrawResponseYearStatusFailed that needs to be converted.
Returns:
- A pointer to a WithdrawYearStatusFailedResponse containing the mapped data, with fields Year, TotalFailed, and TotalAmount.
func (t *withdrawProtoMapper) mapWithdrawResponseYearStatusFailed(s *response.WithdrawResponseYearStatusFailed) *pb.WithdrawYearStatusFailedResponse
mapWithdrawResponseYearStatusSuccessmapWithdrawResponseYearStatusSuccess maps a single WithdrawResponseYearStatusSuccess to a WithdrawYearStatusSuccessResponse proto message.
Args:
- s: The WithdrawResponseYearStatusSuccess that needs to be converted.
Returns:
- A pointer to a WithdrawYearStatusSuccessResponse containing the mapped data, with fields Year, TotalSuccess, and TotalAmount.
func (t *withdrawProtoMapper) mapWithdrawResponseYearStatusSuccess(s *response.WithdrawResponseYearStatusSuccess) *pb.WithdrawYearStatusSuccessResponse
mapWithdrawResponsesYearStatusFailedmapWithdrawResponsesYearStatusFailed maps a slice of WithdrawResponseYearStatusFailed to a slice of protobuf WithdrawYearStatusFailedResponse.
It takes a slice of WithdrawResponseYearStatusFailed as input and returns a slice of corresponding protobuf WithdrawYearStatusFailedResponse. The mapping includes fields like Year, TotalFailed, and TotalAmount.
func (t *withdrawProtoMapper) mapWithdrawResponsesYearStatusFailed(Withdraws []*response.WithdrawResponseYearStatusFailed) []*pb.WithdrawYearStatusFailedResponse
mapWithdrawResponsesYearStatusSuccessmapWithdrawResponsesYearStatusSuccess maps a slice of WithdrawResponseYearStatusSuccess to a slice of protobuf WithdrawYearStatusSuccessResponse.
It takes a slice of WithdrawResponseYearStatusSuccess as input and returns a slice of corresponding protobuf WithdrawYearStatusSuccessResponse. The mapping includes fields like Year, TotalSuccess, and TotalAmount.
func (t *withdrawProtoMapper) mapWithdrawResponsesYearStatusSuccess(Withdraws []*response.WithdrawResponseYearStatusSuccess) []*pb.WithdrawYearStatusSuccessResponse
🚀 Functions
mapPaginationMeta
mapPaginationMeta maps a sharedPagination.PaginationMeta to a protobuf PaginationMeta.
Args:
- s: A pointer to a sharedPagination.PaginationMeta to be mapped.
Returns:
- A pointer to a protobuf PaginationMeta containing the mapped data.
func mapPaginationMeta(s *pb.PaginationMeta) *pb.PaginationMeta
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapPaginationMeta ¶ added in v1.0.8
func MapPaginationMeta(s *pb.PaginationMeta) *pb.PaginationMeta
mapPaginationMeta maps a sharedPagination.PaginationMeta to a protobuf PaginationMeta.
Args:
- s: A pointer to a sharedPagination.PaginationMeta to be mapped.
Returns:
- A pointer to a protobuf PaginationMeta containing the mapped data.
Types ¶
This section is empty.