import { SmrtCollection } from '@happyvertical/smrt-core'; import { CommissionPlan } from '../models/CommissionPlan.js'; import { CommissionPlanComponent, CommissionPlanStatus } from '../types.js'; /** * Fields an amendment may change relative to the version it copies. * `planKey` is fixed (it identifies the plan), `version` is computed, and * `status` is always `draft` — a caller cannot mint a pre-activated * amendment. */ export interface CommissionPlanAmendmentChanges { name?: string; description?: string; components?: CommissionPlanComponent[]; currency?: string; effectiveFrom?: Date | null; metadata?: Record; } export declare class CommissionPlanCollection extends SmrtCollection { static readonly _itemClass: typeof CommissionPlan; /** Every version of a plan, newest version first. */ findByPlanKey(planKey: string): Promise; /** Plans by status. */ findByStatus(status: CommissionPlanStatus): Promise; /** * The highest ACTIVE version of a plan already IN EFFECT at `at`, or * `null` when none is. This is what calculation callers resolve terms * from when no frozen snapshot pins a specific version. A future-dated * amendment can be activated ahead of its effective date without * governing earlier qualifications (`effectiveFrom: null` = effective * immediately). */ latestActiveByKey(planKey: 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 `planKey` exists (nothing to amend — use * `create` for a brand-new plan). */ createAmendment(planKey: string, changes?: CommissionPlanAmendmentChanges): Promise; } export default CommissionPlanCollection; //# sourceMappingURL=CommissionPlanCollection.d.ts.map