import { PoolClient } from '@evershop/postgres-query-builder'; /** * Order-level cancelability check. The two sides answer different questions * with different vocabularies: * * - Payment side: `oms.order.paymentStatus[code].isCancelable`. Per-status * boolean. Payment statuses don't have phases or rollups, so the flag * stays per-status here. Defaults: pending/canceled cancelable, paid * not. * * - Shipment side: `oms.order.shipmentRollupCancelable[rollupValue]`. The * map is keyed on the ORDER's rollup value (`order.shipment_status`), * NOT a per-shipment status code. Reason: by the time admin clicks * cancel-order, the order may be `partially_shipped` or * `partially_delivered` — rollup-only values that never appear in the * per-shipment status registry. Reading the per-shipment registry * keyed by the rollup value blows up; the rollup-cancelable map is * keyed by the right vocabulary by construction. * * Returns false if either side says no. Extensions can override via * `addProcessor('shipmentRollupCancelable', ...)` (rollup side) or * `addProcessor('paymentStatus', ...)` (payment side). * * Closes the partially-shipped/delivered crash that the per-status registry * deref used to throw. */ export declare function validateStatusForTests(paymentStatus: string, shipmentStatus: string): boolean; /** * Cancels an order by its UUID and adds a cancellation reason. * @param uuid - The UUID of the order to cancel. * @param reason - The reason for cancellation. * @returns A promise that resolves when the order is canceled. */ declare const _default: (uuid: string, reason: string | undefined) => Promise; export default _default; export declare function hookBeforeValidateStatus(callback: (this: { order: Record; }, ...args: [ paymentStatus: string, shipmentStatus: string ]) => void | Promise, priority?: number): void; export declare function hookAfterValidateStatus(callback: (this: { order: Record; }, ...args: [ paymentStatus: string, shipmentStatus: string ]) => void | Promise, priority?: number): void; export declare function hookBeforeUpdatePaymentStatusToCancel(callback: (this: { order: Record; }, ...args: [ orderID: number, connection: PoolClient ]) => void | Promise, priority?: number): void; export declare function hookAfterUpdatePaymentStatusToCancel(callback: (this: { order: Record; }, ...args: [ orderID: number, connection: PoolClient ]) => void | Promise, priority?: number): void; export declare function hookBeforeUpdateShipmentStatusToCancel(callback: (this: { order: Record; }, ...args: [ orderID: number, connection: PoolClient ]) => void | Promise, priority?: number): void; export declare function hookAfterUpdateShipmentStatusToCancel(callback: (this: { order: Record; }, ...args: [ orderID: number, connection: PoolClient ]) => void | Promise, priority?: number): void; export declare function hookBeforeReStockAfterCancel(callback: (this: { order: Record; }, ...args: [ orderID: number, connection: PoolClient ]) => void | Promise, priority?: number): void; export declare function hookAfterReStockAfterCancel(callback: (this: { order: Record; }, ...args: [ orderID: number, connection: PoolClient ]) => void | Promise, priority?: number): void; export declare function hookBeforeCancelOrder(callback: (this: { uuid: string; }, ...args: [ uuid: string, reason: string | undefined ]) => void | Promise, priority?: number): void; export declare function hookAfterCancelOrder(callback: (this: { uuid: string; }, ...args: [ uuid: string, reason: string | undefined ]) => void | Promise, priority?: number): void;