import type { Database } from "@prodobit/database"; import Decimal from "decimal.js"; export interface SalesOrderFilters { status?: string; customerId?: string; orderDateFrom?: string; orderDateTo?: string; search?: string; page?: number; limit?: number; } export interface CreateSalesOrderData { customerId: string; orderDate: string; requestedDeliveryDate?: string; shippingAddressId?: string; shippingInstructions?: string; notes?: string; items: CreateSalesOrderItemData[]; } export interface CreateSalesOrderItemData { itemId: string; quantity: number; unitPrice: number; unit?: string; requestedDeliveryDate?: string; itemNotes?: string; } export interface UpdateSalesOrderData { customerId?: string; requestedDeliveryDate?: string; confirmedDeliveryDate?: string; shippingAddressId?: string; shippingInstructions?: string; notes?: string; } export interface UpdateSalesOrderItemData { quantity?: number; unitPrice?: number; unit?: string; requestedDeliveryDate?: string; confirmedDeliveryDate?: string; itemNotes?: string; } export declare class SalesOrderService { private db; constructor(db: Database); getSalesOrders(tenantId: string, filters?: SalesOrderFilters): Promise<{ data: { id: string; orderNumber: string; orderDate: string; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; status: string; totalAmount: Decimal | null; currency: string; shippingInstructions: string | null; notes: string | null; approvedAt: Date | null; insertedAt: Date; updatedAt: Date; customer: { id: string; customerCode: string; name: string | null; partyType: string; }; createdBy: { name: string | null; }; approvedBy: { name: string; } | null; }[]; pagination: { page: number; limit: number; total: number; totalPages: number; }; }>; getSalesOrderById(tenantId: string, id: string): Promise<{ id: string; orderNumber: string; orderDate: string; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; status: string; totalAmount: Decimal | null; currency: string; shippingInstructions: string | null; notes: string | null; approvedAt: Date | null; insertedAt: Date; updatedAt: Date; customer: { id: string; customerCode: string; name: string | null; partyType: string; }; shippingAddress: { id: string; line1: string | null; line2: string | null; city: string | null; country: string | null; } | null; createdBy: { name: string | null; }; approvedBy: { name: string; } | null; items: { id: string; itemId: string; quantity: Decimal; unit: string | null; unitPrice: Decimal; totalPrice: Decimal; currency: string | null; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; actualDeliveryDate: string | null; shippedQuantity: Decimal | null; remainingQuantity: Decimal; lineStatus: string | null; itemNotes: string | null; insertedAt: Date; updatedAt: Date; item: { id: string; code: string | null; name: string; }; }[]; } | null>; createSalesOrder(tenantId: string, createdBy: string, data: CreateSalesOrderData): Promise<{ id: string; orderNumber: string; orderDate: string; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; status: string; totalAmount: Decimal | null; currency: string; shippingInstructions: string | null; notes: string | null; approvedAt: Date | null; insertedAt: Date; updatedAt: Date; customer: { id: string; customerCode: string; name: string | null; partyType: string; }; shippingAddress: { id: string; line1: string | null; line2: string | null; city: string | null; country: string | null; } | null; createdBy: { name: string | null; }; approvedBy: { name: string; } | null; items: { id: string; itemId: string; quantity: Decimal; unit: string | null; unitPrice: Decimal; totalPrice: Decimal; currency: string | null; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; actualDeliveryDate: string | null; shippedQuantity: Decimal | null; remainingQuantity: Decimal; lineStatus: string | null; itemNotes: string | null; insertedAt: Date; updatedAt: Date; item: { id: string; code: string | null; name: string; }; }[]; } | null>; updateSalesOrder(tenantId: string, id: string, data: UpdateSalesOrderData): Promise<{ id: string; orderNumber: string; orderDate: string; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; status: string; totalAmount: Decimal | null; currency: string; shippingInstructions: string | null; notes: string | null; approvedAt: Date | null; insertedAt: Date; updatedAt: Date; customer: { id: string; customerCode: string; name: string | null; partyType: string; }; shippingAddress: { id: string; line1: string | null; line2: string | null; city: string | null; country: string | null; } | null; createdBy: { name: string | null; }; approvedBy: { name: string; } | null; items: { id: string; itemId: string; quantity: Decimal; unit: string | null; unitPrice: Decimal; totalPrice: Decimal; currency: string | null; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; actualDeliveryDate: string | null; shippedQuantity: Decimal | null; remainingQuantity: Decimal; lineStatus: string | null; itemNotes: string | null; insertedAt: Date; updatedAt: Date; item: { id: string; code: string | null; name: string; }; }[]; } | null>; updateSalesOrderStatus(tenantId: string, id: string, status: string, changedBy: string, changeReason?: string, notes?: string): Promise<{ id: string; orderNumber: string; orderDate: string; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; status: string; totalAmount: Decimal | null; currency: string; shippingInstructions: string | null; notes: string | null; approvedAt: Date | null; insertedAt: Date; updatedAt: Date; customer: { id: string; customerCode: string; name: string | null; partyType: string; }; shippingAddress: { id: string; line1: string | null; line2: string | null; city: string | null; country: string | null; } | null; createdBy: { name: string | null; }; approvedBy: { name: string; } | null; items: { id: string; itemId: string; quantity: Decimal; unit: string | null; unitPrice: Decimal; totalPrice: Decimal; currency: string | null; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; actualDeliveryDate: string | null; shippedQuantity: Decimal | null; remainingQuantity: Decimal; lineStatus: string | null; itemNotes: string | null; insertedAt: Date; updatedAt: Date; item: { id: string; code: string | null; name: string; }; }[]; } | null>; deleteSalesOrder(tenantId: string, id: string): Promise<{ id: string; } | null>; addSalesOrderItem(tenantId: string, salesOrderId: string, data: CreateSalesOrderItemData): Promise<{ id: string; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; tenantId: string; currency: string | null; itemId: string; unit: string | null; quantity: Decimal; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; salesOrderId: string; unitPrice: Decimal; totalPrice: Decimal; actualDeliveryDate: string | null; shippedQuantity: Decimal | null; remainingQuantity: Decimal; lineStatus: string | null; itemNotes: string | null; }>; updateSalesOrderItem(tenantId: string, salesOrderId: string, itemId: string, data: UpdateSalesOrderItemData): Promise<{ id: string; tenantId: string; salesOrderId: string; itemId: string; quantity: Decimal; unit: string | null; unitPrice: Decimal; totalPrice: Decimal; currency: string | null; requestedDeliveryDate: string | null; confirmedDeliveryDate: string | null; actualDeliveryDate: string | null; shippedQuantity: Decimal | null; remainingQuantity: Decimal; lineStatus: string | null; itemNotes: string | null; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; } | null>; removeSalesOrderItem(tenantId: string, salesOrderId: string, itemId: string): Promise<{ id: string; } | null>; getSalesOrderHistory(tenantId: string, salesOrderId: string): Promise<{ id: string; oldStatus: string | null; newStatus: string; changeReason: string | null; notes: string | null; changedAt: Date; changedBy: string | null; }[]>; } //# sourceMappingURL=SalesOrderService.d.ts.map