Generated from package comments and exported declarations. Edit the Go source, not this file.
lifecycle
import "codeberg.org/hemanta212/playgo/api/lifecycle"
Package lifecycle defines durable business facts emitted by payments and provider transfers.
A lifecycle fact records that something meaningful happened - a deposit settled, a transfer completed, a withdrawal reached a terminal state - independently of the command tables that produced it.
The indirection is deliberate. Reporting and provenance can reason about deposits, withdrawals, settlement, reconciliation exposure, and player activity without coupling every dashboard to the internals of every command. Facts are append-oriented and should be treated as the semantic audit trail for state changes that cross domain boundaries.
Constants
const FactSchemaV1 = "lifecycle.fact/2026-07-17.v1"
Variables
var (
ErrInvalidFact = errors.New("invalid lifecycle fact")
ErrFactConflict = errors.New("lifecycle fact conflict")
)
type Fact
type Fact struct {
Kind FactKind
UserID uuid.UUID
SourceID uuid.UUID
OccurredAt time.Time
SchemaVersion string
ProviderCode *string
GameID *string
AmountCents *int64
}
type FactKind
type FactKind string
const (
FactKindRegistration FactKind = "registration"
FactKindGameLoadSucceeded FactKind = "game_load_succeeded"
FactKindGameLaunchSucceeded FactKind = "game_launch_succeeded"
FactKindDepositSettled FactKind = "deposit_settled"
FactKindDepositReversed FactKind = "deposit_reversed"
FactKindGameCashoutCompleted FactKind = "game_cashout_completed"
FactKindWithdrawalReserved FactKind = "withdrawal_reserved"
FactKindWithdrawalSettled FactKind = "withdrawal_settled"
FactKindWithdrawalReleased FactKind = "withdrawal_released"
)
func (FactKind) MeaningfulActivity
func (kind FactKind) MeaningfulActivity() bool
func (FactKind) Valid
func (kind FactKind) Valid() bool
type RecordResult
type RecordResult struct {
ID uuid.UUID
Replayed bool
}
Generated by gomarkdoc