Files
apskel-pos-backend/internal/contract/wallet_contract.go
T
2026-09-30 15:31:11 +07:00

32 lines
1.2 KiB
Go

package contract
// AdjustCustomerWalletRequest is POST /marketing/customers/:id/wallet/adjust
// (docs/prd-point-coin.md F7).
type AdjustCustomerWalletRequest struct {
// POINT or COIN.
Currency string `json:"currency"`
// Signed: positive adds to the balance, negative takes from it. Never zero.
Amount int64 `json:"amount"`
Reason string `json:"reason"`
// Optional. Sending the same key again returns the first result instead of
// adjusting twice, so a retried request is safe.
IdempotencyKey string `json:"idempotency_key"`
}
// ExchangeCoinsRequest is POST /customer/wallet/exchange (docs/prd-point-coin.md F4).
// The Idempotency-Key header is required.
type ExchangeCoinsRequest struct {
Coins int64 `json:"coins" binding:"required,min=1"`
Pin string `json:"pin" binding:"required"`
}
// TransferWalletRequest is POST /customer/wallet/transfer (docs/prd-point-coin.md F5).
// The Idempotency-Key header is required.
type TransferWalletRequest struct {
// POINT or COIN.
Currency string `json:"currency" binding:"required"`
Amount int64 `json:"amount" binding:"required,min=1"`
RecipientPhone string `json:"recipient_phone" binding:"required"`
Pin string `json:"pin" binding:"required"`
}