Reapply "feat(loyalty): EnakPoint & EnakCoin" (#32)

This reverts commit 4e24f9bbb0.
This commit is contained in:
efrilm
2026-09-30 15:31:11 +07:00
parent 5e28b05770
commit c6062c4bb9
195 changed files with 20058 additions and 2177 deletions
+47
View File
@@ -0,0 +1,47 @@
package models
import (
"time"
"github.com/google/uuid"
)
// CustomerPinStatus is GET /customer/pin/status.
type CustomerPinStatus struct {
HasPin bool `json:"has_pin"`
LockedUntil *time.Time `json:"locked_until"`
TransferBlockedUntil *time.Time `json:"transfer_blocked_until"`
}
// CustomerPinOtp is what POST /customer/pin/otp returns: the token to send back with
// the code the customer received.
type CustomerPinOtp struct {
Purpose string `json:"purpose"`
OtpToken string `json:"otp_token"`
ExpiresAt time.Time `json:"expires_at"`
}
// CustomerSecurityEventView is one row of GET /marketing/customers/:id/security-events.
type CustomerSecurityEventView struct {
ID uuid.UUID `json:"id"`
Event string `json:"event"`
ActorUser *uuid.UUID `json:"actor_user,omitempty"`
Reason *string `json:"reason,omitempty"`
IPAddress *string `json:"ip_address,omitempty"`
UserAgent *string `json:"user_agent,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
// CustomerPinRequestInfo is where a PIN request came from, for the security log.
type CustomerPinRequestInfo struct {
IPAddress string
UserAgent string
}
// PaymentCode is what POST /customer/wallet/payment-code returns: a one-time code the
// customer shows the cashier, as digits or as a QR of QRPayload.
type PaymentCode struct {
Code string `json:"code"`
QRPayload string `json:"qr_payload"`
ExpiresAt time.Time `json:"expires_at"`
}