feat: add usage alerts schema and database support
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
} from "./entityBillingControls.js";
|
||||
import { PurchaseLimitIntervalEnum } from "./purchaseLimitInterval.js";
|
||||
import { type DbSpendLimit, DbSpendLimitSchema } from "./spendLimit.js";
|
||||
import { type DbUsageAlert, DbUsageAlertSchema } from "./usageAlert.js";
|
||||
|
||||
export const AutoTopupPurchaseLimitSchema = z.object({
|
||||
interval: PurchaseLimitIntervalEnum.meta({
|
||||
@@ -45,6 +46,9 @@ export const CustomerBillingControlsSchema = z.object({
|
||||
spend_limits: z.array(DbSpendLimitSchema).optional().meta({
|
||||
description: "List of overage spend limits per feature.",
|
||||
}),
|
||||
usage_alerts: z.array(DbUsageAlertSchema).optional().meta({
|
||||
description: "List of usage alert configurations per feature.",
|
||||
}),
|
||||
});
|
||||
|
||||
export const CustomerBillingControlsParamsSchema =
|
||||
@@ -85,9 +89,10 @@ export type CustomerBillingControlsParams = z.input<
|
||||
typeof CustomerBillingControlsParamsSchema
|
||||
>;
|
||||
|
||||
export { EntityBillingControlsSchema, DbSpendLimitSchema };
|
||||
export { EntityBillingControlsSchema, DbSpendLimitSchema, DbUsageAlertSchema };
|
||||
export type {
|
||||
EntityBillingControls,
|
||||
EntityBillingControlsParams,
|
||||
DbSpendLimit,
|
||||
DbUsageAlert,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user