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

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

export const InvalidStateError = createDomainError(
  "InvalidStateError", "ORGANIZATION_INVALID_STATE",
  (identifier: string) => `Entity is not in the expected status: ${identifier}`,
);

export const MissingRequiredFieldsError = createDomainError(
  "MissingRequiredFieldsError", "ORGANIZATION_MISSING_REQUIRED_FIELDS",
  (identifier: string) => `One or more required fields are not set: ${identifier}`,
);

export const InvalidBaseCurrencyError = createDomainError(
  "InvalidBaseCurrencyError", "ORGANIZATION_INVALID_BASE_CURRENCY",
  (identifier: string) => `The assigned base currency does not exist or is not in active status in the primitives module: ${identifier}`,
);

export const InvalidLegalNameError = createDomainError(
  "InvalidLegalNameError", "ORGANIZATION_INVALID_LEGAL_NAME",
  (identifier: string) => `Legal name is empty or not provided: ${identifier}`,
);

export const CurrencyNotFoundError = createDomainError(
  "CurrencyNotFoundError", "ORGANIZATION_CURRENCY_NOT_FOUND",
  (identifier: string) => `Referenced base currency does not exist or is inactive: ${identifier}`,
);

export const InvalidCodeError = createDomainError(
  "InvalidCodeError", "ORGANIZATION_INVALID_CODE",
  (identifier: string) => `Department code is empty or not provided: ${identifier}`,
);

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

export const DuplicateCodeError = createDomainError(
  "DuplicateCodeError", "ORGANIZATION_DUPLICATE_CODE",
  (identifier: string) => `Department with same code already exists in the same company: ${identifier}`,
);

export const ParentNotFoundError = createDomainError(
  "ParentNotFoundError", "ORGANIZATION_PARENT_NOT_FOUND",
  (identifier: string) => `Referenced parent department does not exist or belongs to a different company: ${identifier}`,
);

export const InvalidTypeError = createDomainError(
  "InvalidTypeError", "ORGANIZATION_INVALID_TYPE",
  (identifier: string) => `Site type is not one of the allowed classifications: ${identifier}`,
);

export const CompanyInactiveError = createDomainError(
  "CompanyInactiveError", "ORGANIZATION_COMPANY_INACTIVE",
  (identifier: string) => `Referenced company is not in ACTIVE status: ${identifier}`,
);

export const DuplicateNameError = createDomainError(
  "DuplicateNameError", "ORGANIZATION_DUPLICATE_NAME",
  (identifier: string) => `Site with same name already exists in the same company: ${identifier}`,
);

export const InvalidCountryError = createDomainError(
  "InvalidCountryError", "ORGANIZATION_INVALID_COUNTRY",
  (identifier: string) => `Country code is not a valid country code: ${identifier}`,
);

export const InvalidTimezoneError = createDomainError(
  "InvalidTimezoneError", "ORGANIZATION_INVALID_TIMEZONE",
  (identifier: string) => `Timezone is not a valid IANA timezone identifier: ${identifier}`,
);

export const DepartmentNotFoundError = createDomainError(
  "DepartmentNotFoundError", "ORGANIZATION_DEPARTMENT_NOT_FOUND",
  (identifier: string) => `Specified department ID does not exist: ${identifier}`,
);

export const HasActiveChildrenError = createDomainError(
  "HasActiveChildrenError", "ORGANIZATION_HAS_ACTIVE_CHILDREN",
  (identifier: string) => `Department has one or more active sub-departments: ${identifier}`,
);

export const SiteNotFoundError = createDomainError(
  "SiteNotFoundError", "ORGANIZATION_SITE_NOT_FOUND",
  (identifier: string) => `Specified site ID does not exist: ${identifier}`,
);

export const HasDepartmentsError = createDomainError(
  "HasDepartmentsError", "ORGANIZATION_HAS_DEPARTMENTS",
  (identifier: string) => `Company has existing departments that must be removed first: ${identifier}`,
);

export const HasSitesError = createDomainError(
  "HasSitesError", "ORGANIZATION_HAS_SITES",
  (identifier: string) => `Company has existing sites that must be removed first: ${identifier}`,
);

export const CurrencyImmutableError = createDomainError(
  "CurrencyImmutableError", "ORGANIZATION_CURRENCY_IMMUTABLE",
  (identifier: string) => `Attempted to change base currency on a non-DRAFT company: ${identifier}`,
);

export const SelfReferenceError = createDomainError(
  "SelfReferenceError", "ORGANIZATION_SELF_REFERENCE",
  (identifier: string) => `Department references itself as parent: ${identifier}`,
);

export const CircularReferenceError = createDomainError(
  "CircularReferenceError", "ORGANIZATION_CIRCULAR_REFERENCE",
  (identifier: string) => `Reparenting would create a circular hierarchy: ${identifier}`,
);
