Deletion removes active members from a client policy via Excel upload
(files.action = deletion). Unlike inception, the final step does not delete rows immediately —
it creates pending endorsement records on employee_polices for approval/processing later.
Core processing lives in EmployeeServiceController::employeeDisembark.
EmployeeController::initializeDeletionProcessForTpaApiData is a separate TPA-reconcile path that
builds a deletion Excel file and calls the same disembark function.
In short:
D.| Area | Location |
|---|---|
| UI | app/Views/employee_upload.php — action Deletion |
| Upload | EmployeeController::employeesUplodWithEvents |
| Validation | EmployeeServiceController::excelFileFormatValidation, excelFileDataValidation |
| Deletion process | EmployeeServiceController::employeeDisembark |
| TPA auto-deletion | EmployeeController::initializeDeletionProcessForTpaApiData |
| Job | employeeDisembark in JobWorker.php |
| Endorsements | EmpEndorsementModel → emp_endorsement (actions = d, status = pending) |
Routes (group /employee, authMVC):
GET /employee/upload — upload screenPOST /employee/upload — upload-action-type=deletionGET /employee/excel_error/{file_id} — read files.reason after validation failurefiles.policy_id is the client policy id. Member lookup joins
employees + employee_polices on that policy and branch.
| Step | < 1 MB | ≥ 1 MB |
|---|---|---|
| Format validation | Inline on upload | Job excelFileFormatValidation |
| Data validation | Job excelFileDataValidation | Same |
| Disembark | Job employeeDisembark | Same |
$deletion_excel_columns — 7 columns (A–G).D drives mandatory fields: Change event, Date of exit, Reason for exit, Claim status.d-M-Y.0 or 1.| Code | Meaning |
|---|---|
| 1 | Mandatory missing |
| 2 | Wrong format |
| 3 | Not in allowed list |
| 4 | Custom validation failed |
| 5 | File / policy problem |
| 6 | Column headers wrong |
Rows are grouped by EMP ID. For deletion, the main check is name_and_empid_check_in_db:
employee_polices row on the uploaded policy/branch.On success → queues employeeDisembark (not employeesOnboardPreprocess).
Loads the Excel again and processes each non-empty row.
Per matched member, four pending endorsement rows are inserted on employee_polices:
date_of_exit ← Excel column E (converted to Y-m-d)reason_for_exit ← column Fstatus → inactiveclaim_status ← column G
Returns an array of processed employee.id values. Sets files.status = success when the loop finishes
(even if some rows were skipped — check logs for “not found” or “existing endorsement pending”).
initializeDeletionProcessForTpaApiData($file_id):
tpa_api_data, action_flag_status = D).writable/uploads/excel/tpa_auto_deletion_{fileId}_{timestamp}.xls.files row with action = deletion.employeeDisembark(['file_id' => $newFileId]) synchronously.getDeletionEmployeeDataForExportExcel.| Col | Header | Required | Notes |
|---|---|---|---|
| A | S.No | Yes | |
| B | EMP ID | Yes | Employee / family code |
| C | NAME OF EMP/DEP | Yes | Must match DB name exactly |
| D | Change event | Yes | e.g. deletion |
| E | Date of exit | Yes | d-M-Y |
| F | Reason for exit | Yes | |
| G | Claim status | Yes | 0 or 1 |
Delete one dependent — only that name appears; Self row is not required in the file.
| Row | EMP ID | NAME | Change event | Date of exit | Reason | Claim |
|---|---|---|---|---|---|---|
| 2 | EMP001 | Arjun Kumar | deletion | 19-May-2026 | Resigned | 0 |
Result: endorsements for Arjun only (relationship ≠ Self).
Delete entire family — list the Self row; disembark loads all active family members for that EMP ID.
| Row | EMP ID | NAME | Change event | Date of exit | Reason | Claim |
|---|---|---|---|---|---|---|
| 2 | EMP001 | Raj Kumar | deletion | 19-May-2026 | Resigned | 0 |
Result: pending endorsements for Self + all active dependents on that policy (same exit date/reason/claim from the row).
/employee/upload with action deletion; note file_id.GET /employee/excel_error/{file_id} — look for code 10 (member not in DB).emp_endorsement where file_id = upload id, actions = 'd', status = 'pending'.not found or Existing endorsement pending.initializeDeletionProcessForTpaApiData and the generated tpa_auto_deletion_*.xls file.employees.name exactly (case/spacing).emp_status = active and employee_polices.status = active match.files.status does not reflect per-row skips; use endorsements table + logs.Related: Inception (onboard pipeline uses the same upload screen and first two validation steps).