// @generated — do not edit import { createDomainError } from "@tailor-platform/erp-kit/core"; export const PositionNotFoundError = createDomainError( "PositionNotFoundError", "WORKFORCE_POSITION_NOT_FOUND", (identifier: string) => `the specified Position does not exist: ${identifier}`, ); export const PositionAlreadyAbolishedError = createDomainError( "PositionAlreadyAbolishedError", "WORKFORCE_POSITION_ALREADY_ABOLISHED", (identifier: string) => `the Position's current generation is already closed: ${identifier}`, ); export const PositionHasOpenAssignmentError = createDomainError( "PositionHasOpenAssignmentError", "WORKFORCE_POSITION_HAS_OPEN_ASSIGNMENT", (identifier: string) => `an open Assignment still references the Position and must be closed first: ${identifier}`, ); export const DuplicateAppointmentTypeKeyError = createDomainError( "DuplicateAppointmentTypeKeyError", "WORKFORCE_DUPLICATE_APPOINTMENT_TYPE_KEY", (identifier: string) => `an appointment type with the given key already exists in the company: ${identifier}`, ); export const EmploymentNotFoundError = createDomainError( "EmploymentNotFoundError", "WORKFORCE_EMPLOYMENT_NOT_FOUND", (identifier: string) => `the specified WorkerEmployment does not exist: ${identifier}`, ); export const EmploymentTerminatedError = createDomainError( "EmploymentTerminatedError", "WORKFORCE_EMPLOYMENT_TERMINATED", (identifier: string) => `the WorkerEmployment has been terminated and cannot receive a new assignment: ${identifier}`, ); export const OutsideEmploymentRangeError = createDomainError( "OutsideEmploymentRangeError", "WORKFORCE_OUTSIDE_EMPLOYMENT_RANGE", (identifier: string) => `the effective date falls outside the employment's effective range: ${identifier}`, ); export const PositionNotEffectiveError = createDomainError( "PositionNotEffectiveError", "WORKFORCE_POSITION_NOT_EFFECTIVE", (identifier: string) => `the Position is not effective on the given effective date: ${identifier}`, ); export const PositionHeadcountExceededError = createDomainError( "PositionHeadcountExceededError", "WORKFORCE_POSITION_HEADCOUNT_EXCEEDED", (identifier: string) => `the Position's headcount would be exceeded: ${identifier}`, ); export const DuplicatePrimaryAssignmentError = createDomainError( "DuplicatePrimaryAssignmentError", "WORKFORCE_DUPLICATE_PRIMARY_ASSIGNMENT", (identifier: string) => `the employment already has an open primary Assignment: ${identifier}`, ); export const DuplicateEmploymentTypeKeyError = createDomainError( "DuplicateEmploymentTypeKeyError", "WORKFORCE_DUPLICATE_EMPLOYMENT_TYPE_KEY", (identifier: string) => `an employment type with the given key already exists in the company: ${identifier}`, ); export const DuplicateJobProfileCodeError = createDomainError( "DuplicateJobProfileCodeError", "WORKFORCE_DUPLICATE_JOB_PROFILE_CODE", (identifier: string) => `code already exists on another JobProfile: ${identifier}`, ); export const InvalidGradeReferenceError = createDomainError( "InvalidGradeReferenceError", "WORKFORCE_INVALID_GRADE_REFERENCE", (identifier: string) => `the referenced grade does not exist or is invalid: ${identifier}`, ); export const DepartmentNotFoundError = createDomainError( "DepartmentNotFoundError", "WORKFORCE_DEPARTMENT_NOT_FOUND", (identifier: string) => `the specified Department does not exist: ${identifier}`, ); export const SiteNotFoundError = createDomainError( "SiteNotFoundError", "WORKFORCE_SITE_NOT_FOUND", (identifier: string) => `the specified Site does not exist: ${identifier}`, ); export const JobProfileNotFoundError = createDomainError( "JobProfileNotFoundError", "WORKFORCE_JOB_PROFILE_NOT_FOUND", (identifier: string) => `the specified JobProfile does not exist: ${identifier}`, ); export const InvalidHeadcountError = createDomainError( "InvalidHeadcountError", "WORKFORCE_INVALID_HEADCOUNT", (identifier: string) => `headcount is less than 1: ${identifier}`, ); export const DuplicateWorkRegimeKeyError = createDomainError( "DuplicateWorkRegimeKeyError", "WORKFORCE_DUPLICATE_WORK_REGIME_KEY", (identifier: string) => `a work regime with the given key already exists in the company: ${identifier}`, ); export const AssignmentNotEffectiveError = createDomainError( "AssignmentNotEffectiveError", "WORKFORCE_ASSIGNMENT_NOT_EFFECTIVE", (identifier: string) => `the referenced Assignment does not exist or is not effective on the relevant date: ${identifier}`, ); export const MissingRequiredFieldError = createDomainError( "MissingRequiredFieldError", "WORKFORCE_MISSING_REQUIRED_FIELD", (identifier: string) => `a required field is missing: ${identifier}`, ); export const NegativeMinutesError = createDomainError( "NegativeMinutesError", "WORKFORCE_NEGATIVE_MINUTES", (identifier: string) => `scheduledDailyMinutes or scheduledWeeklyMinutes is negative: ${identifier}`, ); export const WorkScheduleAlreadyExistsError = createDomainError( "WorkScheduleAlreadyExistsError", "WORKFORCE_WORK_SCHEDULE_ALREADY_EXISTS", (identifier: string) => `a generation already exists whose range overlaps the new open-ended generation: ${identifier}`, ); export const UserNotFoundError = createDomainError( "UserNotFoundError", "WORKFORCE_USER_NOT_FOUND", (identifier: string) => `the specified user-management User does not exist: ${identifier}`, ); export const WorkerAlreadyExistsError = createDomainError( "WorkerAlreadyExistsError", "WORKFORCE_WORKER_ALREADY_EXISTS", (identifier: string) => `the specified User already has a linked Worker: ${identifier}`, ); export const WorkerCodeTakenError = createDomainError( "WorkerCodeTakenError", "WORKFORCE_WORKER_CODE_TAKEN", (identifier: string) => `workerCode is already in use by another Worker: ${identifier}`, ); export const WorkerNotFoundError = createDomainError( "WorkerNotFoundError", "WORKFORCE_WORKER_NOT_FOUND", (identifier: string) => `the specified Worker does not exist: ${identifier}`, ); export const CompanyNotFoundError = createDomainError( "CompanyNotFoundError", "WORKFORCE_COMPANY_NOT_FOUND", (identifier: string) => `the specified organization Company does not exist: ${identifier}`, ); export const InvalidEmploymentTypeReferenceError = createDomainError( "InvalidEmploymentTypeReferenceError", "WORKFORCE_INVALID_EMPLOYMENT_TYPE_REFERENCE", (identifier: string) => `employmentTypeId does not reference an ACTIVE EmploymentType in this Company: ${identifier}`, ); export const InvalidWorkRegimeReferenceError = createDomainError( "InvalidWorkRegimeReferenceError", "WORKFORCE_INVALID_WORK_REGIME_REFERENCE", (identifier: string) => `workRegimeId does not reference an ACTIVE WorkRegime in this Company: ${identifier}`, ); export const EffectiveDateOverlapsExistingGenerationError = createDomainError( "EffectiveDateOverlapsExistingGenerationError", "WORKFORCE_EFFECTIVE_DATE_OVERLAPS_EXISTING_GENERATION", (identifier: string) => `an open generation already exists for this Worker/Company pair: ${identifier}`, ); export const AppointmentTypeNotFoundError = createDomainError( "AppointmentTypeNotFoundError", "WORKFORCE_APPOINTMENT_TYPE_NOT_FOUND", (identifier: string) => `no AppointmentType exists for the given id: ${identifier}`, ); export const InvalidAppointmentTypeStatusError = createDomainError( "InvalidAppointmentTypeStatusError", "WORKFORCE_INVALID_APPOINTMENT_TYPE_STATUS", (identifier: string) => `the appointment type is not in a status that allows this transition: ${identifier}`, ); export const EmploymentTypeNotFoundError = createDomainError( "EmploymentTypeNotFoundError", "WORKFORCE_EMPLOYMENT_TYPE_NOT_FOUND", (identifier: string) => `no EmploymentType exists for the given id: ${identifier}`, ); export const InvalidEmploymentTypeStatusError = createDomainError( "InvalidEmploymentTypeStatusError", "WORKFORCE_INVALID_EMPLOYMENT_TYPE_STATUS", (identifier: string) => `the employment type is not in a status that allows this transition: ${identifier}`, ); export const WorkRegimeNotFoundError = createDomainError( "WorkRegimeNotFoundError", "WORKFORCE_WORK_REGIME_NOT_FOUND", (identifier: string) => `no WorkRegime exists for the given id: ${identifier}`, ); export const InvalidWorkRegimeStatusError = createDomainError( "InvalidWorkRegimeStatusError", "WORKFORCE_INVALID_WORK_REGIME_STATUS", (identifier: string) => `the work regime is not in a status that allows this transition: ${identifier}`, ); export const JobProfileInUseError = createDomainError( "JobProfileInUseError", "WORKFORCE_JOB_PROFILE_IN_USE", (identifier: string) => `the JobProfile is referenced by at least one Position: ${identifier}`, ); export const AssignmentNotFoundError = createDomainError( "AssignmentNotFoundError", "WORKFORCE_ASSIGNMENT_NOT_FOUND", (identifier: string) => `the specified Assignment does not exist: ${identifier}`, ); export const AssignmentAlreadyClosedError = createDomainError( "AssignmentAlreadyClosedError", "WORKFORCE_ASSIGNMENT_ALREADY_CLOSED", (identifier: string) => `the Assignment generation is already closed: ${identifier}`, ); export const EndDateBeforeEffectiveStartError = createDomainError( "EndDateBeforeEffectiveStartError", "WORKFORCE_END_DATE_BEFORE_EFFECTIVE_START", (identifier: string) => `the end date precedes the generation's effectiveStart: ${identifier}`, ); export const WorkScheduleNotFoundError = createDomainError( "WorkScheduleNotFoundError", "WORKFORCE_WORK_SCHEDULE_NOT_FOUND", (identifier: string) => `no current WorkSchedule generation exists for the given assignment: ${identifier}`, ); export const InvalidEffectiveDateError = createDomainError( "InvalidEffectiveDateError", "WORKFORCE_INVALID_EFFECTIVE_DATE", (identifier: string) => `the effective date is not after the current generation's effectiveStart: ${identifier}`, ); export const WorkScheduleAlreadyClosedError = createDomainError( "WorkScheduleAlreadyClosedError", "WORKFORCE_WORK_SCHEDULE_ALREADY_CLOSED", (identifier: string) => `The current generation already has a non-null effectiveEnd: ${identifier}`, ); export const EmploymentWorkerMismatchError = createDomainError( "EmploymentWorkerMismatchError", "WORKFORCE_EMPLOYMENT_WORKER_MISMATCH", (identifier: string) => `the specified WorkerEmployment does not belong to the specified Worker: ${identifier}`, ); export const AssignmentEmploymentMismatchError = createDomainError( "AssignmentEmploymentMismatchError", "WORKFORCE_ASSIGNMENT_EMPLOYMENT_MISMATCH", (identifier: string) => `the target Assignment (CHANGE/END) does not belong to the specified WorkerEmployment: ${identifier}`, ); export const FromPositionMismatchError = createDomainError( "FromPositionMismatchError", "WORKFORCE_FROM_POSITION_MISMATCH", (identifier: string) => `fromPositionId does not match the target Assignment's current Position: ${identifier}`, ); export const InvalidAppointmentTypeReferenceError = createDomainError( "InvalidAppointmentTypeReferenceError", "WORKFORCE_INVALID_APPOINTMENT_TYPE_REFERENCE", (identifier: string) => `appointmentTypeId does not reference an ACTIVE AppointmentType in the employment's company: ${identifier}`, ); export const MissingToPositionError = createDomainError( "MissingToPositionError", "WORKFORCE_MISSING_TO_POSITION", (identifier: string) => `a CREATE_PRIMARY_ASSIGNMENT/CREATE_SECONDARY_ASSIGNMENT/CHANGE_ASSIGNMENT appointment is missing its required to-Position: ${identifier}`, ); export const MissingFromPositionError = createDomainError( "MissingFromPositionError", "WORKFORCE_MISSING_FROM_POSITION", (identifier: string) => `a CHANGE_ASSIGNMENT appointment is missing its required from-Position: ${identifier}`, ); export const WorkerEmploymentNotFoundError = createDomainError( "WorkerEmploymentNotFoundError", "WORKFORCE_WORKER_EMPLOYMENT_NOT_FOUND", (identifier: string) => `the specified WorkerEmployment does not exist: ${identifier}`, ); export const AlreadyTerminatedError = createDomainError( "AlreadyTerminatedError", "WORKFORCE_ALREADY_TERMINATED", (identifier: string) => `the employment has no open generation to terminate: ${identifier}`, ); export const TerminationDateBeforeEffectiveStartError = createDomainError( "TerminationDateBeforeEffectiveStartError", "WORKFORCE_TERMINATION_DATE_BEFORE_EFFECTIVE_START", (identifier: string) => `the termination date precedes the current generation's effectiveStart: ${identifier}`, ); export const TransferDateBeforeCurrentGenerationStartError = createDomainError( "TransferDateBeforeCurrentGenerationStartError", "WORKFORCE_TRANSFER_DATE_BEFORE_CURRENT_GENERATION_START", (identifier: string) => `the transfer's effective date does not come after the current generation's start: ${identifier}`, ); export const AppointmentTypeActionImmutableError = createDomainError( "AppointmentTypeActionImmutableError", "WORKFORCE_APPOINTMENT_TYPE_ACTION_IMMUTABLE", (identifier: string) => `the action cannot be changed because the appointment type is already referenced by recorded appointment history: ${identifier}`, ); export const HeadcountBelowCurrentOccupancyError = createDomainError( "HeadcountBelowCurrentOccupancyError", "WORKFORCE_HEADCOUNT_BELOW_CURRENT_OCCUPANCY", (identifier: string) => `the new headcount is below the number of current open primary Assignments: ${identifier}`, ); export const EffectiveStartNotAdvancingError = createDomainError( "EffectiveStartNotAdvancingError", "WORKFORCE_EFFECTIVE_START_NOT_ADVANCING", (identifier: string) => `the target generation is already closed, or the change date does not fall strictly after the current generation's effectiveStart: ${identifier}`, ); export const AppointmentNotFoundError = createDomainError( "AppointmentNotFoundError", "WORKFORCE_APPOINTMENT_NOT_FOUND", (identifier: string) => `no AppointmentHistory entry exists for the given id: ${identifier}`, ); export const InvalidDateError = createDomainError( "InvalidDateError", "WORKFORCE_INVALID_DATE", (identifier: string) => `the asOf parameter is not a valid date: ${identifier}`, ); export const InvalidPaginationError = createDomainError( "InvalidPaginationError", "WORKFORCE_INVALID_PAGINATION", (identifier: string) => `pagination cursor or limit is malformed: ${identifier}`, ); export const InvalidPaginationInputError = createDomainError( "InvalidPaginationInputError", "WORKFORCE_INVALID_PAGINATION_INPUT", (identifier: string) => `pagination cursor or page size is malformed: ${identifier}`, );