// @generated — do not edit import { createDomainError } from "@tailor-platform/erp-kit/core"; export const ApDocumentNotFoundError = createDomainError( "ApDocumentNotFoundError", "ACCOUNT_PAYABLE_AP_DOCUMENT_NOT_FOUND", (identifier: string) => `Referenced AP document does not exist: ${identifier}`, ); export const ApInvalidDocumentStatusError = createDomainError( "ApInvalidDocumentStatusError", "ACCOUNT_PAYABLE_AP_INVALID_DOCUMENT_STATUS", (identifier: string) => `AP document status does not allow this operation: ${identifier}`, ); export const ApPurchaseOrderBillingSyncFailedError = createDomainError( "ApPurchaseOrderBillingSyncFailedError", "ACCOUNT_PAYABLE_AP_PURCHASE_ORDER_BILLING_SYNC_FAILED", (identifier: string) => `Purchase-order billing status sync failed for the AP document: ${identifier}`, ); export const ApAcquisitionCostAdjustmentFailedError = createDomainError( "ApAcquisitionCostAdjustmentFailedError", "ACCOUNT_PAYABLE_AP_ACQUISITION_COST_ADJUSTMENT_FAILED", (identifier: string) => `Inventory acquisition cost adjustment failed for a purchase-order sourced line: ${identifier}`, ); export const OutgoingPaymentNotFoundError = createDomainError( "OutgoingPaymentNotFoundError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_NOT_FOUND", (identifier: string) => `Payment does not exist: ${identifier}`, ); export const OutgoingPaymentInvalidStatusError = createDomainError( "OutgoingPaymentInvalidStatusError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_INVALID_STATUS", (identifier: string) => `Payment status does not allow this operation: ${identifier}`, ); export const ApSupplierAccountNotFoundError = createDomainError( "ApSupplierAccountNotFoundError", "ACCOUNT_PAYABLE_AP_SUPPLIER_ACCOUNT_NOT_FOUND", (identifier: string) => `Referenced supplier account does not exist: ${identifier}`, ); export const ApInvalidSupplierAccountError = createDomainError( "ApInvalidSupplierAccountError", "ACCOUNT_PAYABLE_AP_INVALID_SUPPLIER_ACCOUNT", (identifier: string) => `Business partner is unavailable for transactions or belongs to another company: ${identifier}`, ); export const ApPurchaseOrderAccountMismatchError = createDomainError( "ApPurchaseOrderAccountMismatchError", "ACCOUNT_PAYABLE_AP_PURCHASE_ORDER_ACCOUNT_MISMATCH", (identifier: string) => `Referenced purchase order belongs to a different company or supplier account: ${identifier}`, ); export const ApAccrualAccountUnresolvedError = createDomainError( "ApAccrualAccountUnresolvedError", "ACCOUNT_PAYABLE_AP_ACCRUAL_ACCOUNT_UNRESOLVED", (identifier: string) => `Neither the ordered item's valuation policy nor a company default policy resolves the posting accounts for a receipt-required purchase order line: ${identifier}`, ); export const ApDocumentLineNotFoundError = createDomainError( "ApDocumentLineNotFoundError", "ACCOUNT_PAYABLE_AP_DOCUMENT_LINE_NOT_FOUND", (identifier: string) => `Referenced AP document line does not exist: ${identifier}`, ); export const ApDistributionLineNotFoundError = createDomainError( "ApDistributionLineNotFoundError", "ACCOUNT_PAYABLE_AP_DISTRIBUTION_LINE_NOT_FOUND", (identifier: string) => `Referenced AP distribution line does not exist: ${identifier}`, ); export const ApLineSourceInconsistentError = createDomainError( "ApLineSourceInconsistentError", "ACCOUNT_PAYABLE_AP_LINE_SOURCE_INCONSISTENT", (identifier: string) => `AP line source fields, correction target, or values are inconsistent: ${identifier}`, ); export const ApMinimumLinesNotMetError = createDomainError( "ApMinimumLinesNotMetError", "ACCOUNT_PAYABLE_AP_MINIMUM_LINES_NOT_MET", (identifier: string) => `AP document must have at least one line and one distribution: ${identifier}`, ); export const ApInvalidAmountError = createDomainError( "ApInvalidAmountError", "ACCOUNT_PAYABLE_AP_INVALID_AMOUNT", (identifier: string) => `AP document, line, quantity, unit price, or distribution amount is not positive: ${identifier}`, ); export const ApLineTotalMismatchError = createDomainError( "ApLineTotalMismatchError", "ACCOUNT_PAYABLE_AP_LINE_TOTAL_MISMATCH", (identifier: string) => `AP line gross total or distribution total does not match the document total: ${identifier}`, ); export const ApDueScheduleInvalidError = createDomainError( "ApDueScheduleInvalidError", "ACCOUNT_PAYABLE_AP_DUE_SCHEDULE_INVALID", (identifier: string) => `AP due schedule must have positive amounts and sum to the document total: ${identifier}`, ); export const AccountNotFoundError = createDomainError( "AccountNotFoundError", "ACCOUNT_PAYABLE_ACCOUNT_NOT_FOUND", (identifier: string) => `Referenced GL account does not exist: ${identifier}`, ); export const AccountInactiveError = createDomainError( "AccountInactiveError", "ACCOUNT_PAYABLE_ACCOUNT_INACTIVE", (identifier: string) => `Referenced GL account is not ACTIVE: ${identifier}`, ); export const ApPostingCurrencyMismatchError = createDomainError( "ApPostingCurrencyMismatchError", "ACCOUNT_PAYABLE_AP_POSTING_CURRENCY_MISMATCH", (identifier: string) => `AP document currency does not match the company base currency: ${identifier}`, ); export const ApAccountingPeriodNotFoundError = createDomainError( "ApAccountingPeriodNotFoundError", "ACCOUNT_PAYABLE_AP_ACCOUNTING_PERIOD_NOT_FOUND", (identifier: string) => `No accounting period covers the AP document posting date: ${identifier}`, ); export const ApJournalEntryCreateFailedError = createDomainError( "ApJournalEntryCreateFailedError", "ACCOUNT_PAYABLE_AP_JOURNAL_ENTRY_CREATE_FAILED", (identifier: string) => `Journal entry creation failed for the AP document: ${identifier}`, ); export const ApJournalEntryPostFailedError = createDomainError( "ApJournalEntryPostFailedError", "ACCOUNT_PAYABLE_AP_JOURNAL_ENTRY_POST_FAILED", (identifier: string) => `Journal entry posting failed for the AP document: ${identifier}`, ); export const CompanyNotFoundError = createDomainError( "CompanyNotFoundError", "ACCOUNT_PAYABLE_COMPANY_NOT_FOUND", (identifier: string) => `Referenced company does not exist: ${identifier}`, ); export const ApCurrencyNotFoundError = createDomainError( "ApCurrencyNotFoundError", "ACCOUNT_PAYABLE_AP_CURRENCY_NOT_FOUND", (identifier: string) => `Referenced currency does not exist: ${identifier}`, ); export const ApLineAmountMismatchError = createDomainError( "ApLineAmountMismatchError", "ACCOUNT_PAYABLE_AP_LINE_AMOUNT_MISMATCH", (identifier: string) => `AP line net amount does not equal quantity times unit price: ${identifier}`, ); export const InvalidToleranceValueError = createDomainError( "InvalidToleranceValueError", "ACCOUNT_PAYABLE_INVALID_TOLERANCE_VALUE", (identifier: string) => `Invoice tolerance value must not be negative: ${identifier}`, ); export const InvoiceToleranceConfigAlreadyExistsError = createDomainError( "InvoiceToleranceConfigAlreadyExistsError", "ACCOUNT_PAYABLE_INVOICE_TOLERANCE_CONFIG_ALREADY_EXISTS", (identifier: string) => `Invoice tolerance config already exists for the company and supplier: ${identifier}`, ); export const CompanyInactiveError = createDomainError( "CompanyInactiveError", "ACCOUNT_PAYABLE_COMPANY_INACTIVE", (identifier: string) => `Referenced company is not ACTIVE: ${identifier}`, ); export const AccountCompanyMismatchError = createDomainError( "AccountCompanyMismatchError", "ACCOUNT_PAYABLE_ACCOUNT_COMPANY_MISMATCH", (identifier: string) => `Referenced account belongs to a different company: ${identifier}`, ); export const OutgoingPaymentInvalidAmountError = createDomainError( "OutgoingPaymentInvalidAmountError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_INVALID_AMOUNT", (identifier: string) => `Payment total or settlement amount is not positive: ${identifier}`, ); export const OutgoingPaymentSettlementInvalidError = createDomainError( "OutgoingPaymentSettlementInvalidError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_SETTLEMENT_INVALID", (identifier: string) => `Settlement set is empty where required, duplicated, or internally inconsistent: ${identifier}`, ); export const OutgoingPaymentTargetIneligibleError = createDomainError( "OutgoingPaymentTargetIneligibleError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_TARGET_INELIGIBLE", (identifier: string) => `Settlement target is not an eligible AP due schedule: ${identifier}`, ); export const ApDocumentHasActiveHoldError = createDomainError( "ApDocumentHasActiveHoldError", "ACCOUNT_PAYABLE_AP_DOCUMENT_HAS_ACTIVE_HOLD", (identifier: string) => `AP document cannot be posted while it has an active payment hold: ${identifier}`, ); export const OutgoingPaymentTotalMismatchError = createDomainError( "OutgoingPaymentTotalMismatchError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_TOTAL_MISMATCH", (identifier: string) => `Signed settlement amount total differs from payment total: ${identifier}`, ); export const OutgoingPaymentOverSettlementError = createDomainError( "OutgoingPaymentOverSettlementError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_OVER_SETTLEMENT", (identifier: string) => `Posting would make a due schedule's effective settled amount exceed its amount: ${identifier}`, ); export const OutgoingPaymentAccountingPeriodNotFoundError = createDomainError( "OutgoingPaymentAccountingPeriodNotFoundError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_ACCOUNTING_PERIOD_NOT_FOUND", (identifier: string) => `No accounting period covers the posting date: ${identifier}`, ); export const OutgoingPaymentJournalEntryCreateFailedError = createDomainError( "OutgoingPaymentJournalEntryCreateFailedError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_JOURNAL_ENTRY_CREATE_FAILED", (identifier: string) => `Journal entry creation failed: ${identifier}`, ); export const OutgoingPaymentJournalEntryPostFailedError = createDomainError( "OutgoingPaymentJournalEntryPostFailedError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_JOURNAL_ENTRY_POST_FAILED", (identifier: string) => `Journal entry posting failed: ${identifier}`, ); export const ApHoldNotFoundError = createDomainError( "ApHoldNotFoundError", "ACCOUNT_PAYABLE_AP_HOLD_NOT_FOUND", (identifier: string) => `Referenced AP document hold does not exist: ${identifier}`, ); export const ApHoldAlreadyReleasedError = createDomainError( "ApHoldAlreadyReleasedError", "ACCOUNT_PAYABLE_AP_HOLD_ALREADY_RELEASED", (identifier: string) => `AP document hold is already released: ${identifier}`, ); export const OutgoingPaymentAlreadyReversedError = createDomainError( "OutgoingPaymentAlreadyReversedError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_ALREADY_REVERSED", (identifier: string) => `A reversal already exists for the original payment: ${identifier}`, ); export const OutgoingPaymentReversalNotAllowedError = createDomainError( "OutgoingPaymentReversalNotAllowedError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_REVERSAL_NOT_ALLOWED", (identifier: string) => `Reversal would make effective settlement negative: ${identifier}`, ); export const ApLineEditConflictError = createDomainError( "ApLineEditConflictError", "ACCOUNT_PAYABLE_AP_LINE_EDIT_CONFLICT", (identifier: string) => `AP document line cannot be updated and removed in the same command: ${identifier}`, ); export const ApDerivedDistributionImmutableError = createDomainError( "ApDerivedDistributionImmutableError", "ACCOUNT_PAYABLE_AP_DERIVED_DISTRIBUTION_IMMUTABLE", (identifier: string) => `Derived distribution cannot be updated or removed directly; it is recomputed when its line changes: ${identifier}`, ); export const InvoiceToleranceConfigNotFoundError = createDomainError( "InvoiceToleranceConfigNotFoundError", "ACCOUNT_PAYABLE_INVOICE_TOLERANCE_CONFIG_NOT_FOUND", (identifier: string) => `Referenced invoice tolerance config does not exist: ${identifier}`, ); export const OutgoingPaymentSettlementNotFoundError = createDomainError( "OutgoingPaymentSettlementNotFoundError", "ACCOUNT_PAYABLE_OUTGOING_PAYMENT_SETTLEMENT_NOT_FOUND", (identifier: string) => `Updated or removed settlement does not belong to the payment: ${identifier}`, );