77[ ![ PostgreSQL] ( https://img.shields.io/badge/postgresql-16-336791.svg )] ( https://www.postgresql.org/ )
88[ ![ Docker] ( https://img.shields.io/badge/docker-enabled-2496ED.svg )] ( https://www.docker.com/ )
99[ ![ Docker Compose] ( https://img.shields.io/badge/docker%20compose-supported-2496ED.svg )] ( https://docs.docker.com/compose/ )
10- [ ![ Licence ] ( https://img.shields.io/github/license/AAdewunmi/Claims-Fraud-Risk-Scoring-Project )] ( https://github.com/AAdewunmi/Claims-Fraud-Risk-Scoring-Project/blob/main/LICENSE )
10+ [ ![ License ] ( https://img.shields.io/github/license/AAdewunmi/Claims-Fraud-Risk-Scoring-Project )] ( https://github.com/AAdewunmi/Claims-Fraud-Risk-Scoring-Project/blob/main/LICENSE )
1111[ ![ Coverage Status] ( https://codecov.io/gh/AAdewunmi/Claims-Fraud-Risk-Scoring-Project/branch/main/graph/badge.svg )] ( https://codecov.io/gh/AAdewunmi/Claims-Fraud-Risk-Scoring-Project )
1212
1313# PolicyLens
1414
15- Insurance claims workflow platform with API-first domain logic , role-specific web surfaces, and auditable fraud-risk triage .
15+ Production-ready insurance claims workflow platform with an API-first domain model , role-specific operational surfaces, ML-assisted completeness scoring, and auditable evidence export .
1616
17- ## Status
17+ ## Project Status
1818
19- ** Production app build in progress**
20- Snapshot date: ** February 28, 2026**
19+ Completed.
2120
22- - Core product workflows are implemented and running in Docker.
23- - CI quality gates are active (Black, Ruff, pytest, coverage threshold).
24- - Multi-surface routing is live for admin, reviewer, and customer roles.
25- - Production deployment profile and operational hardening are the active build track.
21+ As of March 6, 2026, PolicyLens includes the full Sprint 1-7 scope:
2622
27- ## What is live today
23+ - End-to-end claims workflow APIs (create, retrieve, documents, notes, decisions).
24+ - SLA-aware operational queue with deterministic filtering and ordering.
25+ - Multi-surface routing for admin, reviewer, and customer user journeys.
26+ - Health/readiness endpoint for runtime and infrastructure checks.
27+ - Idempotency protection for write endpoints.
28+ - ML scoring with persisted metadata and reason codes.
29+ - Audit evidence export in JSON and PDF.
30+ - Production-shaped Docker stack with Gunicorn + Nginx profiles.
31+ - CI gates for Black, Ruff, pytest, and coverage threshold enforcement.
2832
29- ### Core domain and API
33+ ## Core Capabilities
3034
31- - Claim intake for claim and policy-change types.
32- - Document upload, internal notes, and review decisions.
33- - Append-only audit events and JSON evidence export.
34- - Queue API with status, priority, and SLA filtering.
35- - ML scoring endpoint with persisted score metadata and reason codes.
36- - Idempotency support for write endpoints.
37- - Health check endpoint at ` /api/health/ ` .
35+ ### API and domain workflow
3836
39- ### Web surfaces
37+ - Claim intake for ` CLAIM ` and ` POLICY_CHANGE ` types.
38+ - Document upload, internal note capture, and reviewer decisioning.
39+ - Append-only audit events attached to workflow actions.
40+ - Queue endpoint with ` status ` , ` priority ` , and SLA filter options.
41+ - Idempotency-key support for safe client retries on write endpoints.
4042
41- - Public landing page with role entry points.
42- - Surface-specific login routes:
43- - ` /login/admin/ `
44- - ` /login/reviewer/ `
45- - ` /login/customer/ `
46- - Role-gated console home routes:
47- - ` /console/admin/ `
48- - ` /console/reviewer/ `
49- - ` /console/customer/ `
50- - Ops surface:
51- - ` /ops/queue/ ` with pagination and filter-preserving links
52- - ` /ops/claims/{id}/ ` claim detail page
53- - HTMX actions for notes, documents, decisions, and ML scoring
54- - Customer surface:
55- - ` /customer/ ` paginated claim list
56- - ` /customer/claims/{id}/ ` detail view
57- - ` /customer/claims/{id}/documents/upload/ `
43+ ### Ops and customer surfaces
5844
59- ### Quality baseline
45+ - Public landing page and role entry routes.
46+ - Role-gated console routes for admin/reviewer/customer.
47+ - Reviewer ops queue and claim detail with HTMX actions.
48+ - Customer claim list/detail views with pagination.
6049
61- - Latest local run: ** 166 tests passed** , coverage ** 94.43%** .
62- - CI enforces coverage floor at ** 80%** .
63- - Test suite includes API, UI surface, authz, pagination, idempotency, SLA, and ML contract checks.
50+ ### Evidence and ML
6451
65- ## Sprint delivery summary
52+ - JSON evidence bundle export for claim audits.
53+ - PDF evidence bundle export for portability/compliance workflows.
54+ - ML completeness scoring endpoint with:
55+ - score
56+ - label
57+ - reason codes
58+ - model version metadata
6659
67- - ** Sprint 1:** Project setup, Docker + Postgres, baseline API and test harness.
68- - ** Sprint 2:** Claim workflow APIs, notes/documents/decisions, seed data path.
69- - ** Sprint 3:** Queue ordering, audit events, audit export JSON, idempotency layer.
70- - ** Sprint 4:** ML feature contract, training/scoring flow, persisted score metadata.
71- - ** Sprint 5:** Multi-surface web app, console routing, ops and customer surface coverage.
72- - ** Sprint 6 (current):** Production hardening and deployment readiness.
73-
74- ## API surface map
60+ ## API Surface
7561
7662- ` GET /api/health/ `
7763- ` POST /api/claims/ `
@@ -83,17 +69,26 @@ Snapshot date: **February 28, 2026**
8369- ` POST /api/claims/{id}/ml-score/ `
8470- ` GET /api/claims/{id}/audit-events/ `
8571- ` GET /api/claims/{id}/audit-export/ `
72+ - ` GET /api/claims/{id}/audit-export/?format=pdf `
8673- ` GET /api/queue/claims/?status=&priority=&sla=breached|due_soon|ok `
8774
8875## Architecture
8976
90- - Django + DRF application (` policylens/ ` ) with PostgreSQL persistence.
91- - Service-layer workflow logic in ` policylens/apps/claims/services.py ` .
92- - Role and surface authorization helpers in ` policylens/apps/core/authz.py ` .
93- - Shared pagination contract in ` policylens/apps/core/pagination.py ` .
94- - Server-rendered templates with HTMX partial updates for low-friction ops actions.
77+ - Backend: Django + Django REST Framework
78+ - Database: PostgreSQL
79+ - Frontend: Django Templates + HTMX (server-rendered interactions)
80+ - ML: scikit-learn inference and persisted scoring metadata
81+ - Runtime: Docker Compose, Gunicorn, Nginx
82+
83+ Key modules:
84+
85+ - ` policylens/apps/claims/ ` domain logic, APIs, queue, export, ML
86+ - ` policylens/apps/core/ ` authz, idempotency, pagination utilities
87+ - ` policylens/apps/ops/ ` reviewer workflows and HTMX endpoints
88+ - ` policylens/apps/customer/ ` customer workflow surface
89+ - ` policylens/apps/api/ ` top-level API wiring and health endpoint
9590
96- ## Local development
91+ ## Local Development
9792
9893### Prerequisites
9994
@@ -103,18 +98,18 @@ Snapshot date: **February 28, 2026**
10398
104991 . Copy environment file:
105100 - ` cp .env.example .env `
106- 2 . Build and start services :
101+ 2 . Start the app stack :
107102 - ` docker compose up --build `
108- 3 . Seed deterministic sample records:
103+ 3 . Seed baseline records and users :
109104 - ` docker compose exec web python manage.py seed_sample_data `
110- 4 . Seed demo users and pagination-focused demo claims :
105+ 4 . Optional: add expanded demo users/data :
111106 - ` docker compose exec web python manage.py create_demo_users `
112- 5 . Open app surfaces :
107+ 5 . Open:
113108 - ` http://localhost:8000/ `
114109 - ` http://localhost:8000/api/health/ `
115110 - ` http://localhost:8000/ops/queue/ `
116111
117- ### Seeded users
112+ ### Seeded credentials
118113
119114From ` seed_sample_data ` :
120115
@@ -127,32 +122,50 @@ From `create_demo_users`:
127122- ` demo_reviewer / pass-12345-strong `
128123- ` demo_customer / pass-12345-strong `
129124
130- ## Validation commands
125+ ## Production-shaped profiles
126+
127+ HTTP smoke profile:
128+
129+ - ` docker compose -f docker/docker-compose.prod.yml up --build -d `
130+ - App entrypoint: ` http://localhost:8080/ `
131+
132+ Secure profile:
133+
134+ - ` docker compose -f docker/docker-compose.prod.secure.yml up --build -d `
135+ - App entrypoint: ` http://localhost/ `
136+
137+ See:
138+
139+ - ` docs/DEPLOYMENT.md `
140+ - ` docs/RUNBOOK.md `
141+
142+ ## Quality and Validation
143+
144+ Local validation commands:
131145
132146- ` docker compose exec web python -m black . --check `
133147- ` docker compose exec web python -m ruff check . `
134- - ` docker compose exec web pytest -q --cov=policylens --cov-config=.coveragerc --cov-report=term-missing --cov-report=xml --cov-fail-under=80 `
148+ - ` docker compose exec web pytest -q --cov=policylens --cov-config=.coveragerc --cov-report=term-missing --cov-report=xml --cov-fail-under=85 `
135149
136- ## Production hardening backlog
150+ Latest local full suite run:
137151
138- Current priority items for deployment readiness:
152+ - ` 201 passed in 103.68s ` (March 6, 2026)
139153
140- - Add production runtime profile (Gunicorn + reverse proxy).
141- - Add production compose/deploy artifacts and environment split.
142- - Tighten security settings by environment (hosts, cookies, headers, static/media strategy).
143- - Introduce scheduled/background execution for SLA sweep and bulk scoring.
144- - Extend evidence export format options (for example PDF).
154+ CI gates enforce:
145155
146- ## Repository layout
156+ - formatting (` black --check ` )
157+ - lint (` ruff check ` )
158+ - migrations + collectstatic sanity
159+ - pagination-first test execution
160+ - full test suite with coverage threshold
147161
148- - ` policylens/apps/claims/ ` claims domain, API, queue, export, ML
149- - ` policylens/apps/ops/ ` ops views, templates, HTMX endpoints
150- - ` policylens/apps/customer/ ` customer portal views and templates
151- - ` policylens/apps/accounts/ ` surface login and access flows
152- - ` policylens/apps/console/ ` role console surfaces
153- - ` policylens/apps/core/ ` authz, idempotency, pagination utilities
154- - ` tests/ ` integration and contract tests
155- - ` docs/ ` project documentation
162+ ## Documentation
163+
164+ - ` docs/DEPLOYMENT.md ` production configuration and environment guidance
165+ - ` docs/RUNBOOK.md ` operational runbook for prod-shaped stacks
166+ - ` docs/DEMO.md ` manual demo checklist
167+ - ` docs/DEMO_SCRIPT.md ` automated demo script usage
168+ - ` docs/Syllabus.md ` complete sprint-by-sprint delivery map
156169
157170## License
158171
0 commit comments