import { SmrtClassOptions } from '@happyvertical/smrt-core'; import { CommissionCollection } from '../collections/CommissionCollection.js'; import { Commission } from '../models/Commission.js'; export declare class CommissionSettlementService { private readonly commissions; constructor(commissions: CommissionCollection); static create(classOptions?: SmrtClassOptions): Promise; /** * Sweep the clearing window: every `pending` commission whose * `clearingEndsAt` is `<= now` — or whose `clearingEndsAt` is `null` * (null means NO clearing window applies, so the row is immediately * sweepable) — transitions to `earned` and is saved. * * @returns The commissions that were marked earned by this sweep. */ sweepClearing(now?: Date): Promise; /** * Approve `earned` commissions by id (`earned → approved`). Strict: a * missing id or a commission in any other status throws — the caller * names exact rows, so a mismatch is a bug worth surfacing, not skipping. */ approveCommissions(ids: string[], now?: Date): Promise; /** * Release `approved` commissions to `payable` by id. Strict — see * {@link approveCommissions}. */ markPayable(ids: string[], now?: Date): Promise; /** * Convenience chain: advance each commission from wherever it currently * sits up to `payable` (`pending → earned → approved → payable`), saving * after EACH step — the save-time guard only admits single-step edges, so * every intermediate state is persisted (each with its timestamp). Rows * already `payable` or `paid` are returned untouched (idempotent). Note * this deliberately bypasses the clearing window — it's the "operator * says pay these now" path. */ settleUpToPayable(ids: string[], now?: Date): Promise; private transitionByIds; private requireCommission; } export default CommissionSettlementService; //# sourceMappingURL=CommissionSettlementService.d.ts.map