import { CreditCurrencyConfigSchema, CreditRuleConfigSchema, SubscriptionOverrideConfigSchema } from './AccountingConfigDto.js'; import { z } from 'zod'; /** * Config Sync DTOs * * These schemas reuse the existing Create*Dto schemas by: * 1. Using .omit() to remove parent keys (productKey, planKey) that come from nesting * 2. Using .extend() to add config-specific fields (archived, nested structures) */ /** * Billing Cycle Configuration * Maps to CreateBillingCycleDto / UpdateBillingCycleDto * Reuses CreateBillingCycleDtoSchema validation, omitting planKey (comes from nested structure) */ export declare const BillingCycleConfigSchema: z.ZodObject<{ key: z.ZodString; description: z.ZodOptional; displayName: z.ZodString; durationValue: z.ZodOptional; durationUnit: z.ZodEnum<{ days: "days"; weeks: "weeks"; months: "months"; years: "years"; forever: "forever"; }>; externalProductId: z.ZodOptional; archived: z.ZodOptional; }, z.core.$strip>; export type BillingCycleConfig = z.infer; /** * Plan Configuration * Maps to CreatePlanDto / UpdatePlanDto * Reuses CreatePlanDtoSchema validation, omitting productKey (comes from nested structure) * Note: CreatePlanDtoSchema has no refinements, so we can use .omit() directly */ export declare const PlanConfigSchema: z.ZodObject<{ key: z.ZodString; description: z.ZodOptional; metadata: z.ZodOptional>; displayName: z.ZodString; onExpireTransitionToBillingCycleKey: z.ZodOptional; archived: z.ZodOptional; creditGrants: z.ZodOptional; expiryPolicy: z.ZodOptional>; cancellationPolicy: z.ZodOptional>; }, z.core.$strip>>>; featureValues: z.ZodOptional>; billingCycles: z.ZodOptional; displayName: z.ZodString; durationValue: z.ZodOptional; durationUnit: z.ZodEnum<{ days: "days"; weeks: "weeks"; months: "months"; years: "years"; forever: "forever"; }>; externalProductId: z.ZodOptional; archived: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; export type PlanConfig = z.infer; /** * Feature Configuration * Maps to CreateFeatureDto / UpdateFeatureDto * Reuses CreateFeatureDtoSchema validation, adding archived field */ export declare const FeatureConfigSchema: z.ZodObject<{ key: z.ZodString; displayName: z.ZodString; description: z.ZodOptional; valueType: z.ZodEnum<{ toggle: "toggle"; numeric: "numeric"; text: "text"; metered: "metered"; }>; defaultValue: z.ZodString; groupName: z.ZodOptional; meteredConfig: z.ZodOptional; enforcement: z.ZodEnum<{ hard: "hard"; soft: "soft"; }>; aggregation: z.ZodEnum<{ count: "count"; sum: "sum"; }>; usageScope: z.ZodEnum<{ customer: "customer"; subscription: "subscription"; }>; }, z.core.$strip>>; validator: z.ZodOptional>; metadata: z.ZodOptional>; creditConsumptionRules: z.ZodOptional>>; archived: z.ZodOptional; }, z.core.$strip>; export type FeatureConfig = z.infer; /** * Product Configuration * Maps to CreateProductDto / UpdateProductDto * Reuses CreateProductDtoSchema validation (no refinements, so we can extend directly) */ export declare const ProductConfigSchema: z.ZodObject<{ key: z.ZodString; displayName: z.ZodString; description: z.ZodOptional; metadata: z.ZodOptional>; addons: z.ZodOptional; compositionMode: z.ZodOptional>; priority: z.ZodOptional; archived: z.ZodOptional; metadata: z.ZodOptional>; featureValues: z.ZodOptional>; }, z.core.$strip>>>; featureResolution: z.ZodOptional>; subscriptionRule: z.ZodOptional>>; }, z.core.$strip>>>; archived: z.ZodOptional; features: z.ZodOptional>; plans: z.ZodOptional; metadata: z.ZodOptional>; displayName: z.ZodString; onExpireTransitionToBillingCycleKey: z.ZodOptional; archived: z.ZodOptional; creditGrants: z.ZodOptional; expiryPolicy: z.ZodOptional>; cancellationPolicy: z.ZodOptional>; }, z.core.$strip>>>; featureValues: z.ZodOptional>; billingCycles: z.ZodOptional; displayName: z.ZodString; durationValue: z.ZodOptional; durationUnit: z.ZodEnum<{ days: "days"; weeks: "weeks"; months: "months"; years: "years"; forever: "forever"; }>; externalProductId: z.ZodOptional; archived: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>>; }, z.core.$strip>; export type ProductConfig = z.infer; /** * Root Configuration DTO * IMPORTANT: In JSON, features must appear before products. The TypeScript interface order does not enforce this - validation will check JSON property order. */ export interface ConfigSyncDto { creditConsumptionRules?: Array & { featureKey: string; }>; creditCurrencies?: z.infer[]; subscriptions?: z.infer[]; version: string; features: FeatureConfig[]; products: ProductConfig[]; } /** * Sync Report returned after sync operations */ export interface ConfigSyncReport { details?: { created: number; updated: number; removed: number; unchanged: number; changes: Array<{ entityType: string; key: string; action: string; }>; }; created: { features: number; products: number; plans: number; billingCycles: number; }; updated: { features: number; products: number; plans: number; billingCycles: number; }; archived: { features: number; products: number; plans: number; billingCycles: number; }; unarchived: { features: number; products: number; plans: number; billingCycles: number; }; ignored: { features: number; products: number; plans: number; billingCycles: number; }; errors: Array<{ entityType: "feature" | "product" | "plan" | "billingCycle" | "entitlement"; key: string; message: string; }>; warnings: Array<{ entityType: "feature" | "product" | "plan" | "billingCycle" | "entitlement"; key: string; message: string; }>; } /** * Root Configuration Schema with cross-field validation */ export declare const ConfigSyncDtoSchema: z.ZodObject<{ creditConsumptionRules: z.ZodOptional>>; creditCurrencies: z.ZodOptional; metadata: z.ZodOptional>; }, z.core.$strip>>>; subscriptions: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ featureKey: z.ZodString; value: z.ZodString; type: z.ZodEnum<{ permanent: "permanent"; temporary: "temporary"; timed: "timed"; }>; expiresAt: z.ZodOptional>; remove: z.ZodOptional>; }, z.core.$strict>]>>; }, z.core.$strip>>>; version: z.ZodString; features: z.ZodArray; valueType: z.ZodEnum<{ toggle: "toggle"; numeric: "numeric"; text: "text"; metered: "metered"; }>; defaultValue: z.ZodString; groupName: z.ZodOptional; meteredConfig: z.ZodOptional; enforcement: z.ZodEnum<{ hard: "hard"; soft: "soft"; }>; aggregation: z.ZodEnum<{ count: "count"; sum: "sum"; }>; usageScope: z.ZodEnum<{ customer: "customer"; subscription: "subscription"; }>; }, z.core.$strip>>; validator: z.ZodOptional>; metadata: z.ZodOptional>; creditConsumptionRules: z.ZodOptional>>; archived: z.ZodOptional; }, z.core.$strip>>; products: z.ZodArray; metadata: z.ZodOptional>; addons: z.ZodOptional; compositionMode: z.ZodOptional>; priority: z.ZodOptional; archived: z.ZodOptional; metadata: z.ZodOptional>; featureValues: z.ZodOptional>; }, z.core.$strip>>>; featureResolution: z.ZodOptional>; subscriptionRule: z.ZodOptional>>; }, z.core.$strip>>>; archived: z.ZodOptional; features: z.ZodOptional>; plans: z.ZodOptional; metadata: z.ZodOptional>; displayName: z.ZodString; onExpireTransitionToBillingCycleKey: z.ZodOptional; archived: z.ZodOptional; creditGrants: z.ZodOptional; expiryPolicy: z.ZodOptional>; cancellationPolicy: z.ZodOptional>; }, z.core.$strip>>>; featureValues: z.ZodOptional>; billingCycles: z.ZodOptional; displayName: z.ZodString; durationValue: z.ZodOptional; durationUnit: z.ZodEnum<{ days: "days"; weeks: "weeks"; months: "months"; years: "years"; forever: "forever"; }>; externalProductId: z.ZodOptional; archived: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>>; }, z.core.$strip>>; }, z.core.$strip>; /** * Validates a JSON string for property order before parsing * This should be called before JSON.parse() when loading from file */ export declare function validateConfigJsonPropertyOrder(jsonString: string): void; //# sourceMappingURL=ConfigSyncDto.d.ts.map