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

export const UserNotFoundError = createDomainError(
  "UserNotFoundError", "USER_MANAGEMENT_USER_NOT_FOUND",
  (identifier: string) => `User ID does not exist in the system - return not found error with the provided ID: ${identifier}`,
);

export const InvalidStatusTransitionError = createDomainError(
  "InvalidStatusTransitionError", "USER_MANAGEMENT_INVALID_STATUS_TRANSITION",
  (identifier: string) => `User is not in PENDING status (already ACTIVE or INACTIVE) - return error with current status and valid transitions: ${identifier}`,
);

export const RoleNotFoundError = createDomainError(
  "RoleNotFoundError", "USER_MANAGEMENT_ROLE_NOT_FOUND",
  (identifier: string) => `Role ID does not exist in the system - return not found error with the provided role ID: ${identifier}`,
);

export const PermissionNotFoundError = createDomainError(
  "PermissionNotFoundError", "USER_MANAGEMENT_PERMISSION_NOT_FOUND",
  (identifier: string) => `Permission ID does not exist in the system - return not found error with the provided permission ID: ${identifier}`,
);

export const UserNotActiveError = createDomainError(
  "UserNotActiveError", "USER_MANAGEMENT_USER_NOT_ACTIVE",
  (identifier: string) => `User is in PENDING or INACTIVE status - return error indicating only ACTIVE users can receive role assignments: ${identifier}`,
);

export const InvalidPermissionKeyFormatError = createDomainError(
  "InvalidPermissionKeyFormatError", "USER_MANAGEMENT_INVALID_PERMISSION_KEY_FORMAT",
  (identifier: string) => `Key does not match resource:action pattern: ${identifier}`,
);

export const DuplicatePermissionKeyError = createDomainError(
  "DuplicatePermissionKeyError", "USER_MANAGEMENT_DUPLICATE_PERMISSION_KEY",
  (identifier: string) => `Permission with the same key already exists: ${identifier}`,
);

export const MissingRequiredFieldError = createDomainError(
  "MissingRequiredFieldError", "USER_MANAGEMENT_MISSING_REQUIRED_FIELD",
  (identifier: string) => `Role name not provided - return validation error indicating name is required: ${identifier}`,
);

export const DuplicateRoleNameError = createDomainError(
  "DuplicateRoleNameError", "USER_MANAGEMENT_DUPLICATE_ROLE_NAME",
  (identifier: string) => `Role with the same name already exists: ${identifier}`,
);

export const UserAlreadyExistsError = createDomainError(
  "UserAlreadyExistsError", "USER_MANAGEMENT_USER_ALREADY_EXISTS",
  (identifier: string) => `Email address is already registered in the system - return conflict error with message indicating email is taken: ${identifier}`,
);

export const InvalidEmailError = createDomainError(
  "InvalidEmailError", "USER_MANAGEMENT_INVALID_EMAIL",
  (identifier: string) => `Email does not follow valid email format - return validation error with format requirements: ${identifier}`,
);

export const AssignmentNotFoundError = createDomainError(
  "AssignmentNotFoundError", "USER_MANAGEMENT_ASSIGNMENT_NOT_FOUND",
  (identifier: string) => `Role does not have this permission assigned - return not found error indicating the association does not exist: ${identifier}`,
);

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