Traceability Matrix: Offline-First Platform
Version: 1.0
Date: 2026-03-28
Companion: SPEC.md, TECHNICAL_REQUIREMENTS.md
1. Functional requirement traceability
| FR ID | Summary | Evidence / test expectation |
|---|
| FR-OFF-001 | Local drafts and queue scoped to tenant | Module E2E + manual test plan when client outbox exists; TESTING_STANDARDS.md sync/offline row |
| FR-OFF-002 | Stable mutation id + server idempotency | registration controller tests for Idempotency-Key / cache; future ehr-web integration tests |
| FR-OFF-003 | Reconcile server outcomes | Client unit tests (future outbox); service contract tests |
| FR-OFF-004 | Conflicts surfaced | Module specs (e.g. optimistic lock 409) |
| FR-OFF-005 | Modules document offline scope | Each specs/modules/<m>/SPEC.md |
| FR-OFF-006 | NATS server-only | Architecture review; no client NATS |
2. Technical requirement traceability
| TR ID | Summary | Evidence |
|---|
| TR-OFF-001..003 | Mutation identity + idempotent response | registration patients.controller.ts, unit tests |
| TR-OFF-005 | BFF forwards idempotency | Future: ehr-web app/api/registration/patients/route.ts headers |
| TR-OFF-006 | Kong preserves headers | Infra review; kong.yml |
| TR-OFF-007..008 | Retry/backoff | Client implementation (future) |
| Module / area | Offline phase | Notes |
|---|
| registration | Server idempotency | POST /v1/patients with Redis-backed dedupe; see registration API_DOCS.md |
| ehr-web (registration UI) | Online-first | No unified IndexedDB outbox; users rely on network; align with FR-OFF-002 when outbox ships |
| orders / requisitions (CPOE) | Target (drafts) | Retired standalone reqref spec; use orders-cpoe/SPEC.md + ADR-0046; offline drafts align with CPOE / DMS |
| clinical-notes (consolidated) | Target | Draft sync in consolidated package; module spec governs |
| appointments (consolidated) | Target | Pending booking queue per package |
| Platform | SPEC + TR | This folder |
Phases: none → server-idempotency only → client queue planned → implemented.
| Test ID | Area | Description |
|---|
| TC-OFF-001 | Idempotency | Duplicate POST /v1/patients with same key returns same patient id |
| TC-OFF-002 | Tenant scope | Idempotency key does not collide across tenants |
| TC-OFF-003 | Conflict | Stale version on PUT returns structured 409 |
| TC-OFF-004 | Sync/offline | Queue replay does not double-apply server effects (future client suite) |
Where implemented: registration Jest tests cover TC-OFF-001 partial (same controller). Full cross-tenant TC-OFF-002 should live in integration tests when added.