// @generated — do not edit import { createDomainError } from "@tailor-platform/erp-kit/core"; export const SalesOrderNotFoundError = createDomainError( "SalesOrderNotFoundError", "SALES_SALES_ORDER_NOT_FOUND", (identifier: string) => `Referenced sales order does not exist.: ${identifier}`, ); export const SalesOrderNotConfirmedError = createDomainError( "SalesOrderNotConfirmedError", "SALES_SALES_ORDER_NOT_CONFIRMED", (identifier: string) => `Sales order is not in CONFIRMED status: ${identifier}`, ); export const EmptyAmendmentChangesError = createDomainError( "EmptyAmendmentChangesError", "SALES_EMPTY_AMENDMENT_CHANGES", (identifier: string) => `Amendment contains no header or line changes: ${identifier}`, ); export const LineNotFoundError = createDomainError( "LineNotFoundError", "SALES_LINE_NOT_FOUND", (identifier: string) => `Referenced line does not exist on the target document: ${identifier}`, ); export const ModifyQuantityBelowFulfilledError = createDomainError( "ModifyQuantityBelowFulfilledError", "SALES_MODIFY_QUANTITY_BELOW_FULFILLED", (identifier: string) => `UPDATE reduces quantity below the line's fulfilled quantity projection: ${identifier}`, ); export const ModifyQuantityBelowBilledError = createDomainError( "ModifyQuantityBelowBilledError", "SALES_MODIFY_QUANTITY_BELOW_BILLED", (identifier: string) => `UPDATE reduces quantity below the line's billed quantity: ${identifier}`, ); export const RemoveLineHasFulfillmentsError = createDomainError( "RemoveLineHasFulfillmentsError", "SALES_REMOVE_LINE_HAS_FULFILLMENTS", (identifier: string) => `REMOVE targets a line with fulfilled quantity: ${identifier}`, ); export const RemoveLineHasBillsError = createDomainError( "RemoveLineHasBillsError", "SALES_REMOVE_LINE_HAS_BILLS", (identifier: string) => `REMOVE targets a line with billed quantity: ${identifier}`, ); export const EmptySalesOrderLinesError = createDomainError( "EmptySalesOrderLinesError", "SALES_EMPTY_SALES_ORDER_LINES", (identifier: string) => `Sales order has no lines: ${identifier}`, ); export const ItemNotFoundError = createDomainError( "ItemNotFoundError", "SALES_ITEM_NOT_FOUND", (identifier: string) => `One or more referenced items do not exist: ${identifier}`, ); export const ItemNotActiveError = createDomainError( "ItemNotActiveError", "SALES_ITEM_NOT_ACTIVE", (identifier: string) => `One or more referenced items are not in ACTIVE status: ${identifier}`, ); export const ItemNotSellableError = createDomainError( "ItemNotSellableError", "SALES_ITEM_NOT_SELLABLE", (identifier: string) => `Referenced item holds no selling record and cannot be sold: ${identifier}`, ); export const CrossCompanyReferenceError = createDomainError( "CrossCompanyReferenceError", "SALES_CROSS_COMPANY_REFERENCE", (identifier: string) => `One or more referenced records belong to a different company: ${identifier}`, ); export const InvalidQuantityError = createDomainError( "InvalidQuantityError", "SALES_INVALID_QUANTITY", (identifier: string) => `Quantity is zero or negative: ${identifier}`, ); export const InvalidUnitPriceError = createDomainError( "InvalidUnitPriceError", "SALES_INVALID_UNIT_PRICE", (identifier: string) => `Unit price must be greater than zero.: ${identifier}`, ); export const InvalidOrderStatusError = createDomainError( "InvalidOrderStatusError", "SALES_INVALID_ORDER_STATUS", (identifier: string) => `Sales order status does not allow this operation: ${identifier}`, ); export const CancellationBlockedError = createDomainError( "CancellationBlockedError", "SALES_CANCELLATION_BLOCKED", (identifier: string) => `Fulfillment progress or downstream billing progress already exists.: ${identifier}`, ); export const OrderNotClosableError = createDomainError( "OrderNotClosableError", "SALES_ORDER_NOT_CLOSABLE", (identifier: string) => `Remaining open balance still exists.: ${identifier}`, ); export const CustomerNotActiveError = createDomainError( "CustomerNotActiveError", "SALES_CUSTOMER_NOT_ACTIVE", (identifier: string) => `Referenced customer is not in ACTIVE status: ${identifier}`, ); export const MissingFinalPriceError = createDomainError( "MissingFinalPriceError", "SALES_MISSING_FINAL_PRICE", (identifier: string) => `A line lacks final price information.: ${identifier}`, ); export const DuplicateSalesItemError = createDomainError( "DuplicateSalesItemError", "SALES_DUPLICATE_SALES_ITEM", (identifier: string) => `Referenced item already holds a selling record: ${identifier}`, ); export const CompanyNotFoundError = createDomainError( "CompanyNotFoundError", "SALES_COMPANY_NOT_FOUND", (identifier: string) => `Referenced company does not exist: ${identifier}`, ); export const CurrencyMismatchError = createDomainError( "CurrencyMismatchError", "SALES_CURRENCY_MISMATCH", (identifier: string) => `Currency is not the company's base currency: ${identifier}`, ); export const CustomerNotFoundError = createDomainError( "CustomerNotFoundError", "SALES_CUSTOMER_NOT_FOUND", (identifier: string) => `Referenced customer does not exist.: ${identifier}`, ); export const EmptyOrderNotAllowedError = createDomainError( "EmptyOrderNotAllowedError", "SALES_EMPTY_ORDER_NOT_ALLOWED", (identifier: string) => `Sales order has no lines: ${identifier}`, ); export const InvalidOrderLineError = createDomainError( "InvalidOrderLineError", "SALES_INVALID_ORDER_LINE", (identifier: string) => `Order line is missing quantity, price, or item context: ${identifier}`, ); export const NegativeBilledQuantityError = createDomainError( "NegativeBilledQuantityError", "SALES_NEGATIVE_BILLED_QUANTITY", (identifier: string) => `Supplied billed quantity is negative: ${identifier}`, ); export const NegativeFulfilledQuantityError = createDomainError( "NegativeFulfilledQuantityError", "SALES_NEGATIVE_FULFILLED_QUANTITY", (identifier: string) => `Supplied fulfilled-quantity delta is negative: ${identifier}`, ); export const OverFulfillmentError = createDomainError( "OverFulfillmentError", "SALES_OVER_FULFILLMENT", (identifier: string) => `Shipment would exceed ordered quantity or target a non-physical line: ${identifier}`, ); export const RejectionReasonRequiredError = createDomainError( "RejectionReasonRequiredError", "SALES_REJECTION_REASON_REQUIRED", (identifier: string) => `A rejection reason is required.: ${identifier}`, ); export const ShippingAddressRequiredError = createDomainError( "ShippingAddressRequiredError", "SALES_SHIPPING_ADDRESS_REQUIRED", (identifier: string) => `A shipping address is required for shippable lines.: ${identifier}`, ); export const OrderNotEditableError = createDomainError( "OrderNotEditableError", "SALES_ORDER_NOT_EDITABLE", (identifier: string) => `Only DRAFT orders may be updated directly.: ${identifier}`, ); export const CompanyScopeRequiredError = createDomainError( "CompanyScopeRequiredError", "SALES_COMPANY_SCOPE_REQUIRED", (identifier: string) => `Company scope is required.: ${identifier}`, );