transaction

package
v1.37.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type Transaction

type Transaction struct {
	mixin.Model[Transaction]

	DestinationId   string `json:"destinationId"`
	DestinationKind string `json:"destinationKind"`

	Currency currency.Type  `json:"currency"`
	Amount   currency.Cents `json:"amount"`
	Type     Type           `json:"type"`

	Test bool `json:"test"`

	// Short text human readable description
	Notes string `json:"notes,omitempty"`

	// For searching
	Tags string `json:"tags,omitempty"`

	Event string `json:"event,omitempty"`

	// Source Data
	// We store Kind even though it is encoded in id for easier reference
	SourceId   string `json:"sourceId,omitempty"`
	SourceKind string `json:"sourceKind,omitempty"`

	// ExpiresAt marks when a deposit credit expires. Zero value means no expiry.
	// Expired deposits are excluded from balance calculations.
	ExpiresAt time.Time `json:"expiresAt,omitempty"`

	// Deprecated
	UserId string `json:"-"`

	Metadata  Map    `json:"metadata,omitempty" datastore:"-"`
	Metadata_ string `json:"-" datastore:",noindex"`
}

func Fake

func Fake(db *datastore.Datastore) *Transaction

func New

func (*Transaction) Load

func (t *Transaction) Load(ps []datastore.Property) (err error)

func (*Transaction) Save

func (t *Transaction) Save() (ps []datastore.Property, err error)

func (*Transaction) Validator

func (t *Transaction) Validator() *val.Validator

type Type

type Type string
const (
	Hold        Type = "hold"
	HoldRemoved Type = "hold-removed"
	Transfer    Type = "transfer"
	Deposit     Type = "deposit"
	Withdraw    Type = "withdraw"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL