This page documents the Non-EB Claims web workflow: list and filter claims, create and edit tickets, status-driven form sections, document uploads, manual email reply, mail template CRUD, auto-mail on create/status change, and claim reports.
Scope: authenticated MVC routes under /non-eb-claim/* only.
Mobile/REST endpoints in Api\NonEbClaimApiController are not covered here.
Policy types are limited to policy_type.allocg IN ('Non-EB', 'Marine').
Claim records live in non_eb_ticket_master; claim files use ticket_type = 2
in claim_files.
Typical user path:
50 — see why 50 is hardcoded.is_auto_mail = 1.ticket_claim_status.allowed_status; section visibility updates./non-eb-claim/mail_template (direct URL; not in main Claims sidebar today).50 is hardcoded (read this before changing Non-EB Claims)
Non-EB has many real policy products (Fire, Marine, Liability, etc. — each row in
policy_type with allocg Non-EB or Marine). Claim status workflows are
not stored separately per product today. The team configured one canonical policy type,
id 50, in the database as the single source of status definitions. The application
assumes every Non-EB/Marine claim uses that same status set unless you deliberately change
backend and frontend.
Claim statuses live in ticket_claim_status, keyed by ticket_type (which equals
policy_type.id). Mail templates in ticket_mail_template also key off
ticket_type + trigger_type from that status row.
Instead of maintaining duplicate status trees for every Non-EB product, developers assumed:
All Non-EB and Marine policy types share one identical claim status lifecycle. That lifecycle is configured only under policy type
50inticket_claim_status(and matching templates underticket_type = 50).
New claims opened via the list Add button or New Non EB Claim menu therefore
pass 50 into the form URL. Status dropdowns, section visibility, and initial status resolution in
getClaimStatusForPolicyType($policy_type_id) all use that id on create — not the id of the policy
the user later picks from client_policy.
On create (non_eb_claim_form.php):
policy_type_id is set from the URL segment (typically 50) and is not updated when the user selects a branch policy.policy_type_display from the selected policy row (data-policy-type).POST /non-eb-claim/create persists policy_type_id from that hidden field — so new tickets from Add often store policy_type_id = 50 even when the linked policy is Fire, Marine, etc.
On edit (non_eb_claim_edit.php), policy_type_id comes from
non_eb_ticket_master as saved. Status changes and templates use that stored id.
50 appears in code (change all if this design changes)| Location | Usage |
|---|---|
app/Config/Routes.php | GET non-eb-claim/new → claimForm/50 |
app/Views/non_eb_claim_list.php | DataTable Add button → /non-eb-claim/new/50 |
app/Views/non_eb_claim_form.php | Hidden policy_type_id from route; status/section AJAX uses this value |
ticket_claim_status (DB) | Master status rows maintained with ticket_type = 50 |
ticket_mail_template (DB) | Non-EB auto-mail templates should use ticket_type = 50 if they follow the shared workflow |
Api\NonEbClaimApiController::listClaimStatuses() | API hardcodes where('ticket_type', 50) (out of scope for this page but same assumption) |
If a new (or existing) policy type must have its own statuses, triggers, or allowed transitions
(not the shared tree under 50), you cannot only change the product row in
policy_type. You must update both backend and frontend:
ticket_claim_status rows with
ticket_type = <that policy_type.id> (claim_status, display_name, trigger_type,
allowed_status JSON). Add matching ticket_mail_template rows for that
ticket_type if auto-mail applies.50: e.g. change
claimForm/50, restore policy-type picker modal (commented in
non_eb_claim_search.php), or pass the correct policy_type_id per product.new/50 in
non_eb_claim_list.php with the correct id or dynamic selection.#policy_type_id to the real
policy_type_id from getBranchAndPolicy (field p.policy_type_id is
already returned) so create/update and getVisibleSections use the right status tree.getClaimStatusForPolicyType,
getTemplateDataByTicketID, and filters that assume a single Non-EB status catalog are tested for
the new ticket_type.50 in listClaimStatuses() if mobile
clients need per-product statuses.Until those steps are done, pointing Add at another id without cloning the full status + template set under that id will produce empty status lists, wrong section visibility, or missing auto-mail.
| Area | File / route |
|---|---|
| Controller | app/Controllers/NonEbClaimController.php |
| Model | app/Models/NonEbTicketMasterModel.php |
| List + filters | app/Views/non_eb_claim_search.php, non_eb_claim_list.php |
| New claim | app/Views/non_eb_claim_form.php |
| View / edit | app/Views/non_eb_claim_edit.php |
| Mail templates | app/Views/non_eb_claim_mail_template.php |
| Reports | app/Views/non_eb_claim_reports.php |
| Routes | app/Config/Routes.php — group /non-eb-claim, filter authMVC |
| ACL | app/Config/Acl.php — #^/non-eb-claim# (Claims team roles) |
| App menu | app/Views/layout/header.php — New / List only (EB mail template link is separate) |
| Method | Route | Controller | Purpose |
|---|---|---|---|
| GET | /non-eb-claim/list | claimList | Search page + default open claims |
| POST | /non-eb-claim/list | claimList | Filter → HTML partial for DataTable |
| GET | /non-eb-claim/new | claimForm/50 | New claim (default policy type 50) |
| GET | /non-eb-claim/new/{policy_type_id} | claimForm | New claim for selected product |
| POST | /non-eb-claim/create | createClaim | Create ticket + assets + history + auto-mail |
| GET | /non-eb-claim/view/{id} | view_claim | Edit layout (non_eb_claim_edit) |
| POST | /non-eb-claim/update | updateClaim | Update; auto-mail on status change |
| GET | /non-eb-claim/remove?ticket_id= | removeClaim | Soft delete (is_active = 0) |
| GET | /non-eb-claim/mail_template | mailTemplate | Template list + modal CRUD UI |
| POST | /non-eb-claim/crud_mail_template/1 | crudTemplate | Save template |
| POST | /non-eb-claim/crud_mail_template/2 | crudTemplate | Fetch one template (edit) |
| POST | /non-eb-claim/crud_mail_template/3 | crudTemplate | Soft delete template |
| POST | /non-eb-claim/note/1 | crudNote | Get note |
| POST | /non-eb-claim/note/2 | crudNote | Save note |
| POST | /non-eb-claim/reply | saveReply | Manual outbound mail + message row |
| GET | /non-eb-claim/reports | claimReports | Reports UI shell |
| POST | /non-eb-claim/reports | claimReports | Not implemented in controller — see Reports |
| POST | /non-eb-claim/getBranchAndPolicy | getBranchAndPolicyByClientID | Branches, policies, contacts for client |
| POST | /non-eb-claim/getVisibleSections | getVisibleSectionsAjax | Section keys for status |
| POST | /non-eb-claim/getMoreInfo | getMoreInfo | Ticket row JSON |
| POST | /non-eb-claim/uploadFile | uploadFile | Claim docs (file or Drive URL) |
| POST | /non-eb-claim/getClaimFiles | getClaimFiles | List files for ticket |
| GET | /non-eb-claim/removeFile?id= | removeFile | Soft delete file |
| POST | /non-eb-claim/saveIRDocs | saveIRDocs | Persist required-docs JSON on ticket |
| GET | /non-eb-claim/testAutoMail/{id} | testAutoMailTrigger | Dev/test auto-mail (optional) |
All routes in the /non-eb-claim group use the authMVC filter.
Acl.php allows roles HEAD, ADMIN, MANAGER,
ACCOUNT_MANAGER on the Claims team.
List row actions (view / delete) render only for roles 1, 2, 5 in
non_eb_claim_list.php.
GET /non-eb-claim/list loads non_eb_claim_search.php, which includes the table partial. Initial data comes from claimSearch(1): active tickets where status display name is not in Claim Settled, Claim Closed, Claim Rejected, Claim Withdrawn.
Filter sidebar posts the same URL with criteria (at least one required):
policy_type_id, insurer_id, claim_number, nhance_claim_ref_noclient_id, claim_status_id (status options filtered by policy type in JS)date_type + start_date / end_date (created_date or updated_date)
Response is JSON { status: true, html: "…" }; JS replaces #claim_list_div
and re-initializes the DataTable. Row click navigates to /non-eb-claim/view/{id}.
Add button: window.location.href = '/non-eb-claim/new/50'.
Header menu uses /non-eb-claim/new (routes to claimForm/50).
See Policy type 50 for why this id is fixed and what to change if a product needs its own statuses.
GET /non-eb-claim/new/{policy_type_id} → getFormData(): ACMs (role 3), clients, insurers, initial claim status for product, visible sections.POST getBranchAndPolicy fills branch, policy (Non-EB/Marine only), branch contact.POST getVisibleSections toggles accordion sections client-side.POST /non-eb-claim/create — validation via getValidationRules(), sanitizeInputArrayAdvanced, date normalization, optional asset file upload.client_id + loss_date + policy_no (if policy set) → HTTP 409-style JSON.non_eb_ticket_master, saveAssets(), history row, sendAutoMailTrigger(), redirect to list.
view_claim($id) loads ticket via NonEbTicketMasterModel::getTicketDataByTicketID(),
merges mail template preview (getTemplateDataByTicketID + placeholder replace),
messages, history, assets, and reuses the edit view non_eb_claim_edit.php.
POST /non-eb-claim/update mirrors create validation. If claim_status_id changes,
auto-mail runs again. remark_mode=append appends to closure_remark with a separator.
$statusSectionVisibility in the controller maps each ticket_claim_status.claim_status
label to section keys: policy_account, loss_incident, intimation,
insured_contact, asset, documents, surveyor, settlement.
Allowed next statuses come from getClaimStatusForPolicyType(): current status plus IDs in
allowed_status JSON on the status row. Both create and edit forms call
getVisibleSectionsAjax when the user changes status.
Template lookup (NonEbTicketMasterModel::getTemplateDataByTicketID):
ticket_claim_status on ticket’s claim_status_id (or explicit status_id for tests).ticket_mail_template where ticket_type = policy_type_id AND trigger_type = tcs.trigger_type.
sendAutoMailTrigger($ticket_id) sends only when the matched template has
is_auto_mail = 1. Mail goes to insured_contact_email from
constructMailContent(); from address claims@nhanceindia.in via MailHelper::send_email().
Successful sends insert a ticket_messages row via autoMessageInsertBasedOnMailResponse().
Placeholders (subject/body):
| Token | Ticket field |
|---|---|
((ACM)) | acm |
((ACM_CONTACT)) | acm_mobile |
((INSURED_NAME)) | insured_contact_name |
((CORPORATE_NAME)) | client_name |
((CLAIM_NO)) | claim_number |
((POLICY_TYPE)) | policy_type_name |
((NHANCE_REF_NO)) | nhance_claim_ref_no |
((LOSS_DATE)) | loss_date |
((LOSS_LOCATION)) | loss_location |
((NATURE_OF_LOSS)) | nature_of_loss |
Edit screen also supports manual reply: POST /non-eb-claim/reply validates To/Subject,
inserts ticket_messages, sends via sendReplyMessage() with placeholder replacement.
Page: GET /non-eb-claim/mail_template. DataTable lists rows from
ticket_mail_template (is_active = 1). Tooltip on each row shows the
matching ticket_claim_status.claim_status for that policy type + trigger type.
template_name, ticket_type (policy type id), trigger_type (1–9)subject, mail_content (Jodit HTML)is_auto_mail — checkbox “Auto Mail” (1 = send on create / status change when matched)id on save for update
Trigger ↔ status: Each ticket_claim_status row for a Non-EB/Marine
ticket_type has a trigger_type. The template’s trigger_type must match
that column for auto-mail and for the “Claim Status” readonly hint (tool_tip from server on fetch).
| Action | Endpoint | Body | Result |
|---|---|---|---|
| Add / Save | POST …/crud_mail_template/1 | Form fields + mail_content + is_auto_mail | { status: bool } → reload |
| Edit load | POST …/crud_mail_template/2 | id | { status, data } opens modal |
| Delete | POST …/crud_mail_template/3 | id | Soft delete (is_active = 0) |
Placeholder dropdown in the modal inserts tokens into subject (focused input) or Jodit body.
Validation errors return HTTP 400 with errors map (shown via toastr).
On the edit screen:
POST /non-eb-claim/note/1 — id (ticket), optional is_auto_query → fetch active note.POST /non-eb-claim/note/2 — save note (required 3–1000 chars) via TicketNoteModel.uploadFile — multi upload to writable/uploads/claim_files/ or Google Drive URLs (file_type 1 vs 2).getClaimFiles — lists rows; local files expose download URL downloadClaimFile/{id}.removeFile — soft delete by file id.saveIRDocs — stores JSON in non_eb_ticket_master.required_docs.asset_file under writable/uploads/non_eb_asset_files/; loss description required when file uploaded.
GET /non-eb-claim/reports renders filters: policy type, ACM name, date range (default last 60 days).
generateReport() in the view POSTs to the same URL and expects
{ status: true, data: [ rows ] } for DataTable columns (status, policy type, claim/ref, client, insurer, loss fields, surveyor, settlement, ACM, created date).
Gap: NonEbClaimController::claimReports() only handles GET (layout load).
There is no POST handler to return report data — Generate Report will fail until POST logic is added
(mirror EB ticket_reports or reuse claimSearch with report-specific selects).
| Table | Role |
|---|---|
non_eb_ticket_master | Main claim ticket |
non_eb_claim_asset | Repeating asset lines per ticket |
ticket_claim_status | Statuses per ticket_type (policy type id); trigger_type, allowed_status |
ticket_mail_template | Templates; ticket_type = policy type id |
ticket_history | Field-level audit (status, ACM, priority, …) |
ticket_messages | Outbound mail log |
ticket_notes | User notes per ticket |
claim_files | Attachments; ticket_type = 2 for Non-EB |
| Method | Used for |
|---|---|
claimList / claimSearch | List UI and filtered HTML |
claimForm / getFormData | New claim form bootstrap |
view_claim | Edit view |
createClaim / updateClaim | Persist ticket |
getClaimStatusForPolicyType / getVisibleSections* | Status dropdown + sections |
mailTemplate / crudTemplate | Template admin |
sendAutoMailTrigger / constructMailContent | Automated email |
saveReply / getTicketMessage | Manual email thread |
crudNote | Notes |
uploadFile / getClaimFiles / removeFile / saveIRDocs | Documents |
saveAssets / getAssets | Asset grid |
claimHistory / putHistoryAfterInsert | Audit trail |
getBranchAndPolicyByClientID | Client cascade |
claimReports | Reports page (GET only today) |
testAutoMailTrigger | Dev preview/send test |
ticket_claim_status rows exist per Non-EB/Marine policy_type.id with correct trigger_type and allowed_status./non-eb-claim/mail_template with matching ticket_type + trigger_type; enable Auto Mail only where intended.50 if a product needs its own workflow.claimReports() if reports Generate must work.ticket_type = 2 in new file-related code paths.#^/non-eb-claim# if new roles need access.ticket_mail_template for policy type + status trigger_type → no auto-mail and empty reply preview./non-eb-claim/reports but controller only loads view on GET.ticket_type = 50; Add/new routes and hidden form field use 50 — not the policy picked on the form. Different per-product statuses require full backend + frontend changes — checklist./ticket/mail_template, not Non-EB.is_active = 0; list queries filter active only.employeeRest / Api\NonEbClaimApiController — different validation and flows.