export type NewSchemeInvoiceCatchupQueueProvider = 'db' | 'bullmq' | 'rabbitmq';
export declare function publishNewSchemeInvoiceCatchupJob(schemeId: string): Promise<void>;
export declare function publishPendingNewSchemeInvoiceCatchupJobs(limit?: number): Promise<number>;
export declare function registerNewSchemeInvoiceCatchupExternalQueueWorker(): boolean;
/**
 * Unified entry point: write the durable audit/ledger row in `scheme_invoice_jobs`
 * AND publish to the configured queue (BullMQ by default). The DB row guarantees the
 * job is recoverable even if Redis is down at publish time — the reconcile cron will
 * republish any rows that linger in `pending` state.
 */
export declare function enqueueSchemeInvoiceCatchupJob(schemeId: string): Promise<void>;
/**
 * Evaluate whether a frontend-created scheme now has all prerequisites for invoice
 * catch-up and, if so, transition it from `SETUP_PENDING` → `NEW_PENDING` and enqueue
 * the catch-up job using the same flow as import.
 *
 * Safe to call on every invoice-config update AND every first-time staff save.
 * The function is a pure no-op if any condition fails, so it will never double-enqueue.
 *
 * ALL of the following must be true before anything is written:
 *   1. `invoice_generation_status = 'SETUP_PENDING'`   (frontend scheme, not yet queued)
 *   2. `om_start_date` is present and refers to a past calendar month (completed cycles exist)
 *   3. `final_executed_work_cost` is a valid non-negative number (financial baseline)
 *   4. `om_agreement_no` is non-empty               (invoice configuration completed)
 *   5. At least one row in `scheme_staff`            (work staff entry completed)
 *   6. No `scheme_invoice_jobs` row in pending / running / success (duplicate-job guard)
 *
 * When all conditions pass, the function:
 *   - Sets `invoice_generation_status = 'NEW_PENDING'`
 *   - Calls `enqueueSchemeInvoiceCatchupJob` (DB ledger row + BullMQ publish)
 *
 * The reconcile cron (`runNewSchemeInvoiceCatchupReenqueue`) only seeds NEW_PENDING
 * schemes, so it will never touch a SETUP_PENDING scheme prematurely.
 */
export declare function maybeTriggerFrontendSchemeInvoiceCatchup(schemeId: string): Promise<void>;
//# sourceMappingURL=newSchemeInvoiceCatchupQueue.service.d.ts.map