// @generated — do not edit import { createDomainError } from "@tailor-platform/erp-kit/core"; export const LeaveRequestNotFoundError = createDomainError( "LeaveRequestNotFoundError", "LEAVE_MANAGEMENT_LEAVE_REQUEST_NOT_FOUND", (identifier: string) => `no LeaveRequest exists for the given id: ${identifier}`, ); export const InvalidStateTransitionError = createDomainError( "InvalidStateTransitionError", "LEAVE_MANAGEMENT_INVALID_STATE_TRANSITION", (identifier: string) => `the LeaveRequest's current status does not permit this transition: ${identifier}`, ); export const SelfApprovalError = createDomainError( "SelfApprovalError", "LEAVE_MANAGEMENT_SELF_APPROVAL", (identifier: string) => `the resolver is the requester: ${identifier}`, ); export const NotAssigneeError = createDomainError( "NotAssigneeError", "LEAVE_MANAGEMENT_NOT_ASSIGNEE", (identifier: string) => `no eligible approver exists other than the requester, or the resolver is not an eligible approver: ${identifier}`, ); export const ApprovalStepFailedError = createDomainError( "ApprovalStepFailedError", "LEAVE_MANAGEMENT_APPROVAL_STEP_FAILED", (identifier: string) => `the bundled approval-module step failed to resolve: ${identifier}`, ); export const LeaveTypeNotFoundError = createDomainError( "LeaveTypeNotFoundError", "LEAVE_MANAGEMENT_LEAVE_TYPE_NOT_FOUND", (identifier: string) => `no LeaveType exists for the given id/key: ${identifier}`, ); export const LeaveTypeNotBalanceBackedError = createDomainError( "LeaveTypeNotBalanceBackedError", "LEAVE_MANAGEMENT_LEAVE_TYPE_NOT_BALANCE_BACKED", (identifier: string) => `the referenced leave type has requiresBalance = false: ${identifier}`, ); export const DuplicateActivePlanError = createDomainError( "DuplicateActivePlanError", "LEAVE_MANAGEMENT_DUPLICATE_ACTIVE_PLAN", (identifier: string) => `an existing generation (open, or closed but ending on/after the new effectiveStart) already overlaps the new plan for the (leaveTypeKey, employment type) combination: ${identifier}`, ); export const EmploymentTypeNotFoundError = createDomainError( "EmploymentTypeNotFoundError", "LEAVE_MANAGEMENT_EMPLOYMENT_TYPE_NOT_FOUND", (identifier: string) => `the workforce EmploymentType referenced by appliesToEmploymentTypeId does not exist: ${identifier}`, ); export const EmploymentTypeNotActiveError = createDomainError( "EmploymentTypeNotActiveError", "LEAVE_MANAGEMENT_EMPLOYMENT_TYPE_NOT_ACTIVE", (identifier: string) => `the workforce EmploymentType referenced by appliesToEmploymentTypeId is not ACTIVE: ${identifier}`, ); export const InvalidEligibilityDelayMonthsError = createDomainError( "InvalidEligibilityDelayMonthsError", "LEAVE_MANAGEMENT_INVALID_ELIGIBILITY_DELAY_MONTHS", (identifier: string) => `eligibilityDelayMonths is negative or not an integer: ${identifier}`, ); export const InvalidBaseGrantDaysError = createDomainError( "InvalidBaseGrantDaysError", "LEAVE_MANAGEMENT_INVALID_BASE_GRANT_DAYS", (identifier: string) => `baseGrantDays is negative or not a valid half-day increment: ${identifier}`, ); export const InvalidTenureTiersError = createDomainError( "InvalidTenureTiersError", "LEAVE_MANAGEMENT_INVALID_TENURE_TIERS", (identifier: string) => `the tier table is malformed, not monotonic non-decreasing, or a tier's grantDays exceeds annualCapDays: ${identifier}`, ); export const InvalidExpirationMonthsError = createDomainError( "InvalidExpirationMonthsError", "LEAVE_MANAGEMENT_INVALID_EXPIRATION_MONTHS", (identifier: string) => `expirationMonths is missing/null, zero, or negative: ${identifier}`, ); export const InvalidGrantConditionError = createDomainError( "InvalidGrantConditionError", "LEAVE_MANAGEMENT_INVALID_GRANT_CONDITION", (identifier: string) => `the generic grantCondition is malformed — type must be NONE or MIN_WORKED_DAYS, MIN_WORKED_DAYS requires a positive integer minWorkedDays, and referenceMonths when present must be a positive integer: ${identifier}`, ); export const InvalidAccrualMethodError = createDomainError( "InvalidAccrualMethodError", "LEAVE_MANAGEMENT_INVALID_ACCRUAL_METHOD", (identifier: string) => `accrualMethod is not a recognized accrual method: ${identifier}`, ); export const InvalidGrantTypeError = createDomainError( "InvalidGrantTypeError", "LEAVE_MANAGEMENT_INVALID_GRANT_TYPE", (identifier: string) => `grantType is not one of STATUTORY / MANUAL: ${identifier}`, ); export const DuplicateKeyError = createDomainError( "DuplicateKeyError", "LEAVE_MANAGEMENT_DUPLICATE_KEY", (identifier: string) => `key already exists: ${identifier}`, ); export const InvalidKeyFormatError = createDomainError( "InvalidKeyFormatError", "LEAVE_MANAGEMENT_INVALID_KEY_FORMAT", (identifier: string) => `key must be UPPER_SNAKE_CASE (uppercase letters, digits and underscores, starting with a letter, e.g. PAID_LEAVE); got: ${identifier}`, ); export const InvalidRequestUnitError = createDomainError( "InvalidRequestUnitError", "LEAVE_MANAGEMENT_INVALID_REQUEST_UNIT", (identifier: string) => `requestUnit is not one of FULL_DAY, HALF_DAY, RANGE: ${identifier}`, ); export const TimeEntryCodeNotFoundError = createDomainError( "TimeEntryCodeNotFoundError", "LEAVE_MANAGEMENT_TIME_ENTRY_CODE_NOT_FOUND", (identifier: string) => `the timeEntryCodeKey does not resolve to a LEAVE-classification work-rules TimeEntryCode: ${identifier}`, ); export const AlreadyDeactivatedError = createDomainError( "AlreadyDeactivatedError", "LEAVE_MANAGEMENT_ALREADY_DEACTIVATED", (identifier: string) => `the leave type is already inactive: ${identifier}`, ); export const ExpirationSweepPartialFailureError = createDomainError( "ExpirationSweepPartialFailureError", "LEAVE_MANAGEMENT_EXPIRATION_SWEEP_PARTIAL_FAILURE", (identifier: string) => `an individual grant update fails during the sweep and is retried on the next run without blocking other grants (batch job; no user-facing error scenarios otherwise): ${identifier}`, ); export const WorkerNotFoundError = createDomainError( "WorkerNotFoundError", "LEAVE_MANAGEMENT_WORKER_NOT_FOUND", (identifier: string) => `no workforce Worker exists for the given id: ${identifier}`, ); export const InvalidGrantedDaysError = createDomainError( "InvalidGrantedDaysError", "LEAVE_MANAGEMENT_INVALID_GRANTED_DAYS", (identifier: string) => `grantedDays is non-positive or not a valid half-day increment: ${identifier}`, ); export const InvalidExpirationDateError = createDomainError( "InvalidExpirationDateError", "LEAVE_MANAGEMENT_INVALID_EXPIRATION_DATE", (identifier: string) => `expirationDate is not strictly after grantedDate: ${identifier}`, ); export const MissingApproverCommentError = createDomainError( "MissingApproverCommentError", "LEAVE_MANAGEMENT_MISSING_APPROVER_COMMENT", (identifier: string) => `approverComment is empty: ${identifier}`, ); export const InvalidDateRangeError = createDomainError( "InvalidDateRangeError", "LEAVE_MANAGEMENT_INVALID_DATE_RANGE", (identifier: string) => `the requested startDate is after endDate: ${identifier}`, ); export const ReasonRequiredError = createDomainError( "ReasonRequiredError", "LEAVE_MANAGEMENT_REASON_REQUIRED", (identifier: string) => `reason is empty or whitespace-only: ${identifier}`, ); export const InvalidLeaveUnitError = createDomainError( "InvalidLeaveUnitError", "LEAVE_MANAGEMENT_INVALID_LEAVE_UNIT", (identifier: string) => `this leave type must be requested as a single day (startDate and endDate must fall on the same calendar day): ${identifier}`, ); export const DuplicateError = createDomainError( "DuplicateError", "LEAVE_MANAGEMENT_DUPLICATE", (identifier: string) => `a non-terminal request already exists for the worker whose date range overlaps the requested range: ${identifier}`, ); export const InsufficientBalanceError = createDomainError( "InsufficientBalanceError", "LEAVE_MANAGEMENT_INSUFFICIENT_BALANCE", (identifier: string) => `requested days exceed the available ledger balance for the leave type: ${identifier}`, ); export const AssignmentNotEffectiveError = createDomainError( "AssignmentNotEffectiveError", "LEAVE_MANAGEMENT_ASSIGNMENT_NOT_EFFECTIVE", (identifier: string) => `assignmentId does not cover the requested dates or does not belong to workerId: ${identifier}`, ); export const NotRequesterError = createDomainError( "NotRequesterError", "LEAVE_MANAGEMENT_NOT_REQUESTER", (identifier: string) => `the caller is not the worker who filed the request: ${identifier}`, ); export const AccrualPlanNotFoundError = createDomainError( "AccrualPlanNotFoundError", "LEAVE_MANAGEMENT_ACCRUAL_PLAN_NOT_FOUND", (identifier: string) => `no AccrualPlan exists for the given id: ${identifier}`, ); export const PlanAlreadyRetiredError = createDomainError( "PlanAlreadyRetiredError", "LEAVE_MANAGEMENT_PLAN_ALREADY_RETIRED", (identifier: string) => `the plan has no open generation to close: ${identifier}`, ); export const NoEffectiveAccrualPlanError = createDomainError( "NoEffectiveAccrualPlanError", "LEAVE_MANAGEMENT_NO_EFFECTIVE_ACCRUAL_PLAN", (identifier: string) => `no AccrualPlan generation is effective for a leaveTypeKey/employment type on the run date; the worker is skipped and logged, not treated as a fatal batch failure: ${identifier}`, ); export const DuplicateGrantSkippedError = createDomainError( "DuplicateGrantSkippedError", "LEAVE_MANAGEMENT_DUPLICATE_GRANT_SKIPPED", (identifier: string) => `not a failure — the batch's idempotency skip when a grant already exists for the worker/leaveType/date/grantSource: ${identifier}`, ); export const GrantConditionNotMetError = createDomainError( "GrantConditionNotMetError", "LEAVE_MANAGEMENT_GRANT_CONDITION_NOT_MET", (identifier: string) => `not a failure — the MIN_WORKED_DAYS gate found fewer worked days than the threshold over the reference window, so no grant is issued this period (skip + log); the next period is evaluated independently and tenure progression is unaffected: ${identifier}`, ); export const OverlappingGenerationError = createDomainError( "OverlappingGenerationError", "LEAVE_MANAGEMENT_OVERLAPPING_GENERATION", (identifier: string) => `the new generation's effectiveStart would overlap the currently open generation: ${identifier}`, ); export const KeyImmutableError = createDomainError( "KeyImmutableError", "LEAVE_MANAGEMENT_KEY_IMMUTABLE", (identifier: string) => `the update attempts to change key: ${identifier}`, ); export const CategoryImmutableError = createDomainError( "CategoryImmutableError", "LEAVE_MANAGEMENT_CATEGORY_IMMUTABLE", (identifier: string) => `the update attempts to change category: ${identifier}`, ); export const LeaveGrantNotFoundError = createDomainError( "LeaveGrantNotFoundError", "LEAVE_MANAGEMENT_LEAVE_GRANT_NOT_FOUND", (identifier: string) => `no LeaveGrant exists with the given id: ${identifier}`, ); export const InvalidPaginationError = createDomainError( "InvalidPaginationError", "LEAVE_MANAGEMENT_INVALID_PAGINATION", (identifier: string) => `the requested page size or cursor is invalid: ${identifier}`, ); export const InvalidHorizonError = createDomainError( "InvalidHorizonError", "LEAVE_MANAGEMENT_INVALID_HORIZON", (identifier: string) => `the requested expiration horizon is missing, negative, or otherwise malformed: ${identifier}`, );