import type { CodeRelation, DefaultRelation, UserRelation, } from '../../../common/http/response'; import { DateTime } from '../../../common/value-objects/date-time/date-time'; import { Decimal } from '../../../common/value-objects/decimal/decimal'; import { Status } from '../../../common/value-objects/status/status'; export type SalesOrderLine = { readonly id: string; readonly productId: string; readonly product: DefaultRelation | null; readonly quantity: Decimal; readonly price: Decimal; }; export type SalesOrderImage = { readonly id: string; readonly url: string; readonly description: string | null; }; export type SalesOrder = { readonly id: string; readonly code: string; readonly salesRequestId: string | null; readonly date: DateTime; readonly salesPersonId: string; readonly branchId: string; readonly divisionId: string; readonly customerId: string; readonly address: string; readonly latitude: number | null; readonly longitude: number | null; readonly notes: string | null; readonly products: readonly SalesOrderLine[]; readonly images: readonly SalesOrderImage[]; readonly status: Status; readonly createdAt: DateTime; readonly updatedAt: DateTime; readonly createdBy: string; readonly updatedBy: string; readonly salesRequest: CodeRelation | null; readonly salesPerson: DefaultRelation | null; readonly branch: DefaultRelation | null; readonly division: DefaultRelation | null; readonly customer: DefaultRelation | null; readonly createdByUser: UserRelation; readonly updatedByUser: UserRelation; }; export type SalesOrderLineInput = { readonly productId: string; readonly quantity: Decimal; readonly price: Decimal; }; export type SalesOrderImageInput = { readonly url: string; readonly description?: string | null; }; export type CreateSalesOrderInput = { readonly code?: string; readonly salesRequestId?: string | null; readonly date: DateTime; readonly salesPersonId: string; readonly branchId: string; readonly divisionId: string; readonly customerId: string; readonly address: string; readonly latitude?: number | null; readonly longitude?: number | null; readonly notes?: string | null; readonly products: readonly SalesOrderLineInput[]; readonly images?: readonly SalesOrderImageInput[]; readonly status?: Status; readonly userId: string; }; export type UpdateSalesOrderInput = { readonly code?: string; readonly date?: DateTime; readonly salesPersonId?: string; readonly branchId?: string; readonly divisionId?: string; readonly customerId?: string; readonly address?: string; readonly latitude?: number | null; readonly longitude?: number | null; readonly notes?: string | null; readonly products?: readonly SalesOrderLineInput[]; readonly images?: readonly SalesOrderImageInput[]; readonly userId: string; }; export type ListSalesOrdersFilters = { readonly code?: string; readonly status?: string; readonly customerId?: string; readonly salesPersonId?: string; readonly branchId?: string; readonly divisionId?: string; readonly search?: string; readonly orderBy?: string; readonly orderType?: string; readonly limit: number; readonly offset: number; };