import { Product, ProductInput } from "@platform-modules/commerce-catalog";
import { Actor, NewVendorSplit, Order, OrderListFilter, Page } from "@platform-modules/commerce-orders";
import { PostgresTransaction, Querier } from "@platform-modules/db";
//#region src/splits.d.ts
declare function computeVendorSplits(input: {
  lines: {
    vendorId: string | null;
    lineTotal: bigint;
  }[];
  subtotal: bigint;
  total: bigint;
  rates: Map<string, number>;
}): NewVendorSplit[];
//#endregion
//#region src/types.d.ts
type VendorStatus = 'pending' | 'approved' | 'suspended';
interface Vendor {
  id: string;
  ownerUserId: string;
  name: string;
  status: VendorStatus;
  commissionBps: number;
  createdAt: Date;
  updatedAt: Date;
}
interface ApplyAsVendorInput {
  ownerUserId: string;
  name: string;
}
type ProductPatch = Partial<Pick<ProductInput, 'slug' | 'title' | 'description' | 'status' | 'media' | 'tags' | 'availableFrom' | 'availableUntil'>>;
declare const DEFAULT_COMMISSION_BPS = 1000;
declare const UUID_RE: RegExp;
//#endregion
//#region src/schema.d.ts
declare const vendor: import("drizzle-orm/pg-core").PgTableWithColumns<{
  name: "vendor";
  schema: undefined;
  columns: {
    id: import("drizzle-orm/pg-core").PgColumn<{
      name: "id";
      tableName: "vendor";
      dataType: "string";
      columnType: "PgUUID";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: true;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    ownerUserId: import("drizzle-orm/pg-core").PgColumn<{
      name: "owner_user_id";
      tableName: "vendor";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    name: import("drizzle-orm/pg-core").PgColumn<{
      name: "name";
      tableName: "vendor";
      dataType: "string";
      columnType: "PgText";
      data: string;
      driverParam: string;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    status: import("drizzle-orm/pg-core").PgColumn<{
      name: "status";
      tableName: "vendor";
      dataType: "string";
      columnType: "PgText";
      data: VendorStatus;
      driverParam: string;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: [string, ...string[]];
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {
      $type: VendorStatus;
    }>;
    commissionBps: import("drizzle-orm/pg-core").PgColumn<{
      name: "commission_bps";
      tableName: "vendor";
      dataType: "number";
      columnType: "PgInteger";
      data: number;
      driverParam: string | number;
      notNull: true;
      hasDefault: false;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    createdAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "created_at";
      tableName: "vendor";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
    updatedAt: import("drizzle-orm/pg-core").PgColumn<{
      name: "updated_at";
      tableName: "vendor";
      dataType: "date";
      columnType: "PgTimestamp";
      data: Date;
      driverParam: string;
      notNull: true;
      hasDefault: true;
      isPrimaryKey: false;
      isAutoincrement: false;
      hasRuntimeDefault: false;
      enumValues: undefined;
      baseColumn: never;
      identity: undefined;
      generated: undefined;
    }, {}, {}>;
  };
  dialect: "pg";
}>;
declare const marketplaceSchema: {
  vendor: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "vendor";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "vendor";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      ownerUserId: import("drizzle-orm/pg-core").PgColumn<{
        name: "owner_user_id";
        tableName: "vendor";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      name: import("drizzle-orm/pg-core").PgColumn<{
        name: "name";
        tableName: "vendor";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      status: import("drizzle-orm/pg-core").PgColumn<{
        name: "status";
        tableName: "vendor";
        dataType: "string";
        columnType: "PgText";
        data: VendorStatus;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: VendorStatus;
      }>;
      commissionBps: import("drizzle-orm/pg-core").PgColumn<{
        name: "commission_bps";
        tableName: "vendor";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "vendor";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      updatedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "updated_at";
        tableName: "vendor";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
};
declare const marketplaceDbSchema: {
  order: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "order";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "order";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      buyerUserId: import("drizzle-orm/pg-core").PgColumn<{
        name: "buyer_user_id";
        tableName: "order";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      buyerGuestEmail: import("drizzle-orm/pg-core").PgColumn<{
        name: "buyer_guest_email";
        tableName: "order";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      status: import("drizzle-orm/pg-core").PgColumn<{
        name: "status";
        tableName: "order";
        dataType: "string";
        columnType: "PgText";
        data: import("@platform-modules/commerce-orders").OrderStatus;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: import("@platform-modules/commerce-orders").OrderStatus;
      }>;
      currency: import("drizzle-orm/pg-core").PgColumn<{
        name: "currency";
        tableName: "order";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      priceMode: import("drizzle-orm/pg-core").PgColumn<{
        name: "price_mode";
        tableName: "order";
        dataType: "string";
        columnType: "PgText";
        data: import("@platform-modules/commerce-orders").PriceMode;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: import("@platform-modules/commerce-orders").PriceMode;
      }>;
      subtotal: import("drizzle-orm/pg-core").PgColumn<{
        name: "subtotal";
        tableName: "order";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      tax: import("drizzle-orm/pg-core").PgColumn<{
        name: "tax";
        tableName: "order";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      discount: import("drizzle-orm/pg-core").PgColumn<{
        name: "discount";
        tableName: "order";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      total: import("drizzle-orm/pg-core").PgColumn<{
        name: "total";
        tableName: "order";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      chargeRef: import("drizzle-orm/pg-core").PgColumn<{
        name: "charge_ref";
        tableName: "order";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      failureReason: import("drizzle-orm/pg-core").PgColumn<{
        name: "failure_reason";
        tableName: "order";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      idempotencyKey: import("drizzle-orm/pg-core").PgColumn<{
        name: "idempotency_key";
        tableName: "order";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      requestHash: import("drizzle-orm/pg-core").PgColumn<{
        name: "request_hash";
        tableName: "order";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "order";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      updatedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "updated_at";
        tableName: "order";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  orderLine: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "order_line";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "order_line";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      orderId: import("drizzle-orm/pg-core").PgColumn<{
        name: "order_id";
        tableName: "order_line";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      variantId: import("drizzle-orm/pg-core").PgColumn<{
        name: "variant_id";
        tableName: "order_line";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      kind: import("drizzle-orm/pg-core").PgColumn<{
        name: "kind";
        tableName: "order_line";
        dataType: "string";
        columnType: "PgText";
        data: import("@platform-modules/commerce-orders").ProductKind;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: import("@platform-modules/commerce-orders").ProductKind;
      }>;
      qty: import("drizzle-orm/pg-core").PgColumn<{
        name: "qty";
        tableName: "order_line";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      unitPrice: import("drizzle-orm/pg-core").PgColumn<{
        name: "unit_price";
        tableName: "order_line";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      lineTotal: import("drizzle-orm/pg-core").PgColumn<{
        name: "line_total";
        tableName: "order_line";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      vendorId: import("drizzle-orm/pg-core").PgColumn<{
        name: "vendor_id";
        tableName: "order_line";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "order_line";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  vendorSplit: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "vendor_split";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "vendor_split";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      orderId: import("drizzle-orm/pg-core").PgColumn<{
        name: "order_id";
        tableName: "vendor_split";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      vendorId: import("drizzle-orm/pg-core").PgColumn<{
        name: "vendor_id";
        tableName: "vendor_split";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      amount: import("drizzle-orm/pg-core").PgColumn<{
        name: "amount";
        tableName: "vendor_split";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      funder: import("drizzle-orm/pg-core").PgColumn<{
        name: "funder";
        tableName: "vendor_split";
        dataType: "string";
        columnType: "PgText";
        data: "platform" | "vendor";
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: "platform" | "vendor";
      }>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "vendor_split";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  orderStep: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "order_step";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "order_step";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      orderId: import("drizzle-orm/pg-core").PgColumn<{
        name: "order_id";
        tableName: "order_step";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      stepId: import("drizzle-orm/pg-core").PgColumn<{
        name: "step_id";
        tableName: "order_step";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      result: import("drizzle-orm/pg-core").PgColumn<{
        name: "result";
        tableName: "order_step";
        dataType: "json";
        columnType: "PgJsonb";
        data: unknown;
        driverParam: unknown;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "order_step";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  refundIntent: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "refund_intent";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "refund_intent";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      orderId: import("drizzle-orm/pg-core").PgColumn<{
        name: "order_id";
        tableName: "refund_intent";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      seq: import("drizzle-orm/pg-core").PgColumn<{
        name: "seq";
        tableName: "refund_intent";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      amount: import("drizzle-orm/pg-core").PgColumn<{
        name: "amount";
        tableName: "refund_intent";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      status: import("drizzle-orm/pg-core").PgColumn<{
        name: "status";
        tableName: "refund_intent";
        dataType: "string";
        columnType: "PgText";
        data: "pending" | "failed" | "executed";
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: "pending" | "failed" | "executed";
      }>;
      refundKey: import("drizzle-orm/pg-core").PgColumn<{
        name: "refund_key";
        tableName: "refund_intent";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      providerRef: import("drizzle-orm/pg-core").PgColumn<{
        name: "provider_ref";
        tableName: "refund_intent";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "refund_intent";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      updatedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "updated_at";
        tableName: "refund_intent";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  product: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "product";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "product";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      kind: import("drizzle-orm/pg-core").PgColumn<{
        name: "kind";
        tableName: "product";
        dataType: "string";
        columnType: "PgText";
        data: import("@platform-modules/commerce-catalog").ProductKind;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: import("@platform-modules/commerce-catalog").ProductKind;
      }>;
      vendorId: import("drizzle-orm/pg-core").PgColumn<{
        name: "vendor_id";
        tableName: "product";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      slug: import("drizzle-orm/pg-core").PgColumn<{
        name: "slug";
        tableName: "product";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      title: import("drizzle-orm/pg-core").PgColumn<{
        name: "title";
        tableName: "product";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      description: import("drizzle-orm/pg-core").PgColumn<{
        name: "description";
        tableName: "product";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      status: import("drizzle-orm/pg-core").PgColumn<{
        name: "status";
        tableName: "product";
        dataType: "string";
        columnType: "PgText";
        data: import("@platform-modules/commerce-catalog").ProductStatus;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: import("@platform-modules/commerce-catalog").ProductStatus;
      }>;
      media: import("drizzle-orm/pg-core").PgColumn<{
        name: "media";
        tableName: "product";
        dataType: "json";
        columnType: "PgJsonb";
        data: import("@platform-modules/commerce-catalog").MediaRef[];
        driverParam: unknown;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: import("@platform-modules/commerce-catalog").MediaRef[];
      }>;
      tags: import("drizzle-orm/pg-core").PgColumn<{
        name: "tags";
        tableName: "product";
        dataType: "json";
        columnType: "PgJsonb";
        data: string[];
        driverParam: unknown;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: string[];
      }>;
      availableFrom: import("drizzle-orm/pg-core").PgColumn<{
        name: "available_from";
        tableName: "product";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      availableUntil: import("drizzle-orm/pg-core").PgColumn<{
        name: "available_until";
        tableName: "product";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "product";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      updatedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "updated_at";
        tableName: "product";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  variant: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "variant";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "variant";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      productId: import("drizzle-orm/pg-core").PgColumn<{
        name: "product_id";
        tableName: "variant";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      sku: import("drizzle-orm/pg-core").PgColumn<{
        name: "sku";
        tableName: "variant";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      attributes: import("drizzle-orm/pg-core").PgColumn<{
        name: "attributes";
        tableName: "variant";
        dataType: "json";
        columnType: "PgJsonb";
        data: Record<string, unknown>;
        driverParam: unknown;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: Record<string, unknown>;
      }>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "variant";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  variantPrice: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "variant_price";
    schema: undefined;
    columns: {
      variantId: import("drizzle-orm/pg-core").PgColumn<{
        name: "variant_id";
        tableName: "variant_price";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      currency: import("drizzle-orm/pg-core").PgColumn<{
        name: "currency";
        tableName: "variant_price";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      amount: import("drizzle-orm/pg-core").PgColumn<{
        name: "amount";
        tableName: "variant_price";
        dataType: "bigint";
        columnType: "PgBigInt64";
        data: bigint;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      priceMode: import("drizzle-orm/pg-core").PgColumn<{
        name: "price_mode";
        tableName: "variant_price";
        dataType: "string";
        columnType: "PgText";
        data: import("@platform-modules/commerce-catalog").PriceMode;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: import("@platform-modules/commerce-catalog").PriceMode;
      }>;
    };
    dialect: "pg";
  }>;
  category: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "category";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "category";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      parentId: import("drizzle-orm/pg-core").PgColumn<{
        name: "parent_id";
        tableName: "category";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      vendorId: import("drizzle-orm/pg-core").PgColumn<{
        name: "vendor_id";
        tableName: "category";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      name: import("drizzle-orm/pg-core").PgColumn<{
        name: "name";
        tableName: "category";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      slug: import("drizzle-orm/pg-core").PgColumn<{
        name: "slug";
        tableName: "category";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  collection: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "collection";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "collection";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      vendorId: import("drizzle-orm/pg-core").PgColumn<{
        name: "vendor_id";
        tableName: "collection";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: false;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      name: import("drizzle-orm/pg-core").PgColumn<{
        name: "name";
        tableName: "collection";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      slug: import("drizzle-orm/pg-core").PgColumn<{
        name: "slug";
        tableName: "collection";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  productCategory: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "product_category";
    schema: undefined;
    columns: {
      productId: import("drizzle-orm/pg-core").PgColumn<{
        name: "product_id";
        tableName: "product_category";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      categoryId: import("drizzle-orm/pg-core").PgColumn<{
        name: "category_id";
        tableName: "product_category";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  productCollection: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "product_collection";
    schema: undefined;
    columns: {
      collectionId: import("drizzle-orm/pg-core").PgColumn<{
        name: "collection_id";
        tableName: "product_collection";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      productId: import("drizzle-orm/pg-core").PgColumn<{
        name: "product_id";
        tableName: "product_collection";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      position: import("drizzle-orm/pg-core").PgColumn<{
        name: "position";
        tableName: "product_collection";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
  vendor: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "vendor";
    schema: undefined;
    columns: {
      id: import("drizzle-orm/pg-core").PgColumn<{
        name: "id";
        tableName: "vendor";
        dataType: "string";
        columnType: "PgUUID";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: true;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      ownerUserId: import("drizzle-orm/pg-core").PgColumn<{
        name: "owner_user_id";
        tableName: "vendor";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      name: import("drizzle-orm/pg-core").PgColumn<{
        name: "name";
        tableName: "vendor";
        dataType: "string";
        columnType: "PgText";
        data: string;
        driverParam: string;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      status: import("drizzle-orm/pg-core").PgColumn<{
        name: "status";
        tableName: "vendor";
        dataType: "string";
        columnType: "PgText";
        data: VendorStatus;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: [string, ...string[]];
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {
        $type: VendorStatus;
      }>;
      commissionBps: import("drizzle-orm/pg-core").PgColumn<{
        name: "commission_bps";
        tableName: "vendor";
        dataType: "number";
        columnType: "PgInteger";
        data: number;
        driverParam: string | number;
        notNull: true;
        hasDefault: false;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      createdAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "created_at";
        tableName: "vendor";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
      updatedAt: import("drizzle-orm/pg-core").PgColumn<{
        name: "updated_at";
        tableName: "vendor";
        dataType: "date";
        columnType: "PgTimestamp";
        data: Date;
        driverParam: string;
        notNull: true;
        hasDefault: true;
        isPrimaryKey: false;
        isAutoincrement: false;
        hasRuntimeDefault: false;
        enumValues: undefined;
        baseColumn: never;
        identity: undefined;
        generated: undefined;
      }, {}, {}>;
    };
    dialect: "pg";
  }>;
};
type MarketplaceSchema = typeof marketplaceSchema;
type MarketplaceDbSchema = typeof marketplaceDbSchema;
//#endregion
//#region src/authz.d.ts
declare function requireVendorForActor(q: Querier<MarketplaceDbSchema>, actor: Actor): Promise<Vendor>;
declare function assertVendorOwnership(q: Querier<MarketplaceDbSchema>, actor: Actor, vendorId: string): Promise<void>;
declare function assertVendorCanSell(q: Querier<MarketplaceDbSchema>, vendorId: string): Promise<void>;
//#endregion
//#region src/commission.d.ts
declare function resolveCommissionRate(q: Querier<MarketplaceDbSchema>, vendorId: string): Promise<number>;
declare function setVendorCommissionRate(tx: PostgresTransaction<MarketplaceDbSchema>, vendorId: string, admin: Actor, bps: number): Promise<void>;
//#endregion
//#region src/errors.d.ts
declare class VendorNotFoundError extends Error {
  readonly context: {
    vendorId?: string;
  };
  readonly name = "VendorNotFoundError";
  readonly code: "VENDOR_NOT_FOUND";
  readonly httpStatus: 404;
  constructor(context?: {
    vendorId?: string;
  });
}
declare class VendorProductNotFoundError extends Error {
  readonly context: {
    productId?: string;
  };
  readonly name = "VendorProductNotFoundError";
  readonly code: "VENDOR_PRODUCT_NOT_FOUND";
  readonly httpStatus: 404;
  constructor(context?: {
    productId?: string;
  });
}
declare class VendorAuthorizationError extends Error {
  readonly name = "VendorAuthorizationError";
  readonly code: "VENDOR_FORBIDDEN";
  readonly httpStatus: 403;
  constructor();
}
declare class VendorStateError extends Error {
  readonly context: {
    vendorId: string;
    from: VendorStatus;
    to: VendorStatus;
  };
  readonly name = "VendorStateError";
  readonly code: "VENDOR_STATE";
  readonly httpStatus: 409;
  constructor(context: {
    vendorId: string;
    from: VendorStatus;
    to: VendorStatus;
  });
}
declare class CommissionRateError extends Error {
  readonly context: {
    bps: number;
  };
  readonly name = "CommissionRateError";
  readonly code: "COMMISSION_RATE_INVALID";
  readonly httpStatus: 422;
  constructor(context: {
    bps: number;
  });
}
declare class VendorAlreadyExistsError extends Error {
  readonly context: {
    ownerUserId: string;
  };
  readonly name = "VendorAlreadyExistsError";
  readonly code: "VENDOR_ALREADY_EXISTS";
  readonly httpStatus: 409;
  constructor(context: {
    ownerUserId: string;
  });
}
declare function isVendorNotFoundError(e: unknown): e is VendorNotFoundError;
declare function isVendorProductNotFoundError(e: unknown): e is VendorProductNotFoundError;
declare function isVendorAuthorizationError(e: unknown): e is VendorAuthorizationError;
declare function isVendorStateError(e: unknown): e is VendorStateError;
declare function isCommissionRateError(e: unknown): e is CommissionRateError;
declare function isVendorAlreadyExistsError(e: unknown): e is VendorAlreadyExistsError;
//#endregion
//#region src/migrate.d.ts
declare class MarketplaceMigrateError extends Error {
  readonly detail: string;
  readonly name = "MarketplaceMigrateError";
  readonly code: "MARKETPLACE_MIGRATE";
  constructor(detail: string);
}
declare function isMarketplaceMigrateError(e: unknown): e is MarketplaceMigrateError;
declare function pushSchema(db: Querier<MarketplaceSchema>): Promise<void>;
//#endregion
//#region src/orders.d.ts
declare function getVendorOrders(q: Querier<MarketplaceDbSchema>, actor: Actor, filter?: OrderListFilter): Promise<Page<Order>>;
//#endregion
//#region src/product.d.ts
declare function createVendorProduct(tx: PostgresTransaction<MarketplaceDbSchema>, actor: Actor, input: ProductInput): Promise<Product>;
declare function updateVendorProduct(tx: PostgresTransaction<MarketplaceDbSchema>, actor: Actor, productId: string, patch: ProductPatch): Promise<Product>;
//#endregion
//#region src/vendor.d.ts
declare function applyAsVendor(tx: PostgresTransaction<MarketplaceDbSchema>, input: ApplyAsVendorInput): Promise<Vendor>;
declare function approveVendor(tx: PostgresTransaction<MarketplaceDbSchema>, vendorId: string, admin: Actor): Promise<void>;
declare function suspendVendor(tx: PostgresTransaction<MarketplaceDbSchema>, vendorId: string, admin: Actor): Promise<void>;
//#endregion
export { type ApplyAsVendorInput, CommissionRateError, DEFAULT_COMMISSION_BPS, type MarketplaceDbSchema, MarketplaceMigrateError, type MarketplaceSchema, type ProductPatch, UUID_RE, type Vendor, VendorAlreadyExistsError, VendorAuthorizationError, VendorNotFoundError, VendorProductNotFoundError, VendorStateError, type VendorStatus, applyAsVendor, approveVendor, assertVendorCanSell, assertVendorOwnership, computeVendorSplits, createVendorProduct, getVendorOrders, isCommissionRateError, isMarketplaceMigrateError, isVendorAlreadyExistsError, isVendorAuthorizationError, isVendorNotFoundError, isVendorProductNotFoundError, isVendorStateError, marketplaceDbSchema, marketplaceSchema, pushSchema, requireVendorForActor, resolveCommissionRate, setVendorCommissionRate, suspendVendor, updateVendorProduct, vendor };