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

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

export const LabelNotFoundError = createDomainError(
  "LabelNotFoundError", "PIPELINE_MANAGEMENT_LABEL_NOT_FOUND",
  (identifier: string) => `Specified label ID does not exist: ${identifier}`,
);

export const LabelNotOnItemPipelineError = createDomainError(
  "LabelNotOnItemPipelineError", "PIPELINE_MANAGEMENT_LABEL_NOT_ON_ITEM_PIPELINE",
  (identifier: string) => `PipelineLabel belongs to a different pipeline than the item: ${identifier}`,
);

export const LabelAlreadyAttachedError = createDomainError(
  "LabelAlreadyAttachedError", "PIPELINE_MANAGEMENT_LABEL_ALREADY_ATTACHED",
  (identifier: string) => `The label is already attached to the item: ${identifier}`,
);

export const ItemNotOpenError = createDomainError(
  "ItemNotOpenError", "PIPELINE_MANAGEMENT_ITEM_NOT_OPEN",
  (identifier: string) => `PipelineItem is not in OPEN lifecycle (it is DRAFT or CLOSED): ${identifier}`,
);

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

export const InvalidPipelineTypeError = createDomainError(
  "InvalidPipelineTypeError", "PIPELINE_MANAGEMENT_INVALID_PIPELINE_TYPE",
  (identifier: string) => `pipelineType is empty, or not part of the vocabulary injected via defineModule({ pipelineTypes }): ${identifier}`,
);

export const InvalidCategoryError = createDomainError(
  "InvalidCategoryError", "PIPELINE_MANAGEMENT_INVALID_CATEGORY",
  (identifier: string) => `Provided category is not a valid enum value: ${identifier}`,
);

export const UserNotFoundError = createDomainError(
  "UserNotFoundError", "PIPELINE_MANAGEMENT_USER_NOT_FOUND",
  (identifier: string) => `Specified user ID does not exist in the user-management module: ${identifier}`,
);

export const DuplicatePipelineNameError = createDomainError(
  "DuplicatePipelineNameError", "PIPELINE_MANAGEMENT_DUPLICATE_PIPELINE_NAME",
  (identifier: string) => `A pipeline with the same name and pipelineType already exists. Skipped for locked pipelines (managed board; identity is owned by the managing module).: ${identifier}`,
);

export const PipelineNotFoundError = createDomainError(
  "PipelineNotFoundError", "PIPELINE_MANAGEMENT_PIPELINE_NOT_FOUND",
  (identifier: string) => `Specified pipeline ID does not exist: ${identifier}`,
);

export const PipelineArchivedError = createDomainError(
  "PipelineArchivedError", "PIPELINE_MANAGEMENT_PIPELINE_ARCHIVED",
  (identifier: string) => `Pipeline is archived: ${identifier}`,
);

export const InvalidTitleError = createDomainError(
  "InvalidTitleError", "PIPELINE_MANAGEMENT_INVALID_TITLE",
  (identifier: string) => `PipelineItem title is empty or blank: ${identifier}`,
);

export const InvalidPriorityError = createDomainError(
  "InvalidPriorityError", "PIPELINE_MANAGEMENT_INVALID_PRIORITY",
  (identifier: string) => `Provided priority is not a valid enum value: ${identifier}`,
);

export const StageNotFoundError = createDomainError(
  "StageNotFoundError", "PIPELINE_MANAGEMENT_STAGE_NOT_FOUND",
  (identifier: string) => `Specified stage ID does not exist: ${identifier}`,
);

export const InvalidBodyError = createDomainError(
  "InvalidBodyError", "PIPELINE_MANAGEMENT_INVALID_BODY",
  (identifier: string) => `Body is empty: ${identifier}`,
);

export const DuplicateLabelNameError = createDomainError(
  "DuplicateLabelNameError", "PIPELINE_MANAGEMENT_DUPLICATE_LABEL_NAME",
  (identifier: string) => `A label with the same name already exists on the pipeline: ${identifier}`,
);

export const PipelineLockedError = createDomainError(
  "PipelineLockedError", "PIPELINE_MANAGEMENT_PIPELINE_LOCKED",
  (identifier: string) => `Locked pipeline lanes are fixed to the template seeded at creation and cannot be modified: ${identifier}`,
);

export const DuplicateStageNameError = createDomainError(
  "DuplicateStageNameError", "PIPELINE_MANAGEMENT_DUPLICATE_STAGE_NAME",
  (identifier: string) => `A stage with the same name already exists on the pipeline: ${identifier}`,
);

export const InvalidStatusTransitionError = createDomainError(
  "InvalidStatusTransitionError", "PIPELINE_MANAGEMENT_INVALID_STATUS_TRANSITION",
  (identifier: string) => `Pipeline is in a status that cannot transition to ARCHIVED (not ACTIVE or ARCHIVED): ${identifier}`,
);

export const CommentNotFoundError = createDomainError(
  "CommentNotFoundError", "PIPELINE_MANAGEMENT_COMMENT_NOT_FOUND",
  (identifier: string) => `Specified comment ID does not exist: ${identifier}`,
);

export const ForbiddenError = createDomainError(
  "ForbiddenError", "PIPELINE_MANAGEMENT_FORBIDDEN",
  (identifier: string) => `Calling user is not the original author: ${identifier}`,
);

export const StageHasItemsError = createDomainError(
  "StageHasItemsError", "PIPELINE_MANAGEMENT_STAGE_HAS_ITEMS",
  (identifier: string) => `PipelineStage still contains items and cannot be deleted: ${identifier}`,
);

export const LabelNotAttachedError = createDomainError(
  "LabelNotAttachedError", "PIPELINE_MANAGEMENT_LABEL_NOT_ATTACHED",
  (identifier: string) => `The label is not attached to the item: ${identifier}`,
);

export const StageNotOnPipelineError = createDomainError(
  "StageNotOnPipelineError", "PIPELINE_MANAGEMENT_STAGE_NOT_ON_PIPELINE",
  (identifier: string) => `Target stage is not on the same pipeline as the item: ${identifier}`,
);

export const SameStageError = createDomainError(
  "SameStageError", "PIPELINE_MANAGEMENT_SAME_STAGE",
  (identifier: string) => `Target stage is the same as the item's current stage: ${identifier}`,
);

export const ItemNotDraftError = createDomainError(
  "ItemNotDraftError", "PIPELINE_MANAGEMENT_ITEM_NOT_DRAFT",
  (identifier: string) => `PipelineItem is not in DRAFT lifecycle: ${identifier}`,
);

export const ItemNotClosedError = createDomainError(
  "ItemNotClosedError", "PIPELINE_MANAGEMENT_ITEM_NOT_CLOSED",
  (identifier: string) => `PipelineItem is not in CLOSED lifecycle: ${identifier}`,
);

export const ItemClosedError = createDomainError(
  "ItemClosedError", "PIPELINE_MANAGEMENT_ITEM_CLOSED",
  (identifier: string) => `PipelineItem is closed and cannot be updated: ${identifier}`,
);
