usagewatermark

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type UsageWatermark

type UsageWatermark struct {
	mixin.Model[UsageWatermark]

	SubscriptionItemId string `json:"subscriptionItemId"`
	MeterId            string `json:"meterId"`
	InvoiceId          string `json:"invoiceId"`

	PeriodStart time.Time `json:"periodStart"`
	PeriodEnd   time.Time `json:"periodEnd"`

	// Usage value that was aggregated into the invoice
	AggregatedValue int64 `json:"aggregatedValue"`

	// Number of events included in the aggregation
	EventCount int64 `json:"eventCount"`

	// Latest event timestamp included in this watermark
	LastEventTimestamp time.Time `json:"lastEventTimestamp"`
}

UsageWatermark records the last aggregated position for a subscription item within an invoice period. This prevents double-invoicing of usage events and supports late-arriving event handling.

func New

func (*UsageWatermark) Load

func (w *UsageWatermark) Load(ps []datastore.Property) (err error)

func (*UsageWatermark) Save

func (w *UsageWatermark) Save() (ps []datastore.Property, err error)

func (*UsageWatermark) Validator

func (w *UsageWatermark) Validator() *val.Validator

Jump to

Keyboard shortcuts

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