import { O as OrdersSchema, a as Order, N as NewOrder, A as Actor, b as NewOrderLine, c as NewVendorSplit, d as OrderListFilter, P as Page, S as StepRecord } from './schema-CjYEsh_M.js';
export { B as BuyerRef, I as ImmutableField, e as ImmutableFieldError, f as ORDER_STATUSES, g as OrderChargeConflictError, h as OrderIdempotencyConflictError, i as OrderIntegrityDetail, j as OrderIntegrityError, k as OrderLine, l as OrderMigrateError, m as OrderNotChargeableError, n as OrderNotFoundError, o as OrderStatus, p as OrderValidationError, q as PriceMode, r as ProductKind, R as RefundExceedsPaidError, V as VendorSplit, s as isImmutableFieldError, t as isOrderChargeConflictError, u as isOrderIdempotencyConflictError, v as isOrderIntegrityError, w as isOrderMigrateError, x as isOrderNotChargeableError, y as isOrderNotFoundError, z as isOrderStatus, C as isOrderValidationError, D as isRefundExceedsPaidError, E as order, F as orderLine, G as orderStep, H as ordersSchema, J as refundIntent, K as vendorSplit } from './schema-CjYEsh_M.js';
import { Transaction, Querier } from '@platform-modules/db';
import 'drizzle-orm/pg-core';

declare function claimForCharge(tx: Transaction<OrdersSchema>, orderId: string): Promise<Order>;

declare function createOrder(tx: Transaction<OrdersSchema>, input: NewOrder): Promise<Order>;

declare function failOrder(tx: Transaction<OrdersSchema>, orderId: string, reason: string): Promise<void>;

declare function getOrderById(q: Querier<OrdersSchema>, id: string, actor: Actor): Promise<Order | null>;

declare function assertOrderIntegrity(o: {
    subtotal: bigint;
    tax: bigint;
    discount: bigint;
    total: bigint;
    lines: Pick<NewOrderLine, 'lineTotal'>[];
    splits: Pick<NewVendorSplit, 'amount'>[];
}): void;

declare function listOrders(q: Querier<OrdersSchema>, actor: Actor, filter?: OrderListFilter): Promise<Page<Order>>;

declare function markPaid(tx: Transaction<OrdersSchema>, orderId: string, chargeRef: string): Promise<void>;

declare function markUnfulfillable(tx: Transaction<OrdersSchema>, orderId: string, reason: string): Promise<void>;

declare function pushSchema(db: Querier<OrdersSchema>): Promise<void>;

declare function recordStep(tx: Transaction<OrdersSchema>, orderId: string, stepId: string, result: StepRecord): Promise<boolean>;

export { Actor, NewOrder, NewOrderLine, NewVendorSplit, Order, OrderListFilter, OrdersSchema, Page, StepRecord, assertOrderIntegrity, claimForCharge, createOrder, failOrder, getOrderById, listOrders, markPaid, markUnfulfillable, pushSchema, recordStep };
