import type { Db, SubOrderStatus } from "../types.js"; export interface SubOrderCancelCallback { (subOrder: { id: string; orderId: string; vendorId: string; payoutAmount: number; lineItems: unknown; }): Promise; } export declare class SubOrderService { private db; private onCancel?; constructor(db: Db, onCancel?: SubOrderCancelCallback); getById(id: string): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; } | null>; listByVendor(vendorId: string, filters?: { status?: string; }): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; }[]>; list(filters?: { orderId?: string; vendorId?: string; status?: string; }): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; }[]>; private assertTransition; private requireSubOrder; confirm(id: string): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; } | undefined>; process(id: string): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; } | undefined>; ship(id: string, data: { trackingNumber: string; carrier: string; }): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; } | undefined>; deliver(id: string): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; } | undefined>; cancel(id: string, reason?: string): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; } | undefined>; forceStatus(id: string, status: SubOrderStatus): Promise<{ id: string; orderId: string; vendorId: string; status: string; subtotal: number; commissionAmount: number; payoutAmount: number; notified: boolean; lineItems: { entityId: string; quantity: number; totalPrice: number; }[] | null; trackingNumber: string | null; trackingUrl: string | null; carrier: string | null; fulfillmentStatus: string; confirmedAt: Date | null; shippedAt: Date | null; deliveredAt: Date | null; cancelledAt: Date | null; cancellationReason: string | null; vendorNotes: string | null; externalOrderId: string | null; externalOrderUrl: string | null; externalSyncStatus: string | null; metadata: Record | null; createdAt: Date; updatedAt: Date; } | null>; } //# sourceMappingURL=sub-order.d.ts.map