import { SmrtObject } from '@happyvertical/smrt-core'; import { CommissionPlanComponent } from '../../commissions/index.js'; import { ReferralAgreementApprovalMode, ReferralTermSnapshotOptions } from '../types.js'; export declare class ReferralTermSnapshot extends SmrtObject { /** Tenant ID for multi-tenant isolation (nullable → global rows). */ tenantId: string | null; /** The Referral this snapshot governs. Required. */ referralId: string; /** Id of the ReferralAgreement the terms came from. */ agreementId: string; /** Version of the agreement at qualification time. */ agreementVersion: number; /** CommissionPlan key the components were copied from. */ planKey: string; /** * CommissionPlan version PINNED at qualification — when the agreement * left the version unpinned (`0`), this records the latest-active version * that was resolved. */ planVersion: number; /** AttributionPolicy key stamped on the referral at attribution. */ policyKey: string; /** AttributionPolicy version stamped on the referral at attribution. */ policyVersion: number; /** * FROZEN copy of the plan's components JSON — THE calculation inputs. * Use {@link getComponents} for the typed array. */ components: string; /** ISO 4217 currency the frozen terms are denominated in. */ currency: string; /** Clearing window (days) copied from the agreement. */ clearingDays: number; /** Approval mode copied from the agreement. */ approvalMode: ReferralAgreementApprovalMode; /** Additional metadata as a JSON string (immutable like every field). */ metadata: string; constructor(options?: ReferralTermSnapshotOptions); /** Capture the persisted state so the save guard can reject mutations. */ initialize(): Promise; /** * Parse {@link components} into the typed plan-component array the * calculation service consumes; returns `[]` on empty/invalid JSON. */ getComponents(): CommissionPlanComponent[]; /** Parse {@link metadata}; returns `{}` on malformed content. */ getMetadata(): Record; /** * Save with the full-immutability guard: * * - A hydrated persisted row must serialize IDENTICALLY to its captured * state — any field change throws (no-op re-saves pass). * - An instance carrying an existing row's id WITHOUT having hydrated it * (e.g. `create({ id, _skipLoad: true })`) is rejected outright — blind * overwrites can't sidestep the comparison. */ save(): Promise; private serializeState; } export default ReferralTermSnapshot; //# sourceMappingURL=ReferralTermSnapshot.d.ts.map