// @generated — do not edit import { createDomainError } from "@tailor-platform/erp-kit/core"; export const DocumentNotFoundError = createDomainError( "DocumentNotFoundError", "ACCOUNT_RECEIVABLE_DOCUMENT_NOT_FOUND", (identifier: string) => `Referenced AR document does not exist: ${identifier}`, ); export const InvalidDocumentStatusError = createDomainError( "InvalidDocumentStatusError", "ACCOUNT_RECEIVABLE_INVALID_DOCUMENT_STATUS", (identifier: string) => `AR document status does not allow this operation: ${identifier}`, ); export const SalesOrderBillingSyncFailedError = createDomainError( "SalesOrderBillingSyncFailedError", "ACCOUNT_RECEIVABLE_SALES_ORDER_BILLING_SYNC_FAILED", (identifier: string) => `Sales-order billing projection could not be synchronized: ${identifier}`, ); export const IncomingPaymentNotFoundError = createDomainError( "IncomingPaymentNotFoundError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_NOT_FOUND", (identifier: string) => `Payment does not exist: ${identifier}`, ); export const IncomingPaymentInvalidStatusError = createDomainError( "IncomingPaymentInvalidStatusError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_INVALID_STATUS", (identifier: string) => `Payment status does not allow this operation: ${identifier}`, ); export const InvalidCustomerAccountError = createDomainError( "InvalidCustomerAccountError", "ACCOUNT_RECEIVABLE_INVALID_CUSTOMER_ACCOUNT", (identifier: string) => `Business partner is unavailable for transactions or belongs to another company: ${identifier}`, ); export const DocumentLineNotFoundError = createDomainError( "DocumentLineNotFoundError", "ACCOUNT_RECEIVABLE_DOCUMENT_LINE_NOT_FOUND", (identifier: string) => `A correction line targets another document: ${identifier}`, ); export const DistributionLineNotFoundError = createDomainError( "DistributionLineNotFoundError", "ACCOUNT_RECEIVABLE_DISTRIBUTION_LINE_NOT_FOUND", (identifier: string) => `A distribution target is missing or belongs to another line: ${identifier}`, ); export const LineSourceInconsistentError = createDomainError( "LineSourceInconsistentError", "ACCOUNT_RECEIVABLE_LINE_SOURCE_INCONSISTENT", (identifier: string) => `Sales-order source fields are incomplete or inconsistent: ${identifier}`, ); export const DueScheduleInvalidError = createDomainError( "DueScheduleInvalidError", "ACCOUNT_RECEIVABLE_DUE_SCHEDULE_INVALID", (identifier: string) => `Due schedule must be positive and equal the document total: ${identifier}`, ); export const AccountingPeriodNotFoundError = createDomainError( "AccountingPeriodNotFoundError", "ACCOUNT_RECEIVABLE_ACCOUNTING_PERIOD_NOT_FOUND", (identifier: string) => `No open accounting period contains the posting date: ${identifier}`, ); export const JournalEntryCreateFailedError = createDomainError( "JournalEntryCreateFailedError", "ACCOUNT_RECEIVABLE_JOURNAL_ENTRY_CREATE_FAILED", (identifier: string) => `Invoice journal entry could not be created: ${identifier}`, ); export const JournalEntryPostFailedError = createDomainError( "JournalEntryPostFailedError", "ACCOUNT_RECEIVABLE_JOURNAL_ENTRY_POST_FAILED", (identifier: string) => `Invoice journal entry could not be posted: ${identifier}`, ); export const MinimumLinesNotMetError = createDomainError( "MinimumLinesNotMetError", "ACCOUNT_RECEIVABLE_MINIMUM_LINES_NOT_MET", (identifier: string) => `No invoice lines were supplied: ${identifier}`, ); export const InvalidAmountError = createDomainError( "InvalidAmountError", "ACCOUNT_RECEIVABLE_INVALID_AMOUNT", (identifier: string) => `A line or header amount is not positive: ${identifier}`, ); export const LineAmountMismatchError = createDomainError( "LineAmountMismatchError", "ACCOUNT_RECEIVABLE_LINE_AMOUNT_MISMATCH", (identifier: string) => `Net amount differs from quantity times unit price: ${identifier}`, ); export const LineTotalMismatchError = createDomainError( "LineTotalMismatchError", "ACCOUNT_RECEIVABLE_LINE_TOTAL_MISMATCH", (identifier: string) => `Invoice line total does not equal the document total: ${identifier}`, ); export const CompanyNotFoundError = createDomainError( "CompanyNotFoundError", "ACCOUNT_RECEIVABLE_COMPANY_NOT_FOUND", (identifier: string) => `Referenced company does not exist: ${identifier}`, ); export const CompanyInactiveError = createDomainError( "CompanyInactiveError", "ACCOUNT_RECEIVABLE_COMPANY_INACTIVE", (identifier: string) => `Referenced company is not ACTIVE: ${identifier}`, ); export const CustomerAccountNotFoundError = createDomainError( "CustomerAccountNotFoundError", "ACCOUNT_RECEIVABLE_CUSTOMER_ACCOUNT_NOT_FOUND", (identifier: string) => `Referenced customer account does not exist: ${identifier}`, ); export const CurrencyNotFoundError = createDomainError( "CurrencyNotFoundError", "ACCOUNT_RECEIVABLE_CURRENCY_NOT_FOUND", (identifier: string) => `Referenced currency does not exist: ${identifier}`, ); export const AccountNotFoundError = createDomainError( "AccountNotFoundError", "ACCOUNT_RECEIVABLE_ACCOUNT_NOT_FOUND", (identifier: string) => `Referenced GL account does not exist: ${identifier}`, ); export const AccountInactiveError = createDomainError( "AccountInactiveError", "ACCOUNT_RECEIVABLE_ACCOUNT_INACTIVE", (identifier: string) => `Referenced GL account is not ACTIVE: ${identifier}`, ); export const AccountCompanyMismatchError = createDomainError( "AccountCompanyMismatchError", "ACCOUNT_RECEIVABLE_ACCOUNT_COMPANY_MISMATCH", (identifier: string) => `Referenced account belongs to a different company: ${identifier}`, ); export const IncomingPaymentInvalidAmountError = createDomainError( "IncomingPaymentInvalidAmountError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_INVALID_AMOUNT", (identifier: string) => `Payment total or settlement amount is not positive: ${identifier}`, ); export const IncomingPaymentSettlementInvalidError = createDomainError( "IncomingPaymentSettlementInvalidError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_SETTLEMENT_INVALID", (identifier: string) => `Settlement set is empty where required, duplicated, or internally inconsistent: ${identifier}`, ); export const IncomingPaymentTargetIneligibleError = createDomainError( "IncomingPaymentTargetIneligibleError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_TARGET_INELIGIBLE", (identifier: string) => `Settlement target is not an eligible AR due schedule: ${identifier}`, ); export const PostingCurrencyMismatchError = createDomainError( "PostingCurrencyMismatchError", "ACCOUNT_RECEIVABLE_POSTING_CURRENCY_MISMATCH", (identifier: string) => `Invoice and base currencies differ: ${identifier}`, ); export const IncomingPaymentTotalMismatchError = createDomainError( "IncomingPaymentTotalMismatchError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_TOTAL_MISMATCH", (identifier: string) => `Signed settlement amount total differs from payment total: ${identifier}`, ); export const IncomingPaymentOverSettlementError = createDomainError( "IncomingPaymentOverSettlementError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_OVER_SETTLEMENT", (identifier: string) => `Posting would make a due schedule's effective settled amount exceed its amount: ${identifier}`, ); export const IncomingPaymentAccountingPeriodNotFoundError = createDomainError( "IncomingPaymentAccountingPeriodNotFoundError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_ACCOUNTING_PERIOD_NOT_FOUND", (identifier: string) => `No accounting period covers the posting date: ${identifier}`, ); export const IncomingPaymentJournalEntryCreateFailedError = createDomainError( "IncomingPaymentJournalEntryCreateFailedError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_JOURNAL_ENTRY_CREATE_FAILED", (identifier: string) => `Journal entry creation failed: ${identifier}`, ); export const IncomingPaymentJournalEntryPostFailedError = createDomainError( "IncomingPaymentJournalEntryPostFailedError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_JOURNAL_ENTRY_POST_FAILED", (identifier: string) => `Journal entry posting failed: ${identifier}`, ); export const IncomingPaymentAlreadyReversedError = createDomainError( "IncomingPaymentAlreadyReversedError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_ALREADY_REVERSED", (identifier: string) => `A reversal already exists for the original payment: ${identifier}`, ); export const IncomingPaymentReversalNotAllowedError = createDomainError( "IncomingPaymentReversalNotAllowedError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_REVERSAL_NOT_ALLOWED", (identifier: string) => `Reversal would make effective settlement negative: ${identifier}`, ); export const IncomingPaymentSettlementNotFoundError = createDomainError( "IncomingPaymentSettlementNotFoundError", "ACCOUNT_RECEIVABLE_INCOMING_PAYMENT_SETTLEMENT_NOT_FOUND", (identifier: string) => `Updated or removed settlement does not belong to the payment: ${identifier}`, );