import { SmrtCollection } from '@happyvertical/smrt-core'; import { AttributionPolicy } from '../models/AttributionPolicy.js'; import { AttributionConflictBehavior, AttributionCreditMode, AttributionPolicyStatus } from '../types.js'; /** * Fields an amendment may change relative to the version it copies. * `policyKey` is fixed (it identifies the policy), `version` is computed, * and `status` is always `draft` — a caller cannot mint a pre-activated * amendment. */ export interface AttributionPolicyAmendmentChanges { windowDays?: number; creditMode?: AttributionCreditMode; conflictBehavior?: AttributionConflictBehavior; allowSelfReferral?: boolean; allowExistingClients?: boolean; eligibleServices?: string[]; eligibleCampaigns?: string[]; eligibleRegions?: string[]; effectiveFrom?: Date | null; metadata?: Record; } export declare class AttributionPolicyCollection extends SmrtCollection { static readonly _itemClass: typeof AttributionPolicy; /** Every version of a policy, newest version first. */ findByPolicyKey(policyKey: string): Promise; /** Policies by status. */ findByStatus(status: AttributionPolicyStatus): Promise; /** * The highest ACTIVE version of a policy already IN EFFECT at `at`, or * `null` when none is. This is what `AttributionService.resolve()` loads * when the caller doesn't pin a version. A future-dated amendment can be * activated ahead of its effective date without governing attributions * resolved before it takes effect (`effectiveFrom: null` = effective * immediately). */ latestActiveByKey(policyKey: string, at?: Date, tenantId?: string | null): Promise; /** * Create an amendment: insert a new DRAFT row with * `version = max(existing versions) + 1`, copying the latest existing * version's fields and then applying `changes`. The source version is not * touched — activate the draft (and supersede the prior active version) * as a separate, explicit step. * * Throws when no version of `policyKey` exists (nothing to amend — use * `create` for a brand-new policy). */ createAmendment(policyKey: string, changes?: AttributionPolicyAmendmentChanges): Promise; } export default AttributionPolicyCollection; //# sourceMappingURL=AttributionPolicyCollection.d.ts.map