Correction updates existing member data on an active policy via Excel upload
(files.action = correction). The final step creates pending correction endorsements
on the employees table — data is not updated until those endorsements are applied downstream.
Processing is in EmployeeServiceController::employeesCorrectionProcess, queued after the same
format and data validation steps used for inception and deletion.
In short:
d-M-Y.| Area | Location |
|---|---|
| UI | app/Views/employee_upload.php — action Correction |
| Upload | EmployeeController::employeesUplodWithEvents |
| Validation | excelFileFormatValidation, excelFileDataValidation |
| Correction process | EmployeeServiceController::employeesCorrectionProcess |
| Column config API | getCorrectionExcelColumns() — used when building correction Excel programmatically |
| Job | employeesCorrectionProcess in JobWorker.php |
| Endorsements | EmpEndorsementModel — actions = c, table_name = employees, status = pending |
Routes (group /employee, authMVC):
GET /employee/upload — upload screenPOST /employee/upload — upload-action-type=correctionGET /employee/excel_error/{file_id} — validation errorsfiles.policy_id is the client policy id. Lookup requires active
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 |
| Correction process | Job employeesCorrectionProcess | Same |
$correction_excel_columns — 8 columns (A–H).C for mandatory rules on correction-specific columns.name, dob, relationship, email_corporate.d-M-Y.| Code | Meaning |
|---|---|
| 1 | Mandatory missing |
| 2 | Wrong format |
| 3 | Not in allowed list (e.g. invalid Field value) |
| 4 | Custom validation failed |
| 5 | File / policy problem |
| 6 | Column headers wrong |
Rows grouped by EMP ID; for correction the critical check is name_and_empid_check_in_db:
On success → queues employeesCorrectionProcess (with optional batch_file_id for TPA multi-file flows).
Per row:
field_name ← column D (name, dob, relationship, email_corporate)new_value ← column E; if field is dob, converted from d-M-Y to Y-m-ddate_of_correction ← column F (converted to Y-m-d)remarks ← column H (optional)old_value ← current value from employees.{field_name}
Skips insert when a pending correction endorsement already exists for the same
emp_code, name, and field_name
(actions = c, endorsement_id IS NULL, status != truncated).
Sets files.status = success when the loop completes and sends a success pull notification.
Rows with no DB match are not endorsed (no row-level failure on the file record).
TPA batch: If batch_file_id is set, also queues
updateEmployeeDataFromTpa, reconTpaApiDataWithEmployeepolicies, and
initializeDeletionProcessForTpaApiData.
| Col | Header | Required | Notes |
|---|---|---|---|
| A | S.No | Yes | |
| B | EMP ID | Yes | |
| C | NAME OF EMP/DEP | Yes | Must match DB before correction |
| D | Field | Yes | name, dob, relationship, email_corporate |
| E | Value | Yes | New value; DOB as d-M-Y |
| F | Date of Correction | Yes | d-M-Y |
| G | Change event | Yes | e.g. correction |
| H | Remarks | No | Stored on endorsement |
Fix DOB — one row, one field:
| EMP ID | NAME | Field | Value | Date of Correction | Change event | Remarks |
|---|---|---|---|---|---|---|
| EMP001 | Raj Kumar | dob | 15-Jan-1985 | 19-May-2026 | correction | Typo in upload |
Multiple fixes — use separate rows (same or different members):
| EMP ID | NAME | Field | Value |
|---|---|---|---|
| EMP001 | Raj Kumar | email_corporate | raj.kumar@company.com |
| EMP001 | Priya Kumar | relationship | Spouse |
upload-action-type=correction; note file_id./employee/excel_error/{file_id} for code 10.emp_endorsement where file_id = upload id, actions = 'c', status = 'pending'.field_name, old_value, new_value per row to the Excel.getCorrectionExcelColumns() for header layout.emp_code + name; rename via a name field row uses the old name in column C.files.status = success does not mean every row created an endorsement.employees columns change only after endorsement approval/application.