Documentation
¶
Overview ¶
Package budget is the domain layer for the Budget entity: a recurring spend cap in USD over a calendar period in UTC. Policies link budgets by id.
This package validates one row's shape, fills its defaults, and stores it. Out of scope: counting spend, refusing requests over a cap, and the pricing a capped model needs.
Index ¶
Constants ¶
const ( DefaultPeriod = PeriodMonth DefaultMode = ModeHard )
Defaults for the fields a wire form may omit.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Budget ¶
type Budget struct {
Meta meta.Metadata `json:"metadata" yaml:"metadata"`
Spec Spec `json:"spec" yaml:"spec"`
}
Budget is a named, recurring spend cap.
type Spec ¶
type Spec struct {
// AmountUSD is a decimal string with at most two fractional digits, so money never round-trips through a float.
AmountUSD string `` /* 233-byte string literal not displayed */
Period Period `` /* 178-byte string literal not displayed */
Mode Mode `` /* 254-byte string literal not displayed */
}
Spec carries the cap, its period and its mode.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the Budget data-access type.