import { A as VoucherState, k as Voucher, n as FulfillmentSchema } from "./schema-CIDxLCgB.js";
import { Transaction } from "@platform-modules/db";
//#region src/voucher/decide.d.ts
interface RedeemEvent {
  currentState?: VoucherState;
  at: Date;
  scanningVendorId?: string;
  expiresAt: Date | null;
  vendorId: string | null;
}
type RedeemDecision = {
  ok: true;
} | {
  ok: false;
  reason: 'ALREADY_REDEEMED' | 'EXPIRED' | 'WRONG_VENDOR' | 'INVALID';
};
declare function decideRedemption(state: VoucherState, event: RedeemEvent): RedeemDecision;
//#endregion
//#region src/voucher/issue.d.ts
declare function issueVoucher(tx: Transaction<FulfillmentSchema>, input: {
  orderId: string;
  lineId: string;
  qty: number;
  vendorId: string | null;
  expiresAt: Date | null;
}): Promise<Voucher[]>;
//#endregion
//#region src/voucher/redeem.d.ts
declare function redeemVoucher(tx: Transaction<FulfillmentSchema>, input: {
  voucherId: string;
  scanningVendorId: string;
}): Promise<Voucher>;
//#endregion
export { decideRedemption as a, RedeemEvent as i, issueVoucher as n, RedeemDecision as r, redeemVoucher as t };