Skip to main content

Generated from package comments and exported declarations. Edit the Go source, not this file.

transfers

import "codeberg.org/hemanta212/playgo/api/transfers"

Package transfers defines provider-transfer command and reconciliation contracts.

A provider transfer is credits moving between the platform and a game provider, which is what happens when a player loads money into a game or takes it back out.

Admin transfer and reconciliation views use these types for load and unload state, source attribution, outcome classification, and retry-safe workflow identifiers. Provider-specific detail stays behind adapters, so operators see normalized records and evidence.

The reconciliation states are stop signals, not retry instructions. When an outcome is unknown, the correct next step is evidence - retrying a movement that may already have succeeded is the most expensive mistake available in this domain.

Constants​

const (
AccountLinkOriginPlayer = "player"
AccountLinkOriginAdmin = "admin"
)
const (
ReviewStatePending = "pending"
ReviewStateApproving = "approving"
ReviewStateSettling = "settling"
ReviewStateReconcileRequired = "reconcile_required"
ReviewStateSettled = "settled"
ReviewStateRejected = "rejected"
ReviewStateCanceled = "canceled"
)
const (
FirstUnloadResolutionDebitConfirmed = "debit_confirmed"
FirstUnloadResolutionDebitNotApplied = "debit_not_applied"
)
const AccountNeedsSupportMessage = "This game account needs support, contact us"

Variables​

var (
ErrProviderBalanceUnavailable = errors.New("provider balance unavailable")
ErrProviderAccountNeedsSupport = errors.New("provider account needs support")
ErrProviderTransferInvalid = errors.New("provider transfer invalid")
ErrProviderTransferConflict = errors.New("provider transfer conflict")
// ErrFirstUnloadReviewOpen: loads and unloads wait for an open review.
ErrFirstUnloadReviewOpen = fmt.Errorf("%w: first unload review open", ErrProviderTransferConflict)
)
var (
ErrCreditMovesDisabled = errors.New("moving credits between games is disabled by the operator")
ErrCreditMoveUnavailable = errors.New("provider credit move unavailable")
ErrCreditMoveConflict = errors.New("provider credit move conflict")
ErrInvalidStoredCreditMove = errors.New("invalid stored provider credit move")
)
var (
ErrInvalidRequest = errors.New("transfer: invalid request")
ErrNotFound = errors.New("transfer: not found")
ErrConflict = errors.New("transfer: conflict")
ErrUnknownTransferOpen = errors.New("transfer: unresolved unknown transfer exists")
)
var ErrAdminWalletLoadInvalid = errors.New("invalid administrator wallet load")
var ErrInvalidCycleSource = errors.New("invalid stored provider cycle source")
var ErrInvalidLoadReason = errors.New("invalid stored load reason")
var ErrInvalidStoredTransfer = errors.New("invalid stored provider transfer vocabulary")

func AccountUnreadableMessage​

func AccountUnreadableMessage(game string) string

func CredentialsRejectedMessage​

func CredentialsRejectedMessage(game, _ string) string

type AccountCycleKind​

type AccountCycleKind string
const (
AccountCycleKindNormal AccountCycleKind = "normal"
)

type AccountImportError​

AccountImportError is a client-visible, non-internal failure of an import command.

type AccountImportError struct {
Kind ImportErrorKind
Reason AccountImportReason
// Review carries the refreshed snapshot for rereview_required.
Review *FirstUnloadReview
}

func AsAccountImportError​

func AsAccountImportError(err error) (*AccountImportError, bool)

func NewAccountImportError​

func NewAccountImportError(kind ImportErrorKind, reason AccountImportReason) *AccountImportError

func (*AccountImportError) Error​

func (e *AccountImportError) Error() string

type AccountImportReason​

AccountImportReason is the machine-readable reason carried by provider account link, unlink and first-unload review failures. Values mirror the OpenAPI ProviderAccountImportReason enum.

type AccountImportReason string
const (
ImportReasonAccountAlreadyLinked AccountImportReason = "account_already_linked"
ImportReasonProviderAccountExists AccountImportReason = "provider_account_exists"
ImportReasonProvisioningInProgress AccountImportReason = "provisioning_in_progress"
ImportReasonLinkUnavailable AccountImportReason = "link_unavailable"
ImportReasonVerificationFailed AccountImportReason = "verification_failed"
ImportReasonVerificationUnavailable AccountImportReason = "verification_unavailable"
ImportReasonCredentialRequired AccountImportReason = "credential_required" // #nosec G101 -- reason code, not a credential
ImportReasonFirstUnloadReviewOpen AccountImportReason = "first_unload_review_open"
ImportReasonFirstUnloadNotRequired AccountImportReason = "first_unload_review_not_required"
ImportReasonRereviewRequired AccountImportReason = "rereview_required"
ImportReasonAssignmentNotConfirmed AccountImportReason = "assignment_not_confirmed"
ImportReasonApprovedPayoutOutOfRange AccountImportReason = "approved_payout_out_of_range"
ImportReasonFreshBalanceUnavailable AccountImportReason = "fresh_balance_unavailable"
ImportReasonReviewNotPending AccountImportReason = "review_not_pending"
ImportReasonAccountHasOpenWork AccountImportReason = "account_has_open_work"
ImportReasonAccountNotUnlinkable AccountImportReason = "account_not_unlinkable"
ImportReasonInvalidRequest AccountImportReason = "invalid_request"
ImportReasonCommandInProgress AccountImportReason = "command_in_progress"
ImportReasonIdempotencyConflict AccountImportReason = "idempotency_conflict"
ImportReasonReviewNotReconcilable AccountImportReason = "review_not_reconcilable"
ImportReasonDebitAlreadyConfirmed AccountImportReason = "debit_already_confirmed"
ImportReasonZeroBalanceUnverified AccountImportReason = "zero_balance_unverified"
ImportReasonMakerCheckerConflict AccountImportReason = "maker_checker_conflict"
)

type AccountLinkCommand​

type AccountLinkCommand struct {
UserID uuid.UUID
ActorID uuid.UUID
Origin string
Game AccountLinkGame
AccountIdentifier string
Password apiproviders.SecretMaterial
ExpectedSlot apiproviders.ProviderSlotExpected
Reason *string
Reference *string
IdempotencyKey string
}

type AccountLinkGame​

AccountLinkGame contains only the catalog identity needed to link an account.

type AccountLinkGame struct {
Active bool `json:"-"`
ID string
Name string
ProviderCode apiproviders.ProviderCode
}

type AccountLinkGames​

AccountLinkGames reads the current game catalog. The catalog changes while the server runs (a Connect publish adds a game), so services hold this reader rather than a copy taken at boot.

type AccountLinkGames func() []AccountLinkGame

func (AccountLinkGames) List​

func (g AccountLinkGames) List() []AccountLinkGame

List returns the games in the catalog now; a nil reader has none.

type AccountLinkOption​

AccountLinkOption is a target-player projection, never a client inference from the general catalog. Eligibility and its exact slot witness are owned by the existing linking workflow.

type AccountLinkOption struct {
Game AccountLinkGame
Form apiproviders.PlayerLinkForm
ExpectedSlot apiproviders.ProviderSlotExpected
Enabled bool
DisabledReason *string
}

type AccountLinkResult​

type AccountLinkResult struct {
AccountID uuid.UUID
Replayed bool
}

type AccountNeedsSupportError​

type AccountNeedsSupportError struct {
Reason providers.AccountIssueReason
Game string
Brand string
CanReconnect bool
}

func (AccountNeedsSupportError) Error​

func (e AccountNeedsSupportError) Error() string

func (AccountNeedsSupportError) Unwrap​

func (AccountNeedsSupportError) Unwrap() error

type AccountUnlinkCommand​

type AccountUnlinkCommand struct {
AccountID uuid.UUID
ActorID uuid.UUID
Reason string
Reference *string
IdempotencyKey string
Expected *apiproviders.AccountManagementExpected
PreviewID *uuid.UUID
}

type AccountUnlinkOutcome​

AccountUnlinkOutcome is the stored (replayable) unlink result.

type AccountUnlinkOutcome struct {
AccountID uuid.UUID `json:"provider_account_id"`
LastKnownBalanceCredits *int64 `json:"last_known_balance_credits,omitempty"`
FreshBalanceCredits *int64 `json:"fresh_balance_credits,omitempty"`
FreshBalanceRead string `json:"fresh_balance_read"`
CycleKind string `json:"cycle_kind"`
LoadedPrincipalOnProviderCash int64 `json:"loaded_principal_on_provider_cents"`
Replayed bool `json:"-"`
}

type AdminWalletLoadAudit​

type AdminWalletLoadAudit struct {
ActorID uuid.UUID
ReasonCode AdminWalletLoadReason
Note string
}

type AdminWalletLoadCommand​

type AdminWalletLoadCommand struct {
ActorID uuid.UUID
ProviderAccountID uuid.UUID
AmountCents int64
PreflightToken uuid.UUID
IdempotencyKey string
ReasonCode AdminWalletLoadReason
Note string
}

type AdminWalletLoadFieldError​

type AdminWalletLoadFieldError struct{ Field, Message string }

func (AdminWalletLoadFieldError) Error​

func (e AdminWalletLoadFieldError) Error() string

func (AdminWalletLoadFieldError) Unwrap​

func (e AdminWalletLoadFieldError) Unwrap() error

type AdminWalletLoadOptions​

AdminWalletLoadOptions contains only read-only wallet/config facts. A normal server preflight still decides whether the requested amount can be loaded.

type AdminWalletLoadOptions struct {
UserID, ProviderAccountID uuid.UUID
PlayerLabel string
ProviderCode providers.ProviderCode
CashCents, FreeplayCents, WithdrawableCents, DepositBonusCents, LoadIncrementCents int64
CanLoad bool
DisabledReason string
}

type AdminWalletLoadReason​

type AdminWalletLoadReason string
const (
AdminWalletLoadStaff AdminWalletLoadReason = "staff_load"
AdminWalletLoadPlayerRequest AdminWalletLoadReason = "player_request"
AdminWalletLoadSupportAssistance AdminWalletLoadReason = "support_assistance"
AdminWalletLoadAccountCorrection AdminWalletLoadReason = "account_correction"
AdminWalletLoadOther AdminWalletLoadReason = "other"
)

func (AdminWalletLoadReason) Valid​

func (r AdminWalletLoadReason) Valid() bool

type AdminWalletLoadSubjectKind​

type AdminWalletLoadSubjectKind string
const (
AdminWalletLoadPlayerSubject AdminWalletLoadSubjectKind = "player"
AdminWalletLoadOperationalSubject AdminWalletLoadSubjectKind = "operational"
)

type BalanceReadError​

BalanceReadError carries only a bounded public reason. A failed read must never become a definite money-command refusal through its underlying error.

type BalanceReadError struct {
Reason LoadReason
RetryAfterSeconds *int32
// contains filtered or unexported fields
}

func NewBalanceReadError​

func NewBalanceReadError(reason LoadReason, cause error) BalanceReadError

func (BalanceReadError) Error​

func (e BalanceReadError) Error() string

func (BalanceReadError) Is​

func (e BalanceReadError) Is(target error) bool

func (BalanceReadError) Unwrap​

func (e BalanceReadError) Unwrap() error

type BonusOnlyAdminContext​

type BonusOnlyAdminContext struct {
CloseLossAction BonusOnlyLossAction
ProviderAccountID uuid.UUID
ProviderCode providers.ProviderCode
GameID *string
GameName string
Username string
Sources []BonusOnlyLotOrigin
}

type BonusOnlyCycle​

BonusOnlyCycle is a server-computed projection of frozen promotional terms.

type BonusOnlyCycle struct {
ID *uuid.UUID
State BonusOnlyCycleState
Version int64
PrincipalCents int64
NetWinningsCents int64
MinNetWinningsCents int64
MaxPayoutCents int64
WinningsPercent int64
PolicyRevision int64
RemainingPayoutCents int64
PayableCents int64
ForfeitCents int64
RemainingNetWinningsCents int64
CanCloseLoss bool
BalanceKnown bool
Eligible bool
Reason BonusOnlyReason
NextStartAt *time.Time
ObservedAt *time.Time
AdminContext *BonusOnlyAdminContext
}

type BonusOnlyCycleState​

type BonusOnlyCycleState string
const (
BonusOnlyCycleReserved BonusOnlyCycleState = "reserved"
BonusOnlyCycleActive BonusOnlyCycleState = "active"
BonusOnlyCycleSettling BonusOnlyCycleState = "settling"
BonusOnlyCycleReview BonusOnlyCycleState = "review"
BonusOnlyCycleUnknown BonusOnlyCycleState = "unknown"
BonusOnlyCycleClosed BonusOnlyCycleState = "closed"
BonusOnlyCycleFailed BonusOnlyCycleState = "failed"
)

type BonusOnlyLossAction​

BonusOnlyAdminContext is populated only by the authorized staff detail read. Player previews and receipts do not include private grant/payment references.

type BonusOnlyLossAction struct {
Enabled bool
DisabledReason *string
}

type BonusOnlyLotOrigin​

type BonusOnlyLotOrigin struct {
GrantID uuid.UUID
PaymentID *uuid.UUID
RewardEventID uuid.UUID
GrantLedgerTransactionID uuid.UUID
LoadTransferID uuid.UUID
Origin rewards.EventKind
OriginLabel string
GrantedCents int64
AllocatedCents int64
GrantedAt time.Time
TransferState State
Refunded bool
Revoked bool
}

type BonusOnlyReason​

type BonusOnlyReason string
const (
BonusOnlyReasonPending BonusOnlyReason = "pending"
BonusOnlyReasonUnavailable BonusOnlyReason = "balance_unavailable"
BonusOnlyReasonOK BonusOnlyReason = "ok"
BonusOnlyReasonActiveElsewhere BonusOnlyReason = "active_elsewhere"
BonusOnlyReasonCooldown BonusOnlyReason = "cooldown"
BonusOnlyReasonPaidFundsUsable BonusOnlyReason = "paid_funds_usable"
BonusOnlyReasonExistingGameBalance BonusOnlyReason = "existing_game_balance"
BonusOnlyReasonBelowIncrement BonusOnlyReason = "bonus_below_increment"
BonusOnlyReasonDisabled BonusOnlyReason = "bonus_only_disabled"
BonusOnlyReasonBelowMinimum BonusOnlyReason = "below_minimum"
BonusOnlyReasonPartialMove BonusOnlyReason = "partial_move_not_allowed"
BonusOnlyReasonMixedDestination BonusOnlyReason = "mixed_destination"
)

type CashoutAcceptanceMode​

CashoutAcceptanceMode identifies the immutable acceptance decision.

type CashoutAcceptanceMode string
const (
CashoutAcceptanceNormal CashoutAcceptanceMode = "normal"
CashoutAcceptanceLinked CashoutAcceptanceMode = "linked_credits_accepted"
CashoutAcceptanceUnrecorded CashoutAcceptanceMode = "unrecorded_credits_accepted"
)

func ParseCashoutAcceptanceMode​

func ParseCashoutAcceptanceMode(value string) (CashoutAcceptanceMode, error)

type CashoutBreakdown​

CashoutBreakdown is a read projection of immutable issued audit facts.

type CashoutBreakdown struct {
BonusOnlyCycle *BonusOnlyCycle
PaidLoadCents int64
DepositBonusLoadCents int64
Mode CashoutAcceptanceMode
AcceptedCreditsCents int64
BalanceCents int64
LimitCents int64
PaidCents int64
NotPaidCents int64
PolicyRevision int64
FreeplayWinningsPercent *int64
}

type CashoutOverrideCommand​

type CashoutOverrideCommand struct {
ActorID uuid.UUID
PreviewToken uuid.UUID
ExpectedBalanceCredits int64
ApprovedPayoutCents int64
Reason string
}

type CashoutPreview​

CashoutPreview is the issued quote and proposed operator approval.

type CashoutPreview struct {
WalletReview []WalletSourceReview
ProviderAccountID uuid.UUID
Quote CashoutQuote
BalanceCredits int64
Token uuid.UUID
Approved int64
Difference int64
Forfeit int64
}

type CashoutQuote​

CashoutQuote contains the immutable payout facts computed by Postgres.

type CashoutQuote struct {
CycleDepositBonusLoadedCents int64
BonusOnlyCycle *BonusOnlyCycle
CycleDepositBonusCents int64
CycleCashCents int64
CycleWithdrawableCents int64
CycleFreeplayCents int64
CycleBonusOnlyPrincipalCents int64
CycleTotalCents int64

Mode CashoutAcceptanceMode
AcceptedCreditsCents int64
FreeplayWinningsPercent *int64
ActualPayoutCents int64
ActualForfeitCents int64
FreeplayPrincipalCents int64
Revision int64
LoadCents int64
BaseCapCents int64
PayoutCents int64
ForfeitCents int64
Eligible bool
ExcessPercent int64
ExcessPayoutCents int64
MinimumCashoutCents int64
DebitCredits int64
DebitCashCents int64
}

type CashoutReview​

type CashoutReview struct {
CycleDepositBonusLoadedCents int64
CycleCashCents int64
CycleWithdrawableCents int64
TransferID uuid.UUID
UserID uuid.UUID
ProviderAccountID uuid.UUID
ProviderCode providers.ProviderCode
ProviderUsername string
PlayerName string
PlayerEmail string
PlayerAlias *string
State CashoutReviewState
ProviderCredits int64
DebitCents int64
PayoutCents int64
WithdrawableCents int64
ConsumedFreeplayCents int64
ForfeitCents int64
PolicyRevision int64
CycleDepositBonusCents int64
CycleFreeplayCents int64
CycleBonusOnlyPrincipalCents int64
CycleTotalCents int64
// CycleCreditsNotLoadedCents is advisory only (ADR 0018, 2026-11-10).
CycleCreditsNotLoadedCents int64

CycleLoadCents int64
SystemPayoutCents int64
AcceptanceMode CashoutAcceptanceMode
AcceptedCreditsCents int64
QuotedAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
DecisionActorID *uuid.UUID
DecisionReason *string
RestorationTransferID *uuid.UUID
RestorationState *State
}

type CashoutReviewAction​

type CashoutReviewAction string
const (
CashoutReviewActionApprove CashoutReviewAction = "approve"
CashoutReviewActionReject CashoutReviewAction = "reject"
)

type CashoutReviewDecision​

type CashoutReviewDecision struct {
TransferID uuid.UUID
ActorID uuid.UUID
Action CashoutReviewAction
Reason string
IdempotencyKey string
}

type CashoutReviewSettingEvent​

type CashoutReviewSettingEvent struct {
Revision int64
PreviousRequireReview bool
RequireReview bool
PreviousReviewUnrecordedCredits *bool
ReviewUnrecordedCredits *bool
ActorID uuid.UUID
Reason string
CreatedAt time.Time
}

type CashoutReviewSettings​

type CashoutReviewSettings struct {
RequireReview bool
ReviewUnrecordedCredits bool
Revision int64
UpdatedAt time.Time
UpdatedBy *uuid.UUID
}

type CashoutReviewState​

type CashoutReviewState string
const (
CashoutReviewPending CashoutReviewState = "pending_review"
CashoutReviewApproved CashoutReviewState = "approved"
CashoutReviewRestoring CashoutReviewState = "reject_restoring"
CashoutReviewRejected CashoutReviewState = "rejected"
)

func (CashoutReviewState) Valid​

func (s CashoutReviewState) Valid() bool

type ChangeCashoutReviewSettings​

type ChangeCashoutReviewSettings struct {
ActorID uuid.UUID
RequireReview bool
ReviewUnrecordedCredits bool
ExpectedRevision int64
Reason string
IdempotencyKey string
}

type ClearBalanceCommand​

ClearBalanceCommand confirms one quoted losing freeplay cycle, without loading cash.

type ClearBalanceCommand struct {
ProviderAccountID uuid.UUID
PreflightToken uuid.UUID
IdempotencyKey string
}

type Command​

type Command struct {
StaffUnload *StaffWalletUnloadCommand `json:"StaffUnload,omitempty"`
StaffLoad *AdminWalletLoadAudit `json:"StaffLoad,omitempty"`
PreflightToken *uuid.UUID
ForfeitFreeplay bool
BonusOnlyCashoutConsent bool `json:"BonusOnlyCashoutConsent,omitempty"`
ProviderAccountID uuid.UUID
AmountCents int64
GameID *string
IdempotencyKey string
Internal bool
Override *CashoutOverrideCommand
// CycleConflictPreflightID binds a zero-payout give-up of a paid cash or
// Bonus-only cycle, or a Free Play cycle, to the conflict the player consented
// to (ADR 0059). Only Clear Balance sets it.
CycleConflictPreflightID *uuid.UUID `json:"CycleConflictPreflightID,omitempty"`
}

type CreateCommand​

type CreateCommand struct {
UserID uuid.UUID
ProviderAccountID uuid.UUID
GameID *string
CashAmountCents ledger.Cents
CampaignBonusCents ledger.Cents
PlayerPaidCents ledger.Cents
OperatorLoadResolutionAvailable bool
IdempotencyKey string
}

type CreditMove​

type CreditMove struct {
ID uuid.UUID
SourceAccountID uuid.UUID
DestinationAccountID uuid.UUID
SourceCredits int64
DestinationCredits int64
State string
CreatedAt time.Time
CompletedAt *time.Time
}

type CreditMoveFreeplayError​

CreditMoveFreeplayError requires resolution before any game-to-game movement.

type CreditMoveFreeplayError struct{}

func (CreditMoveFreeplayError) Error​

func (CreditMoveFreeplayError) Error() string

func (CreditMoveFreeplayError) Unwrap​

func (CreditMoveFreeplayError) Unwrap() error

type CreditMoveInput​

type CreditMoveInput struct {
SourceAccountID uuid.UUID
DestinationAccountID uuid.UUID
ExpectedSourceCredits int64
IdempotencyKey string
}

type CreditMoveOption​

type CreditMoveOption struct {
DestinationAccountID uuid.UUID
DestinationCredits int64
}

type CreditMoveOptions​

type CreditMoveOptions struct {
SourceCredits int64
ValueCents int64
Destinations []CreditMoveOption
}

type CreditMoveRejectionReason​

CreditMoveRejectionReason owns the closed pre-debit move refusal vocabulary.

type CreditMoveRejectionReason string
const (
CreditMoveRejectionBalanceChanged CreditMoveRejectionReason = "balance_changed"
CreditMoveRejectionFreeplayResolutionRequired CreditMoveRejectionReason = "freeplay_resolution_required" // #nosec G101 -- closed refusal code, not a credential.
)

func CreditMoveRejectionReasons​

func CreditMoveRejectionReasons() []CreditMoveRejectionReason

func ParseCreditMoveRejectionReason​

func ParseCreditMoveRejectionReason(v string) (CreditMoveRejectionReason, error)

func (CreditMoveRejectionReason) Valid​

func (r CreditMoveRejectionReason) Valid() bool

type CycleSource​

CycleSource classifies persisted provider principal; account import state is separate.

type CycleSource string
const (
CycleSourceBonusOnly CycleSource = "bonus_only"
CycleSourceCash CycleSource = "cash"
CycleSourceFreeplay CycleSource = "freeplay"
CycleSourceMixed CycleSource = "mixed"
CycleSourceNone CycleSource = "none"
CycleSourceHistorical CycleSource = "historical"
)

func ParseCycleSource​

func ParseCycleSource(value string) (CycleSource, error)

type Direction​

type Direction string
const (
DirectionLoad Direction = "load"
DirectionUnload Direction = "unload"
)

func Directions​

func Directions() []Direction

func ParseDirection​

func ParseDirection(v string) (Direction, error)

func (Direction) String​

func (direction Direction) String() string

func (Direction) Valid​

func (d Direction) Valid() bool

type FirstUnloadApproveCommand​

type FirstUnloadApproveCommand struct {
AdminID uuid.UUID
ReviewID uuid.UUID
SnapshotVersion int32
ExpectedBalanceCredits int64
ApprovedPayoutCents int64
AssignmentConfirmed bool
Reason string
IdempotencyKey string
}

type FirstUnloadResolveCommand​

type FirstUnloadResolveCommand struct {
AdminID uuid.UUID
ReviewID uuid.UUID
Resolution string
EvidenceReference string
Reason string
IdempotencyKey string
}

type FirstUnloadReview​

type FirstUnloadReview struct {
CancelDisabledReason string
ID uuid.UUID
UserID uuid.UUID
UserEmail *string
ProviderAccountID uuid.UUID
ProviderCode providers.ProviderCode
State string
SnapshotVersion int32
ReviewedBalanceCredits int64
ReviewedValueCents int64
ReviewedObservedAt time.Time
RequestedAt time.Time
ApprovedPayoutCents *int64
ApprovedBy *uuid.UUID
ProviderTransferID *uuid.UUID
SettledAt *time.Time
DebitConfirmed bool
}

type FirstUnloadReviewCycleLoad​

type FirstUnloadReviewCycleLoad struct {
SourceDepositBonusCents int64
SourceCampaignBonusCents int64
TransferID uuid.UUID
AmountCents int64
ProviderCredits int64
SourceCashCents int64
SourceWithdrawableCents int64
SourceFreeplayCents int64
CompletedAt time.Time
}

type FirstUnloadReviewDetail​

type FirstUnloadReviewDetail struct {
TotalLoadedCents int64
DepositBonusCents int64
CampaignBonusCents int64
Review FirstUnloadReview
LinkProof string
LinkReason *string
LinkRequestedBy *uuid.UUID
CycleLoads []FirstUnloadReviewCycleLoad
PrincipalCashCents int64
PrincipalWithdrawableCents int64
PrincipalFreeplayCents int64
Events []FirstUnloadReviewEvent
ApproveDisabledReason string
RejectDisabledReason string
ResolveConfirmedDisabledReason string
ResolveNotAppliedDisabledReason string
}

type FirstUnloadReviewEvent​

type FirstUnloadReviewEvent struct {
ID uuid.UUID
Kind string
CreatedAt time.Time
ActorID *uuid.UUID
Reason *string
Details map[string]any
}

type FirstUnloadReviewResult​

type FirstUnloadReviewResult struct {
Review FirstUnloadReview
Replayed bool
}

type ImportErrorKind​

type ImportErrorKind int
const (
ImportErrorBadRequest ImportErrorKind = iota
ImportErrorConflict
ImportErrorUnavailable
ImportErrorNotFound
)

type LinkVerificationRetryCommand​

LinkVerificationRetryCommand explicitly corrects a terminal failed lookup. The account owns player/provider identity; callers cannot select either.

type LinkVerificationRetryCommand struct {
ActorID, AccountID uuid.UUID
Expected providers.AccountManagementExpected
ExpectedSlot providers.ProviderSlotExpected
AccountIdentifier string
Password providers.SecretMaterial
Reason string
Reference *string
IdempotencyKey string
}

type LinkVerificationRetryResult​

type LinkVerificationRetryResult struct {
OriginalAccountID uuid.UUID `json:"original_account_id"`
AttemptAccountID uuid.UUID `json:"attempt_account_id"`
Expected providers.AccountManagementExpected `json:"expected"`
State providers.AccountManagementOutcome `json:"state"`
}

type LoadIncrementError​

type LoadIncrementError struct {
Message string
Reason LoadReason
}

func (LoadIncrementError) Error​

func (e LoadIncrementError) Error() string

func (LoadIncrementError) Unwrap​

func (e LoadIncrementError) Unwrap() error

type LoadPreflightConfirmation​

type LoadPreflightConfirmation struct {
PreflightToken uuid.UUID
FreeplayConsent bool
BonusOnlyConsent bool
PreferFreeplay bool
}

type LoadReason​

LoadReason is the closed admission vocabulary shared by previews and refusals.

type LoadReason string
const (
LoadReasonBonusRecoveryRequired LoadReason = "bonus_recovery_required"
LoadReasonBonusRequiresPaidCash LoadReason = "bonus_requires_paid_cash"
LoadReasonOK LoadReason = "ok"
LoadReasonTransferInProgress LoadReason = "transfer_in_progress"
LoadReasonFirstReviewPending LoadReason = "first_unload_review_pending"
LoadReasonInsufficientCash LoadReason = "insufficient_cash"
LoadReasonInsufficientBonus LoadReason = "insufficient_bonus"
LoadReasonBonusInterval LoadReason = "bonus_interval"
LoadReasonBonusElsewhere LoadReason = "bonus_elsewhere"
LoadReasonInsufficientFreeplay LoadReason = "insufficient_freeplay"
LoadReasonFreeplayInGame LoadReason = "freeplay_in_game"
LoadReasonRealInGame LoadReason = "real_in_game"
LoadReasonWithdrawableNotLoadable LoadReason = "withdrawable_not_loadable"
LoadReasonInvalidIncrement LoadReason = "invalid_increment"
LoadReasonPreflightStale LoadReason = "load_preflight_stale"
LoadReasonBonusOnlyConsentRequired LoadReason = "bonus_only_consent_required"
LoadReasonConsentRequired LoadReason = "freeplay_consent_required"
LoadReasonPreflightRequired LoadReason = "load_preflight_required"
LoadReasonFreeplayResolutionRequired LoadReason = "freeplay_resolution_required"
LoadReasonBalanceReadCanceled LoadReason = "balance_read_canceled"
LoadReasonBalanceReadTimeout LoadReason = "balance_read_timeout"
LoadReasonBalanceReadDeferred LoadReason = "balance_read_deferred"
LoadReasonBalanceReadConfiguration LoadReason = "balance_read_configuration"
LoadReasonBalanceReadUnsupported LoadReason = "balance_read_unsupported"
LoadReasonBalanceReadDatabase LoadReason = "balance_read_database"
LoadReasonBalanceReadStale LoadReason = "balance_read_stale"
LoadReasonBalanceReadConflict LoadReason = "balance_read_conflict"
LoadReasonBalanceReadDecode LoadReason = "balance_read_decode"
LoadReasonBalanceReadAuth LoadReason = "balance_read_auth"
LoadReasonBalanceReadTransport LoadReason = "balance_read_transport"
LoadReasonBalanceReadUpstream LoadReason = "balance_read_upstream"
LoadReasonBalanceReadInvalidAccount LoadReason = "balance_read_invalid_account"
LoadReasonBalanceReadCredentialsRejected LoadReason = "balance_read_credentials_rejected" // #nosec G101 -- bounded diagnostic code, not credential material.
LoadReasonBalanceReadUnknown LoadReason = "balance_read_unknown"
)

func LoadReasons​

func LoadReasons() []LoadReason

LoadReasons returns the complete vocabulary, including successful previews.

func ParseLoadReason​

func ParseLoadReason(value string) (LoadReason, error)

func (LoadReason) IsBalanceConflict​

func (reason LoadReason) IsBalanceConflict() bool

func (LoadReason) IsBalanceReadFailure​

func (r LoadReason) IsBalanceReadFailure() bool

IsBalanceReadFailure describes a failed read, never a definite money-command refusal.

func (LoadReason) IsRefusal​

func (reason LoadReason) IsRefusal() bool

func (LoadReason) Valid​

func (reason LoadReason) Valid() bool

type LoadRefusalError​

LoadRefusalError carries a stable reason independently of display copy.

type LoadRefusalError struct {
Reason LoadReason
Message string
Conflict bool
PendingLoad *PendingLoad
}

func LoadRefusal​

func LoadRefusal(err error) (LoadRefusalError, bool)

func (LoadRefusalError) Error​

func (e LoadRefusalError) Error() string

func (LoadRefusalError) Unwrap​

func (e LoadRefusalError) Unwrap() error

type PendingLoad​

PendingLoad is current-player display metadata, never settlement evidence.

type PendingLoad struct {
TransferID uuid.UUID
ProviderAccountID uuid.UUID
ProviderCode providers.ProviderCode
GameName string
AmountCents int64
CreatedAt time.Time
State State
Explanation string
NextStep string
}

type ResolveLoadNotAppliedCommand​

ResolveLoadNotAppliedCommand records an operator's independently verified provider outcome. It never authorizes another provider request.

type ResolveLoadNotAppliedCommand struct {
ActorID uuid.UUID
TransferID uuid.UUID
Reason string
EvidenceReference string
IdempotencyKey string
ConfirmedNotApplied bool
}

type ResultError​

ResultError distinguishes a failed result read from a failed transfer command.

type ResultError struct{ Err error }

func (ResultError) Error​

func (e ResultError) Error() string

func (ResultError) Unwrap​

func (e ResultError) Unwrap() error

type StaffWalletRefusal​

type StaffWalletRefusal struct{ Reason StaffWalletRefusalReason }

func (StaffWalletRefusal) Error​

func (e StaffWalletRefusal) Error() string

func (StaffWalletRefusal) Unwrap​

func (e StaffWalletRefusal) Unwrap() error

type StaffWalletRefusalReason​

type StaffWalletRefusalReason string
const (
StaffWalletOperationalOwner StaffWalletRefusalReason = "operational_owner_has_no_wallet"
StaffWalletDisabled StaffWalletRefusalReason = "staff_wallet_actions_disabled"
StaffWalletInactiveSubject StaffWalletRefusalReason = "inactive_wallet_subject"
)

type StaffWalletUnloadCommand​

StaffWalletUnloadCommand binds the ordinary system payout to the reviewed balance.

type StaffWalletUnloadCommand struct {
ActorID uuid.UUID
PreviewToken uuid.UUID
ExpectedBalanceCredits int64
}

type State​

type State string
const (
StatePendingReview State = "pending_review"
StateApproved State = "approved"
StateRejectRestoring State = "reject_restoring"
StateRequested State = "requested"
StateWalletDebited State = "wallet_debited"
StateProviderRequesting State = "provider_requesting"
StateCompleted State = "completed"
StateRejected State = "rejected"
StateUnknownRequiresReconcile State = "unknown_requires_reconcile"
StateFailedInternal State = "failed_internal"
)

func ParseState​

func ParseState(v string) (State, error)

func States​

func States() []State

func (State) String​

func (state State) String() string

func (State) Valid​

func (s State) Valid() bool

type Transfer​

type Transfer struct {
LoadedByStaff bool
CashoutWithdrawableCents *ledger.Cents
RestoresCashoutID *uuid.UUID
// CashoutBreakdown carries issued immutable audit facts, absent only without an audit.
CashoutBreakdown *CashoutBreakdown
BonusOnlyCycle *BonusOnlyCycle
SourceDepositBonusDustCents int64
SourceDepositBonusCents int64
PaidLoadCents int64
SourceCashCents int64
SourceFreeplayCents int64
ID uuid.UUID
UserID uuid.UUID
ProviderAccountID uuid.UUID
ProviderCode providers.ProviderCode
Direction Direction
State State
CashAmountCents ledger.Cents
CampaignBonusCents ledger.Cents
PlayerPaidCents ledger.Cents
OperatorLoadResolutionAvailable bool
ProviderCredits providers.ProviderCredits
ExternalOrderID providers.ExternalOrderID
Evidence *providers.ProviderEvidence
CreatedAt time.Time
UpdatedAt time.Time
// GameName is the provider display name, present only for a rejection whose
// player message names the game and when the registry has a name.
GameName *string
}

type UnlinkPreviewCancelCommand​

type UnlinkPreviewCancelCommand struct {
ActorID, AccountID, PreviewID uuid.UUID
IdempotencyKey string
}

type UnlinkPreviewCommand​

type UnlinkPreviewCommand struct {
ActorID, AccountID uuid.UUID
Expected providers.AccountManagementExpected
Reason string
Reference *string
IdempotencyKey string
}

type UnlinkPreviewResult​

type UnlinkPreviewResult struct {
PreviewID uuid.UUID `json:"preview_id"`
State providers.UnlinkPreviewState `json:"state"`
Expected providers.AccountManagementExpected `json:"expected"`
ExpiresAt time.Time `json:"expires_at"`
ZeroProofAt *time.Time `json:"zero_proof_at"`
ZeroProofValue *int64 `json:"zero_proof_value"`
BlockReason *providers.AccountManagementReason `json:"block_reason,omitempty"`
}

type WalletSource​

type WalletSource string
const (
WalletSourceCash WalletSource = "cash"
WalletSourceWithdrawable WalletSource = "withdrawable_cash"
WalletSourceBonus WalletSource = "deposit_bonus"
WalletSourceFreeplay WalletSource = "freeplay"
)

func ParseWalletSource​

func ParseWalletSource(value string) (WalletSource, error)

type WalletSourceReview​

type WalletSourceReview struct {
Source WalletSource
BeforeCents int64
AmountCents int64
AfterCents int64
}

Generated by gomarkdoc