Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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"`
// Scope attribution for per-scope spend caps (issue #70). Both are INDEXED so
// spend can be summed per (project,service) scope for the calendar-month
// period. Empty = the org-wide default scope (a legacy row that predates
// scoping has NO Project/Service property and is therefore only ever counted
// in an unfiltered org-wide sum, never in a project- or service-scoped one).
Project string `json:"project,omitempty"`
Service string `json:"service,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 New(db *datastore.Datastore) *Transaction
func (*Transaction) Validator ¶
func (t *Transaction) Validator() *val.Validator
Click to show internal directories.
Click to hide internal directories.