2025-09-17 19:30:17 +07:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
2025-09-18 02:01:50 +07:00
|
|
|
// Response Models
|
|
|
|
|
type GetCustomerPointsResponse struct {
|
|
|
|
|
Status string `json:"status"`
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
Data *GetCustomerPointsResponseData `json:"data,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type GetCustomerPointsResponseData struct {
|
|
|
|
|
TotalPoints int64 `json:"total_points"`
|
|
|
|
|
PointsHistory []PointsHistoryItem `json:"points_history,omitempty"`
|
|
|
|
|
LastUpdated time.Time `json:"last_updated"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PointsHistoryItem struct {
|
|
|
|
|
ID string `json:"id"`
|
|
|
|
|
Points int64 `json:"points"`
|
|
|
|
|
Type string `json:"type"` // EARNED, REDEEMED, EXPIRED
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type GetCustomerWalletResponse struct {
|
|
|
|
|
Status string `json:"status"`
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
Data *GetCustomerWalletResponseData `json:"data,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-30 15:31:44 +07:00
|
|
|
// GetCustomerWalletResponseData is GET /customer/wallet (docs/prd-point-coin.md F6).
|
2025-09-18 02:01:50 +07:00
|
|
|
type GetCustomerWalletResponseData struct {
|
2026-09-30 15:31:44 +07:00
|
|
|
// Balances the customer can spend now.
|
|
|
|
|
PointBalance int64 `json:"point_balance"`
|
|
|
|
|
CoinBalance int64 `json:"coin_balance"`
|
|
|
|
|
// Rupiah value of one EnakPoint, and of the whole point balance. EnakPoint only
|
|
|
|
|
// ever pays for orders, so the app shows this as "setara potongan Rp …" (K7).
|
|
|
|
|
PointValue int64 `json:"point_value"`
|
|
|
|
|
PointDiscountValue int64 `json:"point_discount_value"`
|
|
|
|
|
NearestExpiring CustomerWalletNearestExpiring `json:"nearest_expiring"`
|
|
|
|
|
RecentTransactions []CustomerWalletTransaction `json:"recent_transactions"`
|
|
|
|
|
|
|
|
|
|
// Deprecated: the shape of this endpoint before the wallet, kept for app versions
|
|
|
|
|
// that still read it. Filled from the wallet like the fields above.
|
2025-09-18 02:01:50 +07:00
|
|
|
TotalPoints int64 `json:"total_points"`
|
|
|
|
|
PointsHistory []PointsHistoryItem `json:"points_history,omitempty"`
|
|
|
|
|
LastUpdated time.Time `json:"last_updated"`
|
2025-09-17 19:30:17 +07:00
|
|
|
}
|