// @generated — do not edit
import { createDomainError } from "@tailor-platform/erp-kit/core";

export const ChannelNotFoundError = createDomainError(
  "ChannelNotFoundError", "SALES_CHANNEL_NOT_FOUND",
  (identifier: string) => `Referenced channel does not exist: ${identifier}`,
);

export const InvalidChannelStatusError = createDomainError(
  "InvalidChannelStatusError", "SALES_INVALID_CHANNEL_STATUS",
  (identifier: string) => `Channel status does not allow this operation: ${identifier}`,
);

export const InvalidChannelTypeError = createDomainError(
  "InvalidChannelTypeError", "SALES_INVALID_CHANNEL_TYPE",
  (identifier: string) => `Channel type is missing or unsupported.: ${identifier}`,
);

export const DuplicateChannelNameError = createDomainError(
  "DuplicateChannelNameError", "SALES_DUPLICATE_CHANNEL_NAME",
  (identifier: string) => `A conflicting channel name already exists.: ${identifier}`,
);

export const ListingNotFoundError = createDomainError(
  "ListingNotFoundError", "SALES_LISTING_NOT_FOUND",
  (identifier: string) => `Referenced listing does not exist.: ${identifier}`,
);

export const InvalidListingStatusError = createDomainError(
  "InvalidListingStatusError", "SALES_INVALID_LISTING_STATUS",
  (identifier: string) => `Listing status does not allow this operation: ${identifier}`,
);

export const ListingIdentifierRequiredError = createDomainError(
  "ListingIdentifierRequiredError", "SALES_LISTING_IDENTIFIER_REQUIRED",
  (identifier: string) => `Required listing identifiers are missing.: ${identifier}`,
);

export const ChannelOrItemInactiveError = createDomainError(
  "ChannelOrItemInactiveError", "SALES_CHANNEL_OR_ITEM_INACTIVE",
  (identifier: string) => `Listing cannot activate because channel or item is inactive.: ${identifier}`,
);

export const MissingPriceLinkageError = createDomainError(
  "MissingPriceLinkageError", "SALES_MISSING_PRICE_LINKAGE",
  (identifier: string) => `Required pricing linkage is missing for activation.: ${identifier}`,
);

export const SalespaymenttermNotFoundError = createDomainError(
  "SalespaymenttermNotFoundError", "SALES_SALESPAYMENTTERM_NOT_FOUND",
  (identifier: string) => `Referenced SalesPaymentTerm does not exist: ${identifier}`,
);

export const InvalidSalespaymenttermStatusError = createDomainError(
  "InvalidSalespaymenttermStatusError", "SALES_INVALID_SALESPAYMENTTERM_STATUS",
  (identifier: string) => `SalesPaymentTerm status does not allow this operation: ${identifier}`,
);

export const InvalidPaymentScheduleError = createDomainError(
  "InvalidPaymentScheduleError", "SALES_INVALID_PAYMENT_SCHEDULE",
  (identifier: string) => `Schedule lines do not satisfy payment-term rules.: ${identifier}`,
);

export const SalespricelistNotFoundError = createDomainError(
  "SalespricelistNotFoundError", "SALES_SALESPRICELIST_NOT_FOUND",
  (identifier: string) => `Referenced SalesPriceList does not exist: ${identifier}`,
);

export const InvalidSalespricelistStatusError = createDomainError(
  "InvalidSalespricelistStatusError", "SALES_INVALID_SALESPRICELIST_STATUS",
  (identifier: string) => `SalesPriceList status does not allow this operation: ${identifier}`,
);

export const CompanyNotFoundError = createDomainError(
  "CompanyNotFoundError", "SALES_COMPANY_NOT_FOUND",
  (identifier: string) => `Referenced company does not exist.: ${identifier}`,
);

export const SalespriceruleNotFoundError = createDomainError(
  "SalespriceruleNotFoundError", "SALES_SALESPRICERULE_NOT_FOUND",
  (identifier: string) => `Referenced SalesPriceRule does not exist: ${identifier}`,
);

export const InvalidSalespriceruleStatusError = createDomainError(
  "InvalidSalespriceruleStatusError", "SALES_INVALID_SALESPRICERULE_STATUS",
  (identifier: string) => `SalesPriceRule status does not allow this operation: ${identifier}`,
);

export const PriceListNotFoundError = createDomainError(
  "PriceListNotFoundError", "SALES_PRICE_LIST_NOT_FOUND",
  (identifier: string) => `Referenced sales price list does not exist: ${identifier}`,
);

export const InvalidUnitPriceError = createDomainError(
  "InvalidUnitPriceError", "SALES_INVALID_UNIT_PRICE",
  (identifier: string) => `Unit price must be greater than zero.: ${identifier}`,
);

export const InvalidEffectiveRangeError = createDomainError(
  "InvalidEffectiveRangeError", "SALES_INVALID_EFFECTIVE_RANGE",
  (identifier: string) => `Effective end date precedes start date.: ${identifier}`,
);

export const ChannelOrderNotFoundError = createDomainError(
  "ChannelOrderNotFoundError", "SALES_CHANNEL_ORDER_NOT_FOUND",
  (identifier: string) => `Referenced channel order does not exist.: ${identifier}`,
);

export const InvalidChannelOrderStatusError = createDomainError(
  "InvalidChannelOrderStatusError", "SALES_INVALID_CHANNEL_ORDER_STATUS",
  (identifier: string) => `Channel order status does not allow this operation: ${identifier}`,
);

export const SalesInvoiceNotFoundError = createDomainError(
  "SalesInvoiceNotFoundError", "SALES_SALES_INVOICE_NOT_FOUND",
  (identifier: string) => `Referenced sales invoice does not exist: ${identifier}`,
);

export const InvalidInvoiceStatusError = createDomainError(
  "InvalidInvoiceStatusError", "SALES_INVALID_INVOICE_STATUS",
  (identifier: string) => `Invoice status does not allow this operation: ${identifier}`,
);

export const InvoiceCancellationBlockedError = createDomainError(
  "InvoiceCancellationBlockedError", "SALES_INVOICE_CANCELLATION_BLOCKED",
  (identifier: string) => `Downstream AR handoff already accepted the invoice.: ${identifier}`,
);

export const SalesOrderNotFoundError = createDomainError(
  "SalesOrderNotFoundError", "SALES_SALES_ORDER_NOT_FOUND",
  (identifier: string) => `Referenced sales order does not exist.: ${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) => `Posted shipment or issued invoice evidence already exists.: ${identifier}`,
);

export const SyncJobNotFoundError = createDomainError(
  "SyncJobNotFoundError", "SALES_SYNC_JOB_NOT_FOUND",
  (identifier: string) => `Referenced sync job does not exist.: ${identifier}`,
);

export const InvalidSyncJobStatusError = createDomainError(
  "InvalidSyncJobStatusError", "SALES_INVALID_SYNC_JOB_STATUS",
  (identifier: string) => `Sync job is not in a valid status for this operation: ${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 or currency information.: ${identifier}`,
);

export const ChannelOrderMappingFailedError = createDomainError(
  "ChannelOrderMappingFailedError", "SALES_CHANNEL_ORDER_MAPPING_FAILED",
  (identifier: string) => `Required customer, listing, item, or currency mapping is missing.: ${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) => `Referenced item is not active for listing use.: ${identifier}`,
);

export const DuplicateListingIdentityError = createDomainError(
  "DuplicateListingIdentityError", "SALES_DUPLICATE_LISTING_IDENTITY",
  (identifier: string) => `A conflicting listing identity already exists.: ${identifier}`,
);

export const InvoiceNotIssuedError = createDomainError(
  "InvoiceNotIssuedError", "SALES_INVOICE_NOT_ISSUED",
  (identifier: string) => `Credit notes require an issued invoice.: ${identifier}`,
);

export const InvalidCreditNoteLineError = createDomainError(
  "InvalidCreditNoteLineError", "SALES_INVALID_CREDIT_NOTE_LINE",
  (identifier: string) => `Credit note correction line or amount is invalid: ${identifier}`,
);

export const InvalidInvoiceLineError = createDomainError(
  "InvalidInvoiceLineError", "SALES_INVALID_INVOICE_LINE",
  (identifier: string) => `Invoice line content is incomplete or invalid: ${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 CustomerNotFoundError = createDomainError(
  "CustomerNotFoundError", "SALES_CUSTOMER_NOT_FOUND",
  (identifier: string) => `Referenced customer does not exist.: ${identifier}`,
);

export const CustomerRoleRequiredError = createDomainError(
  "CustomerRoleRequiredError", "SALES_CUSTOMER_ROLE_REQUIRED",
  (identifier: string) => `Referenced partner does not carry the CUSTOMER role.: ${identifier}`,
);

export const InvalidOrderLineError = createDomainError(
  "InvalidOrderLineError", "SALES_INVALID_ORDER_LINE",
  (identifier: string) => `Order line is missing quantity, price, or item context: ${identifier}`,
);

export const OrderNotShippableError = createDomainError(
  "OrderNotShippableError", "SALES_ORDER_NOT_SHIPPABLE",
  (identifier: string) => `Sales order does not allow new shipment creation.: ${identifier}`,
);

export const InvalidShipmentLineError = createDomainError(
  "InvalidShipmentLineError", "SALES_INVALID_SHIPMENT_LINE",
  (identifier: string) => `Shipment line quantity or reference is invalid: ${identifier}`,
);

export const SalesCreditNoteNotFoundError = createDomainError(
  "SalesCreditNoteNotFoundError", "SALES_SALES_CREDIT_NOTE_NOT_FOUND",
  (identifier: string) => `Referenced sales credit note does not exist.: ${identifier}`,
);

export const InvalidCreditNoteStatusError = createDomainError(
  "InvalidCreditNoteStatusError", "SALES_INVALID_CREDIT_NOTE_STATUS",
  (identifier: string) => `Only DRAFT credit notes may be issued.: ${identifier}`,
);

export const CreditLimitExceededError = createDomainError(
  "CreditLimitExceededError", "SALES_CREDIT_LIMIT_EXCEEDED",
  (identifier: string) => `Cumulative credited quantity or amount exceeds the original invoice baseline.: ${identifier}`,
);

export const BillingPolicyViolationError = createDomainError(
  "BillingPolicyViolationError", "SALES_BILLING_POLICY_VIOLATION",
  (identifier: string) => `Invoice quantity exceeds allowed order-based or shipment-based quantity.: ${identifier}`,
);

export const DueScheduleNotComputableError = createDomainError(
  "DueScheduleNotComputableError", "SALES_DUE_SCHEDULE_NOT_COMPUTABLE",
  (identifier: string) => `The assigned payment term cannot produce a due schedule.: ${identifier}`,
);

export const ExceptionContextRequiredError = createDomainError(
  "ExceptionContextRequiredError", "SALES_EXCEPTION_CONTEXT_REQUIRED",
  (identifier: string) => `Retry or troubleshooting context is required.: ${identifier}`,
);

export const HoldReasonRequiredError = createDomainError(
  "HoldReasonRequiredError", "SALES_HOLD_REASON_REQUIRED",
  (identifier: string) => `A hold reason is required.: ${identifier}`,
);

export const ShipmentNotFoundError = createDomainError(
  "ShipmentNotFoundError", "SALES_SHIPMENT_NOT_FOUND",
  (identifier: string) => `Referenced shipment does not exist.: ${identifier}`,
);

export const InvalidShipmentStatusError = createDomainError(
  "InvalidShipmentStatusError", "SALES_INVALID_SHIPMENT_STATUS",
  (identifier: string) => `Only DRAFT shipments may be posted.: ${identifier}`,
);

export const OverShipmentNotAllowedError = createDomainError(
  "OverShipmentNotAllowedError", "SALES_OVER_SHIPMENT_NOT_ALLOWED",
  (identifier: string) => `Posted quantity exceeds remaining open quantity.: ${identifier}`,
);

export const ExternalOrderIdRequiredError = createDomainError(
  "ExternalOrderIdRequiredError", "SALES_EXTERNAL_ORDER_ID_REQUIRED",
  (identifier: string) => `External order identity is required.: ${identifier}`,
);

export const RejectionReasonRequiredError = createDomainError(
  "RejectionReasonRequiredError", "SALES_REJECTION_REASON_REQUIRED",
  (identifier: string) => `A rejection reason is required.: ${identifier}`,
);

export const DeliveryMetadataRequiredError = createDomainError(
  "DeliveryMetadataRequiredError", "SALES_DELIVERY_METADATA_REQUIRED",
  (identifier: string) => `Required invoice delivery metadata is missing.: ${identifier}`,
);

export const ChannelNotSyncableError = createDomainError(
  "ChannelNotSyncableError", "SALES_CHANNEL_NOT_SYNCABLE",
  (identifier: string) => `Channel is inactive or blocked for new sync execution.: ${identifier}`,
);

export const SyncDirectionRequiredError = createDomainError(
  "SyncDirectionRequiredError", "SALES_SYNC_DIRECTION_REQUIRED",
  (identifier: string) => `Sync direction is required.: ${identifier}`,
);

export const EmptyOrderNotAllowedError = createDomainError(
  "EmptyOrderNotAllowedError", "SALES_EMPTY_ORDER_NOT_ALLOWED",
  (identifier: string) => `Sales order has no lines: ${identifier}`,
);

export const ShippingAddressRequiredError = createDomainError(
  "ShippingAddressRequiredError", "SALES_SHIPPING_ADDRESS_REQUIRED",
  (identifier: string) => `A shipping address is required for shippable lines.: ${identifier}`,
);

export const ListingNotEditableError = createDomainError(
  "ListingNotEditableError", "SALES_LISTING_NOT_EDITABLE",
  (identifier: string) => `Retired listings cannot be updated.: ${identifier}`,
);

export const DuplicateExternalIdentifierError = createDomainError(
  "DuplicateExternalIdentifierError", "SALES_DUPLICATE_EXTERNAL_IDENTIFIER",
  (identifier: string) => `External identifier conflicts with another listing on the same channel.: ${identifier}`,
);

export const CreditNoteNotEditableError = createDomainError(
  "CreditNoteNotEditableError", "SALES_CREDIT_NOTE_NOT_EDITABLE",
  (identifier: string) => `Only DRAFT credit notes may be updated.: ${identifier}`,
);

export const LineNotFoundError = createDomainError(
  "LineNotFoundError", "SALES_LINE_NOT_FOUND",
  (identifier: string) => `Referenced line does not exist on the target document: ${identifier}`,
);

export const EmptySalesCreditNoteLinesError = createDomainError(
  "EmptySalesCreditNoteLinesError", "SALES_EMPTY_SALES_CREDIT_NOTE_LINES",
  (identifier: string) => `No sales-credit-note lines were provided: ${identifier}`,
);

export const InvoiceNotEditableError = createDomainError(
  "InvoiceNotEditableError", "SALES_INVOICE_NOT_EDITABLE",
  (identifier: string) => `Only DRAFT invoices may be updated.: ${identifier}`,
);

export const EmptySalesInvoiceLinesError = createDomainError(
  "EmptySalesInvoiceLinesError", "SALES_EMPTY_SALES_INVOICE_LINES",
  (identifier: string) => `No sales-invoice lines were provided: ${identifier}`,
);

export const OrderNotEditableError = createDomainError(
  "OrderNotEditableError", "SALES_ORDER_NOT_EDITABLE",
  (identifier: string) => `Only DRAFT orders may be updated directly.: ${identifier}`,
);

export const SalespaymenttermNotEditableError = createDomainError(
  "SalespaymenttermNotEditableError", "SALES_SALESPAYMENTTERM_NOT_EDITABLE",
  (identifier: string) => `SalesPaymentTerm is not in an editable lifecycle state.: ${identifier}`,
);

export const SalespricelistNotEditableError = createDomainError(
  "SalespricelistNotEditableError", "SALES_SALESPRICELIST_NOT_EDITABLE",
  (identifier: string) => `SalesPriceList is not in an editable lifecycle state.: ${identifier}`,
);

export const SalespriceruleNotEditableError = createDomainError(
  "SalespriceruleNotEditableError", "SALES_SALESPRICERULE_NOT_EDITABLE",
  (identifier: string) => `SalesPriceRule is not in an editable lifecycle state.: ${identifier}`,
);

export const ShipmentNotEditableError = createDomainError(
  "ShipmentNotEditableError", "SALES_SHIPMENT_NOT_EDITABLE",
  (identifier: string) => `Only DRAFT shipments may be updated.: ${identifier}`,
);

export const EmptyShipmentLinesError = createDomainError(
  "EmptyShipmentLinesError", "SALES_EMPTY_SHIPMENT_LINES",
  (identifier: string) => `No shipment lines were provided: ${identifier}`,
);

export const PaymentTermNotFoundError = createDomainError(
  "PaymentTermNotFoundError", "SALES_PAYMENT_TERM_NOT_FOUND",
  (identifier: string) => `Referenced payment term does not exist.: ${identifier}`,
);

export const InvalidPaymentTermDefinitionError = createDomainError(
  "InvalidPaymentTermDefinitionError", "SALES_INVALID_PAYMENT_TERM_DEFINITION",
  (identifier: string) => `Payment term definition cannot produce a deterministic due schedule.: ${identifier}`,
);

export const InvalidPricingContextError = createDomainError(
  "InvalidPricingContextError", "SALES_INVALID_PRICING_CONTEXT",
  (identifier: string) => `Required pricing inputs are missing or inconsistent.: ${identifier}`,
);

export const IdentifierRequiredError = createDomainError(
  "IdentifierRequiredError", "SALES_IDENTIFIER_REQUIRED",
  (identifier: string) => `Channel id and external identifier are required.: ${identifier}`,
);

export const StatusFilterRequiredError = createDomainError(
  "StatusFilterRequiredError", "SALES_STATUS_FILTER_REQUIRED",
  (identifier: string) => `At least one status filter is required.: ${identifier}`,
);

export const CompanyScopeRequiredError = createDomainError(
  "CompanyScopeRequiredError", "SALES_COMPANY_SCOPE_REQUIRED",
  (identifier: string) => `Company scope is required.: ${identifier}`,
);

export const ChannelIdRequiredError = createDomainError(
  "ChannelIdRequiredError", "SALES_CHANNEL_ID_REQUIRED",
  (identifier: string) => `Channel id is required.: ${identifier}`,
);

export const SalesInvoiceIdRequiredError = createDomainError(
  "SalesInvoiceIdRequiredError", "SALES_SALES_INVOICE_ID_REQUIRED",
  (identifier: string) => `Sales-invoice id is required.: ${identifier}`,
);

export const SalesOrderIdRequiredError = createDomainError(
  "SalesOrderIdRequiredError", "SALES_SALES_ORDER_ID_REQUIRED",
  (identifier: string) => `Sales-order id is required.: ${identifier}`,
);
