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

export const UomCategoryNotFoundError = createDomainError(
  "UomCategoryNotFoundError", "PRIMITIVES_UOM_CATEGORY_NOT_FOUND",
  (identifier: string) => `Specified category ID does not exist: ${identifier}`,
);

export const CurrencyNotFoundError = createDomainError(
  "CurrencyNotFoundError", "PRIMITIVES_CURRENCY_NOT_FOUND",
  (identifier: string) => `Specified currency ID does not exist: ${identifier}`,
);

export const UnitNotFoundError = createDomainError(
  "UnitNotFoundError", "PRIMITIVES_UNIT_NOT_FOUND",
  (identifier: string) => `Specified unit ID does not exist: ${identifier}`,
);

export const DuplicateCategoryNameError = createDomainError(
  "DuplicateCategoryNameError", "PRIMITIVES_DUPLICATE_CATEGORY_NAME",
  (identifier: string) => `Category with same name already exists: ${identifier}`,
);

export const InvalidIsoCodeError = createDomainError(
  "InvalidIsoCodeError", "PRIMITIVES_INVALID_ISO_CODE",
  (identifier: string) => `Code is not exactly 3 uppercase letters: ${identifier}`,
);

export const DuplicateCurrencyCodeError = createDomainError(
  "DuplicateCurrencyCodeError", "PRIMITIVES_DUPLICATE_CURRENCY_CODE",
  (identifier: string) => `Currency with same code already exists: ${identifier}`,
);

export const InvalidDecimalPlacesError = createDomainError(
  "InvalidDecimalPlacesError", "PRIMITIVES_INVALID_DECIMAL_PLACES",
  (identifier: string) => `Value is negative or exceeds maximum (typically 4): ${identifier}`,
);

export const InactiveCurrencyError = createDomainError(
  "InactiveCurrencyError", "PRIMITIVES_INACTIVE_CURRENCY",
  (identifier: string) => `Source or target currency is inactive: ${identifier}`,
);

export const SameCurrencyPairError = createDomainError(
  "SameCurrencyPairError", "PRIMITIVES_SAME_CURRENCY_PAIR",
  (identifier: string) => `Source and target currencies are the same: ${identifier}`,
);

export const InvalidExchangeRateError = createDomainError(
  "InvalidExchangeRateError", "PRIMITIVES_INVALID_EXCHANGE_RATE",
  (identifier: string) => `Rate is zero, negative, or not a valid number: ${identifier}`,
);

export const CategoryNotActiveError = createDomainError(
  "CategoryNotActiveError", "PRIMITIVES_CATEGORY_NOT_ACTIVE",
  (identifier: string) => `Category is inactive: ${identifier}`,
);

export const DuplicateUnitSymbolError = createDomainError(
  "DuplicateUnitSymbolError", "PRIMITIVES_DUPLICATE_UNIT_SYMBOL",
  (identifier: string) => `Unit with same symbol already exists in category: ${identifier}`,
);

export const InvalidConversionFactorError = createDomainError(
  "InvalidConversionFactorError", "PRIMITIVES_INVALID_CONVERSION_FACTOR",
  (identifier: string) => `Factor is zero, negative, or not a valid number: ${identifier}`,
);

export const InvalidRoundingPrecisionError = createDomainError(
  "InvalidRoundingPrecisionError", "PRIMITIVES_INVALID_ROUNDING_PRECISION",
  (identifier: string) => `Precision is negative: ${identifier}`,
);

export const CategoryHasActiveUnitsError = createDomainError(
  "CategoryHasActiveUnitsError", "PRIMITIVES_CATEGORY_HAS_ACTIVE_UNITS",
  (identifier: string) => `Category still contains active units that must be deactivated first: ${identifier}`,
);

export const CannotDeactivateBaseCurrencyError = createDomainError(
  "CannotDeactivateBaseCurrencyError", "PRIMITIVES_CANNOT_DEACTIVATE_BASE_CURRENCY",
  (identifier: string) => `Attempting to deactivate the base currency, must change base currency first: ${identifier}`,
);

export const CannotDeactivateReferenceUnitError = createDomainError(
  "CannotDeactivateReferenceUnitError", "PRIMITIVES_CANNOT_DEACTIVATE_REFERENCE_UNIT",
  (identifier: string) => `Attempting to deactivate the category's reference unit, must change reference unit first: ${identifier}`,
);

export const CannotSetInactiveAsBaseCurrencyError = createDomainError(
  "CannotSetInactiveAsBaseCurrencyError", "PRIMITIVES_CANNOT_SET_INACTIVE_AS_BASE_CURRENCY",
  (identifier: string) => `Target currency is not in Active status, must be activated first: ${identifier}`,
);

export const UnitNotInCategoryError = createDomainError(
  "UnitNotInCategoryError", "PRIMITIVES_UNIT_NOT_IN_CATEGORY",
  (identifier: string) => `Unit belongs to a different category than specified: ${identifier}`,
);

export const ExchangeRateNotFoundError = createDomainError(
  "ExchangeRateNotFoundError", "PRIMITIVES_EXCHANGE_RATE_NOT_FOUND",
  (identifier: string) => `No rate found for the currency pair on or before the specified date: ${identifier}`,
);

export const IncompatibleUnitsError = createDomainError(
  "IncompatibleUnitsError", "PRIMITIVES_INCOMPATIBLE_UNITS",
  (identifier: string) => `Source and target units belong to different categories: ${identifier}`,
);

export const InactiveUnitError = createDomainError(
  "InactiveUnitError", "PRIMITIVES_INACTIVE_UNIT",
  (identifier: string) => `Either source or target unit is inactive: ${identifier}`,
);

export const SetBaseCurrencyDeprecatedError = createDomainError(
  "SetBaseCurrencyDeprecatedError", "PRIMITIVES_SET_BASE_CURRENCY_DEPRECATED",
  (_identifier: string) => `SetBaseCurrency is deprecated; use the organization module's company-level base currency assignment`,
);
