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

export const CountLineNotFoundError = createDomainError(
  "CountLineNotFoundError", "INVENTORY_COUNT_LINE_NOT_FOUND",
  (identifier: string) => `Referenced count line does not exist: ${identifier}`,
);

export const CountLineNotPendingError = createDomainError(
  "CountLineNotPendingError", "INVENTORY_COUNT_LINE_NOT_PENDING",
  (identifier: string) => `Count line is not in PENDING status: ${identifier}`,
);

export const AdjustmentNotFoundError = createDomainError(
  "AdjustmentNotFoundError", "INVENTORY_ADJUSTMENT_NOT_FOUND",
  (identifier: string) => `Referenced adjustment does not exist: ${identifier}`,
);

export const AdjustmentNotPendingApprovalError = createDomainError(
  "AdjustmentNotPendingApprovalError", "INVENTORY_ADJUSTMENT_NOT_PENDING_APPROVAL",
  (identifier: string) => `Adjustment is not in PENDING_APPROVAL status: ${identifier}`,
);

export const ItemNotFoundError = createDomainError(
  "ItemNotFoundError", "INVENTORY_ITEM_NOT_FOUND",
  (identifier: string) => `Referenced item does not exist: ${identifier}`,
);

export const StorageLocationNotFoundError = createDomainError(
  "StorageLocationNotFoundError", "INVENTORY_STORAGE_LOCATION_NOT_FOUND",
  (identifier: string) => `Referenced storage location does not exist: ${identifier}`,
);

export const DuplicateSerialNumberError = createDomainError(
  "DuplicateSerialNumberError", "INVENTORY_DUPLICATE_SERIAL_NUMBER",
  (identifier: string) => `A serial number with the same value already exists for this item: ${identifier}`,
);

export const CountNotFoundError = createDomainError(
  "CountNotFoundError", "INVENTORY_COUNT_NOT_FOUND",
  (identifier: string) => `Referenced inventory count does not exist: ${identifier}`,
);

export const CountAlreadyCompletedError = createDomainError(
  "CountAlreadyCompletedError", "INVENTORY_COUNT_ALREADY_COMPLETED",
  (identifier: string) => `Inventory count has already been completed and cannot be cancelled: ${identifier}`,
);

export const CountAlreadyCancelledError = createDomainError(
  "CountAlreadyCancelledError", "INVENTORY_COUNT_ALREADY_CANCELLED",
  (identifier: string) => `Inventory count has already been cancelled: ${identifier}`,
);

export const StockMovementNotFoundError = createDomainError(
  "StockMovementNotFoundError", "INVENTORY_STOCK_MOVEMENT_NOT_FOUND",
  (identifier: string) => `Referenced stock movement does not exist: ${identifier}`,
);

export const StockMovementAlreadyDoneError = createDomainError(
  "StockMovementAlreadyDoneError", "INVENTORY_STOCK_MOVEMENT_ALREADY_DONE",
  (identifier: string) => `Stock movement has already been executed and cannot be cancelled: ${identifier}`,
);

export const StockMovementAlreadyCancelledError = createDomainError(
  "StockMovementAlreadyCancelledError", "INVENTORY_STOCK_MOVEMENT_ALREADY_CANCELLED",
  (identifier: string) => `Stock movement has already been cancelled: ${identifier}`,
);

export const CountNotInProgressError = createDomainError(
  "CountNotInProgressError", "INVENTORY_COUNT_NOT_IN_PROGRESS",
  (identifier: string) => `Count is not in IN_PROGRESS status: ${identifier}`,
);

export const UnresolvedCountLinesError = createDomainError(
  "UnresolvedCountLinesError", "INVENTORY_UNRESOLVED_COUNT_LINES",
  (identifier: string) => `One or more count lines are not in a terminal status (APPROVED or REJECTED): ${identifier}`,
);

export const AdjustmentInvalidStatusError = createDomainError(
  "AdjustmentInvalidStatusError", "INVENTORY_ADJUSTMENT_INVALID_STATUS",
  (identifier: string) => `Adjustment is not in DRAFT or APPROVED status: ${identifier}`,
);

export const InsufficientOnHandError = createDomainError(
  "InsufficientOnHandError", "INVENTORY_INSUFFICIENT_ON_HAND",
  (identifier: string) => `Negative adjustment would reduce on-hand below zero: ${identifier}`,
);

export const StockMovementNotDraftError = createDomainError(
  "StockMovementNotDraftError", "INVENTORY_STOCK_MOVEMENT_NOT_DRAFT",
  (identifier: string) => `Stock movement is not in DRAFT status: ${identifier}`,
);

export const ReasonCodeRequiredError = createDomainError(
  "ReasonCodeRequiredError", "INVENTORY_REASON_CODE_REQUIRED",
  (identifier: string) => `No reason code was provided: ${identifier}`,
);

export const ScrapQuantityMustBeNegativeError = createDomainError(
  "ScrapQuantityMustBeNegativeError", "INVENTORY_SCRAP_QUANTITY_MUST_BE_NEGATIVE",
  (identifier: string) => `SCRAP type adjustment must have a negative quantityDelta: ${identifier}`,
);

export const LotNotFoundError = createDomainError(
  "LotNotFoundError", "INVENTORY_LOT_NOT_FOUND",
  (identifier: string) => `Referenced lot does not exist: ${identifier}`,
);

export const SerialNumberNotFoundError = createDomainError(
  "SerialNumberNotFoundError", "INVENTORY_SERIAL_NUMBER_NOT_FOUND",
  (identifier: string) => `Referenced serial number does not exist: ${identifier}`,
);

export const WarehouseNotFoundError = createDomainError(
  "WarehouseNotFoundError", "INVENTORY_WAREHOUSE_NOT_FOUND",
  (identifier: string) => `Referenced warehouse does not exist: ${identifier}`,
);

export const InvalidCountTypeError = createDomainError(
  "InvalidCountTypeError", "INVENTORY_INVALID_COUNT_TYPE",
  (identifier: string) => `countType is not FULL or CYCLE: ${identifier}`,
);

export const DuplicateLotNumberError = createDomainError(
  "DuplicateLotNumberError", "INVENTORY_DUPLICATE_LOT_NUMBER",
  (identifier: string) => `A lot with the same number already exists for this item: ${identifier}`,
);

export const InvalidMovementTypeError = createDomainError(
  "InvalidMovementTypeError", "INVENTORY_INVALID_MOVEMENT_TYPE",
  (identifier: string) => `movementType is not a recognized value: ${identifier}`,
);

export const EmptyMoveLinesError = createDomainError(
  "EmptyMoveLinesError", "INVENTORY_EMPTY_MOVE_LINES",
  (identifier: string) => `No move lines were provided: ${identifier}`,
);

export const ItemNotActiveError = createDomainError(
  "ItemNotActiveError", "INVENTORY_ITEM_NOT_ACTIVE",
  (identifier: string) => `Referenced item is not in ACTIVE status: ${identifier}`,
);

export const InvalidQuantityError = createDomainError(
  "InvalidQuantityError", "INVENTORY_INVALID_QUANTITY",
  (identifier: string) => `Move line quantity is zero or negative: ${identifier}`,
);

export const SameSourceDestinationError = createDomainError(
  "SameSourceDestinationError", "INVENTORY_SAME_SOURCE_DESTINATION",
  (identifier: string) => `Source and destination locations are the same: ${identifier}`,
);

export const LotRequiredForTrackedItemError = createDomainError(
  "LotRequiredForTrackedItemError", "INVENTORY_LOT_REQUIRED_FOR_TRACKED_ITEM",
  (identifier: string) => `Move line references a lot-tracked item but no lotId was provided: ${identifier}`,
);

export const WarehouseInactiveError = createDomainError(
  "WarehouseInactiveError", "INVENTORY_WAREHOUSE_INACTIVE",
  (identifier: string) => `Referenced warehouse is not in ACTIVE status: ${identifier}`,
);

export const InvalidLocationTypeError = createDomainError(
  "InvalidLocationTypeError", "INVENTORY_INVALID_LOCATION_TYPE",
  (identifier: string) => `locationType is not 'zone' or 'bin': ${identifier}`,
);

export const ParentZoneNotFoundError = createDomainError(
  "ParentZoneNotFoundError", "INVENTORY_PARENT_ZONE_NOT_FOUND",
  (identifier: string) => `Bin's parent zone does not exist: ${identifier}`,
);

export const ParentNotAZoneError = createDomainError(
  "ParentNotAZoneError", "INVENTORY_PARENT_NOT_A_ZONE",
  (identifier: string) => `Parent location is a bin, not a zone: ${identifier}`,
);

export const ParentInDifferentWarehouseError = createDomainError(
  "ParentInDifferentWarehouseError", "INVENTORY_PARENT_IN_DIFFERENT_WAREHOUSE",
  (identifier: string) => `Parent zone belongs to a different warehouse: ${identifier}`,
);

export const DuplicateLocationNameError = createDomainError(
  "DuplicateLocationNameError", "INVENTORY_DUPLICATE_LOCATION_NAME",
  (identifier: string) => `A location with the same name or code already exists in the warehouse: ${identifier}`,
);

export const InvalidCostingMethodError = createDomainError(
  "InvalidCostingMethodError", "INVENTORY_INVALID_COSTING_METHOD",
  (identifier: string) => `costingMethod is not a recognized value (must be FIFO, AVCO, or STANDARD_COST): ${identifier}`,
);

export const StandardCostRateRequiredError = createDomainError(
  "StandardCostRateRequiredError", "INVENTORY_STANDARD_COST_RATE_REQUIRED",
  (identifier: string) => `costingMethod is STANDARD_COST but no standardCostRate was provided: ${identifier}`,
);

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

export const SiteInactiveError = createDomainError(
  "SiteInactiveError", "INVENTORY_SITE_INACTIVE",
  (identifier: string) => `Referenced site exists but is not in ACTIVE status: ${identifier}`,
);

export const DuplicateWarehouseNameError = createDomainError(
  "DuplicateWarehouseNameError", "INVENTORY_DUPLICATE_WAREHOUSE_NAME",
  (identifier: string) => `A warehouse with the same name already exists at the given site: ${identifier}`,
);

export const StorageLocationNotActiveError = createDomainError(
  "StorageLocationNotActiveError", "INVENTORY_STORAGE_LOCATION_NOT_ACTIVE",
  (identifier: string) => `Storage location is not in ACTIVE status: ${identifier}`,
);

export const WarehouseNotActiveError = createDomainError(
  "WarehouseNotActiveError", "INVENTORY_WAREHOUSE_NOT_ACTIVE",
  (identifier: string) => `Warehouse is not in ACTIVE status: ${identifier}`,
);

export const StockMovementNotConfirmedError = createDomainError(
  "StockMovementNotConfirmedError", "INVENTORY_STOCK_MOVEMENT_NOT_CONFIRMED",
  (identifier: string) => `Stock movement is not in CONFIRMED status: ${identifier}`,
);

export const InsufficientStockError = createDomainError(
  "InsufficientStockError", "INVENTORY_INSUFFICIENT_STOCK",
  (identifier: string) => `Source location does not have enough available stock for goods issue or block: ${identifier}`,
);

export const InsufficientBlockedStockError = createDomainError(
  "InsufficientBlockedStockError", "INVENTORY_INSUFFICIENT_BLOCKED_STOCK",
  (identifier: string) => `Source location does not have enough blocked stock for unblock: ${identifier}`,
);

export const LotStockInsufficientError = createDomainError(
  "LotStockInsufficientError", "INVENTORY_LOT_STOCK_INSUFFICIENT",
  (identifier: string) => `Lot does not have sufficient stock at the location: ${identifier}`,
);

export const SerialInvalidStateError = createDomainError(
  "SerialInvalidStateError", "INVENTORY_SERIAL_INVALID_STATE",
  (identifier: string) => `Serial number is not in a valid state for the movement type: ${identifier}`,
);

export const StorageLocationNotInactiveError = createDomainError(
  "StorageLocationNotInactiveError", "INVENTORY_STORAGE_LOCATION_NOT_INACTIVE",
  (identifier: string) => `Storage location is not in INACTIVE status: ${identifier}`,
);

export const WarehouseNotInactiveError = createDomainError(
  "WarehouseNotInactiveError", "INVENTORY_WAREHOUSE_NOT_INACTIVE",
  (identifier: string) => `Warehouse is not in INACTIVE status: ${identifier}`,
);

export const CountLineInvalidStatusError = createDomainError(
  "CountLineInvalidStatusError", "INVENTORY_COUNT_LINE_INVALID_STATUS",
  (identifier: string) => `Count line is not in PENDING, RECOUNT, or REJECTED status: ${identifier}`,
);

export const StockLevelNotFoundError = createDomainError(
  "StockLevelNotFoundError", "INVENTORY_STOCK_LEVEL_NOT_FOUND",
  (identifier: string) => `No stock level record exists for the item-location pair: ${identifier}`,
);

export const InsufficientReservedStockError = createDomainError(
  "InsufficientReservedStockError", "INVENTORY_INSUFFICIENT_RESERVED_STOCK",
  (identifier: string) => `Release amount exceeds the currently reserved quantity: ${identifier}`,
);

export const InsufficientAvailableStockError = createDomainError(
  "InsufficientAvailableStockError", "INVENTORY_INSUFFICIENT_AVAILABLE_STOCK",
  (identifier: string) => `Available stock is less than the requested reservation quantity: ${identifier}`,
);

export const AdjustmentNotRejectedError = createDomainError(
  "AdjustmentNotRejectedError", "INVENTORY_ADJUSTMENT_NOT_REJECTED",
  (identifier: string) => `Adjustment is not in REJECTED status: ${identifier}`,
);

export const CountNotPlannedError = createDomainError(
  "CountNotPlannedError", "INVENTORY_COUNT_NOT_PLANNED",
  (identifier: string) => `Count is not in PLANNED status: ${identifier}`,
);

export const AdjustmentNotDraftError = createDomainError(
  "AdjustmentNotDraftError", "INVENTORY_ADJUSTMENT_NOT_DRAFT",
  (identifier: string) => `Adjustment is not in DRAFT status: ${identifier}`,
);

export const LotFullyConsumedError = createDomainError(
  "LotFullyConsumedError", "INVENTORY_LOT_FULLY_CONSUMED",
  (identifier: string) => `Lot is in FULLY_CONSUMED status and cannot be updated: ${identifier}`,
);

export const ValuationPolicyNotFoundError = createDomainError(
  "ValuationPolicyNotFoundError", "INVENTORY_VALUATION_POLICY_NOT_FOUND",
  (identifier: string) => `Referenced valuation policy does not exist: ${identifier}`,
);

export const InventoryAdjustmentNotFoundError = createDomainError(
  "InventoryAdjustmentNotFoundError", "INVENTORY_INVENTORY_ADJUSTMENT_NOT_FOUND",
  (identifier: string) => `No adjustment matches the given id — caller receives null: ${identifier}`,
);

export const ItemValuationNotFoundError = createDomainError(
  "ItemValuationNotFoundError", "INVENTORY_ITEM_VALUATION_NOT_FOUND",
  (identifier: string) => `No valuation record exists for the specified item: ${identifier}`,
);

export const NoFilterProvidedError = createDomainError(
  "NoFilterProvidedError", "INVENTORY_NO_FILTER_PROVIDED",
  (identifier: string) => `At least one filter must be specified: ${identifier}`,
);
