Skip to main content

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

provenance

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

Package provenance defines money-source and withdrawal-provenance read contracts.

Provenance answers "where did this money come from". Before approving a payout, a reviewer needs to know whether the balance came from real external deposits, bonuses, referrals, provider transfers, or tester and system sources - because those justify very different decisions.

This package is read-oriented. The commands live in the payment and transfer services; provenance exists to preserve explainability for review and reconciliation, so a decision made today can still be understood next year.

Package provenance defines withdrawal-source accounting contracts.

Constants​

const ProviderPlatformOnlyNote = "Provider redemption evidence proves the provider/platform, not an individual slot game."

Variables​

var (
ErrInvalidInput = errors.New("withdrawal provenance: invalid input")
ErrInsufficientLots = errors.New("withdrawal provenance: insufficient available lots")
ErrTransitionConflict = errors.New("withdrawal provenance: terminal transition conflict")
ErrReconciliation = errors.New("withdrawal provenance: reconciliation mismatch")
)

type Allocation​

type Allocation struct {
ID uuid.UUID
LotID uuid.UUID
WithdrawalID uuid.UUID
AmountCents ledger.Cents
State AllocationState
ReservationTransactionID uuid.UUID
TerminalTransactionID *uuid.UUID
ReservedAt time.Time
TerminalAt *time.Time
}

type AllocationEventKind​

type AllocationEventKind string
const (
EventReserved AllocationEventKind = "reserved"
EventConsumed AllocationEventKind = "consumed"
EventReleased AllocationEventKind = "released"
)

func EventKindForState​

func EventKindForState(state AllocationState) (AllocationEventKind, bool)

func (AllocationEventKind) String​

func (kind AllocationEventKind) String() string

type AllocationState​

type AllocationState string
const (
AllocationReserved AllocationState = "reserved"
AllocationConsumed AllocationState = "consumed"
AllocationReleased AllocationState = "released"
)

func (AllocationState) String​

func (state AllocationState) String() string

type AttributionScope​

type AttributionScope string
const (
AttributionProviderPlatformOnly AttributionScope = "provider_platform_only"
AttributionExplicitNonGame AttributionScope = "explicit_non_game"
AttributionLegacyOpening AttributionScope = "legacy_opening"
)

func (AttributionScope) String​

func (scope AttributionScope) String() string

type Lot​

type Lot struct {
ID uuid.UUID
UserID uuid.UUID
SourceKind SourceKind
Quality Quality
OriginalAmountCents ledger.Cents
ProviderCode *providers.ProviderCode
GameRef *providers.GameRef
CashoutTransferID *uuid.UUID
CashoutRef *providers.ExternalOrderID
LedgerTransactionID *uuid.UUID
SourceActorID *uuid.UUID
SourceRef string
OccurredAt time.Time
CreatedAt time.Time
}

type PlayerSummary​

type PlayerSummary struct {
UserID uuid.UUID
OriginalAmountCents ledger.Cents
PriorConsumedAmountCents ledger.Cents
ReservedAmountCents ledger.Cents
AllocatedAmountCents ledger.Cents
RemainingAmountCents ledger.Cents
CurrentPayableAmountCents ledger.Cents
LedgerBalanceCents ledger.Cents
ReconciliationDeltaCents ledger.Cents
Quality Quality
}

type Quality​

type Quality string
const (
QualityAuthoritative Quality = "authoritative"
QualityExplicitNonGame Quality = "explicit_non_game"
QualityNonAuthoritative Quality = "non_authoritative"
QualityMixed Quality = "mixed"
QualityUnattributed Quality = "unattributed"
)

func ParseQuality​

func ParseQuality(value string) (Quality, bool)

func (Quality) String​

func (quality Quality) String() string

type SourceKind​

type SourceKind string
const (
SourceProviderCashout SourceKind = "provider_cashout"
SourceTester SourceKind = "tester"
SourceAdmin SourceKind = "admin"
SourceLegacyOpening SourceKind = "legacy_opening"
// SourceProviderReviewedUnload is Withdrawable Cash from an admin-reviewed
// first unload of a linked provider account; it is never PlayGo-funded
// provider_cashout provenance.
SourceProviderReviewedUnload SourceKind = "provider_reviewed_unload"
)

func ParseSourceKind​

func ParseSourceKind(value string) (SourceKind, bool)

func (SourceKind) ExplicitNonGame​

func (kind SourceKind) ExplicitNonGame() bool

func (SourceKind) String​

func (kind SourceKind) String() string

type WithdrawalReport​

type WithdrawalReport struct {
WithdrawalID uuid.UUID
UserID uuid.UUID
State string
RequestedAmountCents ledger.Cents
ReservationAmountCents ledger.Cents
CurrentlyReservedCents ledger.Cents
GrossAmountCents ledger.Cents
EstimatedFeeAmountCents ledger.Cents
EstimatedNetAmountCents ledger.Cents
ActualFeeAmountCents *ledger.Cents
ActualNetAmountCents *ledger.Cents
AllocatedAmountCents ledger.Cents
LedgerBalanceCents ledger.Cents
ReconciliationDeltaCents ledger.Cents
Quality Quality
RequestedAt time.Time
ReservedAt time.Time
CompletedAt *time.Time
Sources []WithdrawalSource
}

type WithdrawalSource​

type WithdrawalSource struct {
LotID uuid.UUID
WithdrawalID uuid.UUID
SourceKind SourceKind
AttributionScope AttributionScope
AttributionNote string
ProviderCode *providers.ProviderCode
GameRef *providers.GameRef
ProviderAccountID *uuid.UUID
ProviderAccountRef *providers.ProviderPlayerAccountRef
CashoutTransferID *uuid.UUID
CashoutRef *providers.ExternalOrderID
OriginalAmountCents ledger.Cents
PriorConsumedAmountCents ledger.Cents
CurrentlyReservedCents ledger.Cents
CurrentAllocationCents ledger.Cents
RemainingAmountCents ledger.Cents
CurrentPayableAmountCents ledger.Cents
Quality Quality
OccurredAt time.Time
CreatedAt time.Time
ReservedAt time.Time
TerminalAt *time.Time
}

Generated by gomarkdoc