Files
cfw-autumn/shared/models/cusModels/billingControls/entityBillingControls.ts
Owen Greenhalgh 45911f43b6 update docs
2026-06-11 20:49:51 +01:00

29 lines
1.2 KiB
TypeScript

import { z } from "zod/v4";
import { DbOverageAllowedSchema } from "./overageAllowed.js";
import { DbSpendLimitSchema } from "./spendLimit.js";
import { DbUsageAlertSchema } from "./usageAlert.js";
import { DbUsageLimitSchema } from "./usageLimit.js";
export const EntityBillingControlsSchema = z.object({
spend_limits: z.array(DbSpendLimitSchema).optional().meta({
description:
"List of spend limits per feature. Each entry caps overage (overage_limit) and/or per-interval usage (usage_limit).",
}),
usage_limits: z.array(DbUsageLimitSchema).optional().meta({
description:
"List of hard usage caps per feature for this entity (max units per interval). An entity entry overrides the customer's for that feature.",
}),
usage_alerts: z.array(DbUsageAlertSchema).optional().meta({
description: "List of usage alert configurations per feature.",
}),
overage_allowed: z.array(DbOverageAllowedSchema).optional().meta({
description:
"List of overage allowed controls per feature. When enabled, usage can exceed balance.",
}),
});
export type EntityBillingControls = z.infer<typeof EntityBillingControlsSchema>;
export type EntityBillingControlsParams = z.input<
typeof EntityBillingControlsSchema
>;