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

export const PartnerNotFoundError = createDomainError(
  "PartnerNotFoundError", "BUSINESS_PARTNER_PARTNER_NOT_FOUND",
  (identifier: string) => `Specified partner ID does not exist: ${identifier}`,
);

export const InvalidStateTransitionError = createDomainError(
  "InvalidStateTransitionError", "BUSINESS_PARTNER_INVALID_STATE_TRANSITION",
  (identifier: string) => `The required state transition is not valid for the current status: ${identifier}`,
);

export const PartnerNotActiveError = createDomainError(
  "PartnerNotActiveError", "BUSINESS_PARTNER_PARTNER_NOT_ACTIVE",
  (identifier: string) => `Partner is not in ACTIVE status: ${identifier}`,
);

export const InvalidRoleError = createDomainError(
  "InvalidRoleError", "BUSINESS_PARTNER_INVALID_ROLE",
  (identifier: string) => `Role is not CUSTOMER or SUPPLIER: ${identifier}`,
);

export const PartnerNotOrganizationError = createDomainError(
  "PartnerNotOrganizationError", "BUSINESS_PARTNER_PARTNER_NOT_ORGANIZATION",
  (identifier: string) => `Partner is of type INDIVIDUAL, not ORGANIZATION: ${identifier}`,
);

export const InvalidFirstNameError = createDomainError(
  "InvalidFirstNameError", "BUSINESS_PARTNER_INVALID_FIRST_NAME",
  (identifier: string) => `First name is empty or not provided: ${identifier}`,
);

export const InvalidLastNameError = createDomainError(
  "InvalidLastNameError", "BUSINESS_PARTNER_INVALID_LAST_NAME",
  (identifier: string) => `Last name is empty or not provided: ${identifier}`,
);

export const MissingCommunicationChannelError = createDomainError(
  "MissingCommunicationChannelError", "BUSINESS_PARTNER_MISSING_COMMUNICATION_CHANNEL",
  (identifier: string) => `Neither email nor phone was provided: ${identifier}`,
);

export const InvalidEmailFormatError = createDomainError(
  "InvalidEmailFormatError", "BUSINESS_PARTNER_INVALID_EMAIL_FORMAT",
  (identifier: string) => `Provided email is not in a valid format: ${identifier}`,
);

export const CompanyNotFoundError = createDomainError(
  "CompanyNotFoundError", "BUSINESS_PARTNER_COMPANY_NOT_FOUND",
  (identifier: string) => `Specified company ID does not exist: ${identifier}`,
);

export const InvalidNameError = createDomainError(
  "InvalidNameError", "BUSINESS_PARTNER_INVALID_NAME",
  (identifier: string) => `Name is empty or not provided: ${identifier}`,
);

export const InvalidPartnerTypeError = createDomainError(
  "InvalidPartnerTypeError", "BUSINESS_PARTNER_INVALID_PARTNER_TYPE",
  (identifier: string) => `Type is not ORGANIZATION or INDIVIDUAL: ${identifier}`,
);

export const CurrencyNotFoundError = createDomainError(
  "CurrencyNotFoundError", "BUSINESS_PARTNER_CURRENCY_NOT_FOUND",
  (identifier: string) => `Referenced preferred currency does not exist: ${identifier}`,
);

export const PartnerInactiveError = createDomainError(
  "PartnerInactiveError", "BUSINESS_PARTNER_PARTNER_INACTIVE",
  (identifier: string) => `Partner is in INACTIVE status: ${identifier}`,
);

export const InvalidAddressTypeError = createDomainError(
  "InvalidAddressTypeError", "BUSINESS_PARTNER_INVALID_ADDRESS_TYPE",
  (identifier: string) => `Address type is not a valid enum value: ${identifier}`,
);

export const MissingRequiredAddressFieldError = createDomainError(
  "MissingRequiredAddressFieldError", "BUSINESS_PARTNER_MISSING_REQUIRED_ADDRESS_FIELD",
  (identifier: string) => `One or more required fields (line1, city, postalCode) are empty or not provided: ${identifier}`,
);

export const InvalidCountryCodeError = createDomainError(
  "InvalidCountryCodeError", "BUSINESS_PARTNER_INVALID_COUNTRY_CODE",
  (identifier: string) => `Country is not a valid ISO 3166-1 alpha-2 code: ${identifier}`,
);

export const MissingAccountIdentifierError = createDomainError(
  "MissingAccountIdentifierError", "BUSINESS_PARTNER_MISSING_ACCOUNT_IDENTIFIER",
  (identifier: string) => `Neither accountNumber nor iban was provided: ${identifier}`,
);

export const InvalidBankNameError = createDomainError(
  "InvalidBankNameError", "BUSINESS_PARTNER_INVALID_BANK_NAME",
  (identifier: string) => `Bank name is empty: ${identifier}`,
);

export const InvalidAccountHolderNameError = createDomainError(
  "InvalidAccountHolderNameError", "BUSINESS_PARTNER_INVALID_ACCOUNT_HOLDER_NAME",
  (identifier: string) => `Account holder name is empty: ${identifier}`,
);

export const InvalidIdentificationTypeError = createDomainError(
  "InvalidIdentificationTypeError", "BUSINESS_PARTNER_INVALID_IDENTIFICATION_TYPE",
  (identifier: string) => `Type is not a valid identification type enum value: ${identifier}`,
);

export const InvalidValueError = createDomainError(
  "InvalidValueError", "BUSINESS_PARTNER_INVALID_VALUE",
  (identifier: string) => `Value is empty or not provided: ${identifier}`,
);

export const DuplicateIdentificationError = createDomainError(
  "DuplicateIdentificationError", "BUSINESS_PARTNER_DUPLICATE_IDENTIFICATION",
  (identifier: string) => `An identification with the same type and value already exists within the company: ${identifier}`,
);

export const InvalidValidityPeriodError = createDomainError(
  "InvalidValidityPeriodError", "BUSINESS_PARTNER_INVALID_VALIDITY_PERIOD",
  (identifier: string) => `validTo is earlier than validFrom: ${identifier}`,
);

export const ContactPersonNotFoundError = createDomainError(
  "ContactPersonNotFoundError", "BUSINESS_PARTNER_CONTACT_PERSON_NOT_FOUND",
  (identifier: string) => `Specified contact person ID does not exist: ${identifier}`,
);

export const ContactNotActiveError = createDomainError(
  "ContactNotActiveError", "BUSINESS_PARTNER_CONTACT_NOT_ACTIVE",
  (identifier: string) => `Contact person is not in ACTIVE status and cannot be deleted: ${identifier}`,
);

export const ContactIsPrimaryError = createDomainError(
  "ContactIsPrimaryError", "BUSINESS_PARTNER_CONTACT_IS_PRIMARY",
  (identifier: string) => `Contact person is currently the primary contact and cannot be deleted: ${identifier}`,
);

export const AddressNotFoundError = createDomainError(
  "AddressNotFoundError", "BUSINESS_PARTNER_ADDRESS_NOT_FOUND",
  (identifier: string) => `Specified address ID does not exist: ${identifier}`,
);

export const AddressInUseError = createDomainError(
  "AddressInUseError", "BUSINESS_PARTNER_ADDRESS_IN_USE",
  (identifier: string) => `Address is referenced on existing transactions and cannot be deleted: ${identifier}`,
);

export const BankAccountNotFoundError = createDomainError(
  "BankAccountNotFoundError", "BUSINESS_PARTNER_BANK_ACCOUNT_NOT_FOUND",
  (identifier: string) => `Specified bank account ID does not exist: ${identifier}`,
);

export const IdentificationNotFoundError = createDomainError(
  "IdentificationNotFoundError", "BUSINESS_PARTNER_IDENTIFICATION_NOT_FOUND",
  (identifier: string) => `Specified identification ID does not exist: ${identifier}`,
);

export const NoDefaultAddressError = createDomainError(
  "NoDefaultAddressError", "BUSINESS_PARTNER_NO_DEFAULT_ADDRESS",
  (identifier: string) => `Addresses of the requested type exist for the partner, but none is marked as default — the caller must set a default or select an address explicitly: ${identifier}`,
);

export const NoAddressOfTypeError = createDomainError(
  "NoAddressOfTypeError", "BUSINESS_PARTNER_NO_ADDRESS_OF_TYPE",
  (identifier: string) => `The partner has no addresses of the requested address type: ${identifier}`,
);

export const RoleNotFoundError = createDomainError(
  "RoleNotFoundError", "BUSINESS_PARTNER_ROLE_NOT_FOUND",
  (identifier: string) => `No role assignment matches the given partnerId and role — caller receives null: ${identifier}`,
);
