import { SmrtCollection, SmrtObject } from '@happyvertical/smrt-core'; export type PricingStrategy = 'fixed_unit' | 'cost_plus' | 'multiplier' | 'tiered' | 'included_overage' | 'flat' | 'custom'; export type SpendingPolicyBehavior = 'observe' | 'warn' | 'block' | 'approval_required'; export type SpendingPeriod = 'day' | 'week' | 'month' | 'year' | 'rolling'; export declare class PricingRule extends SmrtObject { tenantId?: string; ruleKey: string; metricKey: string; serviceKey: string; strategy: PricingStrategy; currency: string; effectiveFrom: Date; effectiveTo: Date | null; priority: number; terms: string; active: boolean; getTerms(): Record; setTerms(value: Record): void; } export declare class ClientCharge extends SmrtObject { tenantId?: string; usageEventId: string; subscriberKind: string; subscriberExternalId: string; projectId: string; workRefType: string; workRefId: string; provider: string; serviceKey: string; metricKey: string; /** * Metered quantity — genuinely fractional (`duration.seconds`, token counts * scaled by a rate), so it stays DECIMAL. */ quantity: number; /** * Charge in **integer minor units** of {@link currency} (#2401). * * Summed against {@link BillingAdjustment.amount} and compared against * {@link SpendingPolicy.limitAmount}, so all three carry the same unit — * `CommercialService.calculateAmount()` rounds to a whole minor unit at the * one boundary where the fractional pricing terms meet money. */ amount: number; currency: string; pricingRuleId: string; pricingSnapshot: string; status: 'draft' | 'approved' | 'adjusted'; approvedAt: Date | null; getPricingSnapshot(): Record; protected validateBeforeSave(): Promise; } export declare class BillingAdjustment extends SmrtObject { tenantId?: string; clientChargeId: string; /** * Signed correction in **integer minor units**, same unit as * {@link ClientCharge.amount} it adjusts. Negative values are legitimate * (a credit) — that is why the non-negative guard in * `CommercialService.calculateAmount()` does not apply here (#2401). */ amount: number; currency: string; reason: string; source: string; sourceId: string; createdBy: string; protected validateBeforeSave(): Promise; } export declare class SpendingPolicy extends SmrtObject { tenantId?: string; name: string; subscriberKind: string; subscriberExternalId: string; projectId: string; serviceKey: string; metricKey: string; period: SpendingPeriod; rollingSeconds: number; /** * Spending cap in **integer minor units** of {@link currency}. Compared * directly against the sum of `ClientCharge.amount` + `BillingAdjustment`s * plus the caller's estimate, so it must carry the same unit (#2401). */ limitAmount: number; currency: string; behavior: SpendingPolicyBehavior; priority: number; active: boolean; protected validateBeforeSave(): Promise; } export declare class PricingRuleCollection extends SmrtCollection { static readonly _itemClass: typeof PricingRule; } export declare class ClientChargeCollection extends SmrtCollection { static readonly _itemClass: typeof ClientCharge; } export declare class BillingAdjustmentCollection extends SmrtCollection { static readonly _itemClass: typeof BillingAdjustment; } export declare class SpendingPolicyCollection extends SmrtCollection { static readonly _itemClass: typeof SpendingPolicy; } //# sourceMappingURL=commercial.d.ts.map