balancetransaction

package
v1.46.21 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type BalanceTransaction

type BalanceTransaction struct {
	mixin.Model[BalanceTransaction]

	CustomerId string        `json:"customerId"`
	Amount     int64         `json:"amount"` // positive = credit, negative = debit
	Currency   currency.Type `json:"currency" orm:"default:usd"`

	// "adjustment" | "credit_note" | "invoice_payment" | "deposit" | "bank_transfer" | "refund"
	Type string `json:"type"`

	Description   string `json:"description,omitempty"`
	InvoiceId     string `json:"invoiceId,omitempty"`
	CreditNoteId  string `json:"creditNoteId,omitempty"`
	SourceRef     string `json:"sourceRef,omitempty"` // external reference
	EndingBalance int64  `json:"endingBalance"`       // balance after this transaction

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

BalanceTransaction records a single change to a customer's balance. Positive amount = credit (adds to balance), negative = debit.

func (*BalanceTransaction) Load

func (bt *BalanceTransaction) Load(ps []datastore.Property) (err error)

func (*BalanceTransaction) Save

func (bt *BalanceTransaction) Save() (ps []datastore.Property, err error)

func (*BalanceTransaction) Validator

func (bt *BalanceTransaction) Validator() *val.Validator

Jump to

Keyboard shortcuts

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