import { A as OrderMigrateError, B as isOrderMigrateError, C as isOrderStatus, D as OrderIdempotencyConflictError, E as OrderChargeConflictError, H as isOrderNotFoundError, I as isImmutableFieldError, L as isOrderChargeConflictError, M as OrderNotFoundError, N as OrderValidationError, O as OrderIntegrityDetail, P as RefundExceedsPaidError, R as isOrderIdempotencyConflictError, S as VendorSplit, T as ImmutableFieldError, U as isOrderValidationError, V as isOrderNotChargeableError, W as isRefundExceedsPaidError, _ as OrderStatus, a as ordersSchema, b as ProductKind, c as Actor, d as NewOrderLine, f as NewVendorSplit, g as OrderListFilter, h as OrderLine, i as orderStep, j as OrderNotChargeableError, k as OrderIntegrityError, l as BuyerRef, m as Order, n as order, o as refundIntent, p as ORDER_STATUSES, r as orderLine, s as vendorSplit, t as OrdersSchema, u as NewOrder, v as Page, w as ImmutableField, x as StepRecord, y as PriceMode, z as isOrderIntegrityError } from "./schema-DKaoubEu.js";
import { PostgresTransaction, Querier } from "@platform-modules/db";
//#region src/claim-for-charge.d.ts
declare function claimForCharge(tx: PostgresTransaction<OrdersSchema>, orderId: string): Promise<Order>;
//#endregion
//#region src/create-order.d.ts
declare function createOrder(tx: PostgresTransaction<OrdersSchema>, input: NewOrder): Promise<Order>;
//#endregion
//#region src/fail-order.d.ts
declare function failOrder(tx: PostgresTransaction<OrdersSchema>, orderId: string, reason: string): Promise<void>;
//#endregion
//#region src/get-order-by-id.d.ts
declare function getOrderById(q: Querier<OrdersSchema>, id: string, actor: Actor): Promise<Order | null>;
//#endregion
//#region src/integrity.d.ts
declare function assertOrderIntegrity(o: {
  subtotal: bigint;
  tax: bigint;
  discount: bigint;
  total: bigint;
  lines: Pick<NewOrderLine, 'lineTotal'>[];
  splits: Pick<NewVendorSplit, 'amount'>[];
}): void;
//#endregion
//#region src/list-orders.d.ts
declare function listOrders(q: Querier<OrdersSchema>, actor: Actor, filter?: OrderListFilter): Promise<Page<Order>>;
//#endregion
//#region src/mark-paid.d.ts
declare function markPaid(tx: PostgresTransaction<OrdersSchema>, orderId: string, chargeRef: string): Promise<void>;
//#endregion
//#region src/mark-unfulfillable.d.ts
declare function markUnfulfillable(tx: PostgresTransaction<OrdersSchema>, orderId: string, reason: string): Promise<void>;
//#endregion
//#region src/migrate.d.ts
declare function pushSchema(db: Querier<OrdersSchema>): Promise<void>;
//#endregion
//#region src/record-step.d.ts
declare function recordStep(tx: PostgresTransaction<OrdersSchema>, orderId: string, stepId: string, result: StepRecord): Promise<boolean>;
//#endregion
export { type Actor, type BuyerRef, type ImmutableField, ImmutableFieldError, type NewOrder, type NewOrderLine, type NewVendorSplit, ORDER_STATUSES, type Order, OrderChargeConflictError, OrderIdempotencyConflictError, type OrderIntegrityDetail, OrderIntegrityError, type OrderLine, type OrderListFilter, OrderMigrateError, OrderNotChargeableError, OrderNotFoundError, type OrderStatus, OrderValidationError, type OrdersSchema, type Page, type PriceMode, type ProductKind, RefundExceedsPaidError, type StepRecord, type VendorSplit, assertOrderIntegrity, claimForCharge, createOrder, failOrder, getOrderById, isImmutableFieldError, isOrderChargeConflictError, isOrderIdempotencyConflictError, isOrderIntegrityError, isOrderMigrateError, isOrderNotChargeableError, isOrderNotFoundError, isOrderStatus, isOrderValidationError, isRefundExceedsPaidError, listOrders, markPaid, markUnfulfillable, order, orderLine, orderStep, ordersSchema, pushSchema, recordStep, refundIntent, vendorSplit };