spendalert

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

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

Jump to

Keyboard shortcuts

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