Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SpendAlert ¶
type SpendAlert struct {
mixin.Model[SpendAlert]
UserId string `json:"userId"`
Title string `json:"title"`
Threshold int64 `json:"threshold"` // cents
Currency string `json:"currency"`
// TriggeredAt stores the ISO timestamp when the alert last fired.
// Empty string means not yet triggered.
TriggeredAt string `json:"triggeredAt,omitempty"`
}
SpendAlert is a user-configured threshold alert on cumulative spend. When the user's spend exceeds Threshold (in cents) for the billing period, the alert triggers (TriggeredAt is set).
func New ¶
func New(db *datastore.Datastore) *SpendAlert
func (*SpendAlert) Validator ¶
func (s *SpendAlert) Validator() *val.Validator
Click to show internal directories.
Click to hide internal directories.