From 8e5d85829d3c5812bca5057f1f3bd662ed303412 Mon Sep 17 00:00:00 2001 From: Christopher Brady Date: Fri, 10 Jul 2026 09:12:32 -0600 Subject: [PATCH] add warning tiers to feature entitlement --- models.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/models.go b/models.go index 5e0f62a..53ee5e1 100644 --- a/models.go +++ b/models.go @@ -153,6 +153,15 @@ type FeatureEntitlement struct { SoftLimit *int64 `json:"soft_limit" desc:"For usage-based pricing, the soft limit for overage charges or the next tier boundary"` Usage *int64 `json:"usage" desc:"If the company has a numeric entitlement for this feature, the current usage amount"` ValueType EntitlementValueType `json:"value_type" binding:"oneof=boolean credit numeric trait unknown unlimited" desc:"The type of the entitlement value"` + WarningTiers JSONSlice[*WarningTier] `json:"warning_tiers,omitempty" desc:"Customer-defined usage warning thresholds configured on this entitlement"` +} + +// WarningTier is a customer-defined usage warning threshold on a feature +// entitlement. Key is a customer label identifying the tier; Value is the +// threshold, expressed in the entitlement's usage units. +type WarningTier struct { + Key string `json:"key" desc:"A customer-defined identifier for the warning tier"` + Value int64 `json:"value" desc:"The warning threshold, in the entitlement's usage units"` } type Company struct {