299 lines
7.4 KiB
Markdown
299 lines
7.4 KiB
Markdown
# Non-EB Claim API — Documentation
|
|
|
|
**Base URL:** `/employeeRest/api/v1/non-eb-claim`
|
|
**Auth:** Bearer JWT token via `Authorization` header (required on all endpoints)
|
|
**Filter:** `ratelimit`, `authJWT`
|
|
|
|
---
|
|
|
|
## 1. Create Claim
|
|
`POST /create`
|
|
|
|
**Content-Type:** `multipart/form-data`
|
|
|
|
### Request Fields
|
|
| Field | Type | Required | Notes |
|
|
|---|---|---|---|
|
|
| `client_policy_id` | int | Yes | Must be active Non-EB or Marine policy |
|
|
| `nature_of_loss` | string | Yes | Min 3 chars |
|
|
| `loss_location` | string | Yes | |
|
|
| `loss_date` | string | Yes | Format: DD-MM-YYYY |
|
|
| `loss_description` | string | No | Required if `asset_file` is uploaded |
|
|
| `loss_estimate` | numeric | No | |
|
|
| `claim_number` | string | No | Alphanumeric, `/`, `_`, `-` only |
|
|
| `asset_file` | file | No | Allowed: pdf, xls, xlsx, csv |
|
|
| `asset_id_code[]` | array | No | Asset details |
|
|
| `serial_no[]` | array | No | |
|
|
| `vehicle_no[]` | array | No | |
|
|
| `asset_description[]` | array | No | |
|
|
|
|
### Response — 200
|
|
```json
|
|
{
|
|
"status": true,
|
|
"code": 200,
|
|
"claim_id": 42,
|
|
"asset_file": "asset_20250315_abc123.pdf",
|
|
"message": "Non-EB Claim created successfully"
|
|
}
|
|
```
|
|
|
|
### Error Responses
|
|
| Code | Reason |
|
|
|---|---|
|
|
| 400 | Validation failed |
|
|
| 404 | Client policy not found |
|
|
| 409 | Duplicate claim (same client + loss_date + policy_no) |
|
|
| 415 | Unsupported asset file type |
|
|
| 422 | Policy type not Non-EB/Marine, or no claim status configured |
|
|
| 500 | DB insert or file upload failed |
|
|
|
|
---
|
|
|
|
## 2. List Claims
|
|
`POST /list`
|
|
|
|
**Content-Type:** `application/json`
|
|
|
|
### Request Body (all optional)
|
|
```json
|
|
{
|
|
"page": 1,
|
|
"per_page": 20,
|
|
"client_id": 101,
|
|
"insurer_id": 5,
|
|
"policy_type_id": 50,
|
|
"claim_status_id": 3,
|
|
"claim_number": "CLM/2025",
|
|
"nhance_claim_ref_no": "NHC/NEB",
|
|
"date_type": "created_date",
|
|
"start_date": "01-01-2025",
|
|
"end_date": "31-03-2025",
|
|
"show_closed": false
|
|
}
|
|
```
|
|
|
|
> `date_type`: `"created_date"` (default) or `"updated_date"`
|
|
> `show_closed`: if falsy, excludes Settled / Closed / Rejected / Withdrawn claims
|
|
|
|
### Response — 200
|
|
```json
|
|
{
|
|
"status": true,
|
|
"code": 200,
|
|
"total": 84,
|
|
"page": 1,
|
|
"per_page": 20,
|
|
"data": [
|
|
{
|
|
"id": 42,
|
|
"claim_number": "CLM/INS/2025/1234",
|
|
"nhance_claim_ref_no": "NHC/NEB/2025/00042",
|
|
"policy_no": "POL/MAR/2025/5678",
|
|
"policy_type_id": 50,
|
|
"claim_status_id": 3,
|
|
"status": "surveyor_assigned",
|
|
"status_display": "Surveyor Assigned",
|
|
"policy_type_name": "Marine Cargo",
|
|
"client_name": "Acme Logistics Pvt Ltd",
|
|
"insurer_name": "New India Assurance",
|
|
"loss_date": "2025-03-15",
|
|
"loss_location": "Chennai Port, Gate 3",
|
|
"nature_of_loss": "Fire and explosion damage to cargo",
|
|
"loss_estimate": "850000.00",
|
|
"insured_contact_name": "Ramesh Kumar",
|
|
"insured_contact_number": "9876543210",
|
|
"acm_name": "Priya Nair",
|
|
"created_date": "16-03-2025",
|
|
"updated_date": "20-03-2025"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
### Error Responses
|
|
| Code | Reason |
|
|
|---|---|
|
|
| 400 | Invalid JSON body |
|
|
|
|
---
|
|
|
|
## 3. Claim Detail + History
|
|
`GET /history/{claim_id}`
|
|
|
|
### Response — 200
|
|
```json
|
|
{
|
|
"status": true,
|
|
"code": 200,
|
|
"claim_id": 42,
|
|
"claims_data": {
|
|
"id": 42,
|
|
"nhance_claim_ref_no": "NHC/NEB/2025/00042",
|
|
"claim_number": "CLM/INS/2025/1234",
|
|
"policy_no": "POL/MAR/2025/5678",
|
|
"policy_type_name": "Marine Cargo",
|
|
"client_name": "Acme Logistics Pvt Ltd",
|
|
"branch_name": "Chennai Branch",
|
|
"insurer_name": "New India Assurance",
|
|
"claim_status": "surveyor_assigned",
|
|
"status_display_name": "Surveyor Assigned",
|
|
"insured_contact_name": "Ramesh Kumar",
|
|
"insured_contact_number": "9876543210",
|
|
"insured_contact_email": "ramesh@acmelogistics.com",
|
|
"nature_of_loss": "Fire and explosion damage to cargo",
|
|
"loss_location": "Chennai Port, Gate 3",
|
|
"loss_date": "2025-03-15",
|
|
"loss_description": "Fire broke out in warehouse bay during unloading",
|
|
"loss_estimate": "850000.00",
|
|
"loss_assessed_value": "720000.00",
|
|
"settled_amount": null,
|
|
"settlement_utr": null,
|
|
"intimation_recd_date": "2025-03-16",
|
|
"intimated_to_insurer_date": "2025-03-17",
|
|
"surveyor_name": "Suresh Inspection Services",
|
|
"surveyor_contact_person": "Suresh Babu",
|
|
"surveyor_contact_number": "9444123456",
|
|
"acm": "Priya Nair",
|
|
"acm_mobile": "9500011122",
|
|
"asset_file": "asset_20250315_abc123.pdf",
|
|
"priority": 1,
|
|
"created_at": "2025-03-16 10:30:00",
|
|
"updated_at": "2025-03-20 14:45:00"
|
|
},
|
|
"required_docs": {
|
|
"is_action_freeze": false,
|
|
"docs": [
|
|
{ "document_name": "Claim Form", "document_received": true },
|
|
{ "document_name": "Survey Report", "document_received": false },
|
|
{ "document_name": "Police FIR Copy", "document_received": false }
|
|
]
|
|
},
|
|
"claims_files": [
|
|
{
|
|
"id": 101,
|
|
"doc_name": "Claim Form",
|
|
"file_name": "claim_form_42_20250316.pdf",
|
|
"mime_type": "application/pdf",
|
|
"file_type": 2,
|
|
"docs_for_ir": 1,
|
|
"created_at": "2025-03-16 11:00:00"
|
|
}
|
|
],
|
|
"ticket_data": [
|
|
{ "status": "Claim Registered", "changed_at": "16-03-2025 10:30 AM" },
|
|
{ "status": "Intimated to Insurer", "changed_at": "17-03-2025 09:00 AM" },
|
|
{ "status": "Surveyor Assigned", "changed_at": "20-03-2025 02:45 PM" }
|
|
]
|
|
}
|
|
```
|
|
|
|
### Error Responses
|
|
| Code | Reason |
|
|
|---|---|
|
|
| 404 | Claim not found or inactive |
|
|
|
|
---
|
|
|
|
## 4. Upload Required IR Documents
|
|
`POST /upload-required-doc`
|
|
|
|
**Content-Type:** `multipart/form-data`
|
|
|
|
### Request Fields
|
|
| Field | Type | Required | Notes |
|
|
|---|---|---|---|
|
|
| `ticket_id` | integer | Yes | The non-EB claim (ticket) ID |
|
|
| `claim_docs[]` | file(s) | Yes | One or more files to upload |
|
|
| `claim_doc_names[]` | string[] | Yes | Name for each file — index-matched to `claim_docs[]` |
|
|
| `required_docs` | string (JSON) | Yes | Full updated checklist JSON to store (e.g. `{"is_action_freeze":false,"docs":[...]}`) |
|
|
|
|
### Response — 200
|
|
```json
|
|
{
|
|
"status": true,
|
|
"code": 200,
|
|
"message": "Files uploaded successfully"
|
|
}
|
|
```
|
|
|
|
### Error Responses
|
|
| Code | Reason |
|
|
|---|---|
|
|
| 400 | No files uploaded or `ticket_id` missing |
|
|
| 401 | Missing / expired token |
|
|
| 500 | File upload or DB failed |
|
|
|
|
---
|
|
|
|
## 5. List Claim Statuses
|
|
`GET /statuses`
|
|
|
|
### Response — 200
|
|
```json
|
|
{
|
|
"status": true,
|
|
"code": 200,
|
|
"data": [
|
|
{ "id": 1, "claim_status": "claim_registered", "display_name": "Claim Registered" },
|
|
{ "id": 2, "claim_status": "intimated_to_insurer","display_name": "Intimated to Insurer" },
|
|
{ "id": 3, "claim_status": "surveyor_assigned", "display_name": "Surveyor Assigned" }
|
|
]
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## 6. List Policies (Non-EB / Marine)
|
|
`POST /policies`
|
|
|
|
**Content-Type:** `application/json`
|
|
|
|
### Request Body
|
|
```json
|
|
{
|
|
"client_id": "5058f1af8388634f884bd49b13....",
|
|
"client_branch_id": 7
|
|
}
|
|
```
|
|
|
|
> `client_id` — MD5 hash of the client's numeric ID
|
|
|
|
### Response — 200
|
|
```json
|
|
{
|
|
"status": true,
|
|
"code": 200,
|
|
"total": 3,
|
|
"data": [
|
|
{
|
|
"id": 88,
|
|
"policy_no": "POL/MAR/2025/5678",
|
|
"policy_type_id": 50,
|
|
"policy_type_name": "Marine Cargo",
|
|
"insurer_id": 5,
|
|
"insurer_name": "New India Assurance",
|
|
"insurer_short_name": "NIA",
|
|
"policy_start_date": "01-04-2025",
|
|
"policy_end_date": "31-03-2026"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
### Error Responses
|
|
| Code | Reason |
|
|
|---|---|
|
|
| 400 | Missing or invalid `client_id` / `client_branch_id` |
|
|
|
|
---
|
|
|
|
## Common Auth Error (all endpoints)
|
|
```json
|
|
{
|
|
"status": false,
|
|
"code": 401,
|
|
"message": "Unauthorized"
|
|
}
|
|
```
|