# Boundary Commission — Implementation Roadmap

This roadmap aligns the codebase with the [Strategic Integration Framework](./STRATEGIC_INTEGRATION_FRAMEWORK.md). Use it to track what exists and what is planned.

---

## Phase 1 — Registry Core (Foundation)

| Item | Status | Notes |
|------|--------|------|
| Boundary records (CRUD, list, search) | ✅ Done | Laravel dashboard + API; workflow stages, commissioner assignment |
| GIS maps (boundary polygons on map) | ✅ Done | Leaflet on boundary detail + dashboard overview map |
| GIS Viewer workstation (OpenStreetMap, GeoJSON, QGIS-compatible) | ✅ Done | Next.js: Leaflet + OSM; Laravel: /gis/boundaries/geojson, /gis/properties/geojson, /gis/survey-plans/geojson; layer toggles, search |
| Document management (boundary documents) | ✅ Done | Boundary documents upload/list/download; link to boundaries |
| Change history (per boundary) | ✅ Done | Boundary audit log; change history tab on detail |
| Audit trail (who did what, when) | ✅ Done | Audit trail section; boundary_audit_log |
| User roles & access control | ✅ Done | alf_authority roles; admin, commissioner, etc. |
| Commission members registry | ✅ Done | Commission members section; linked to users + ROLE_COMMISSIONER |
| Dispute records (basic) | ✅ Done | boundary_dispute; list/search in dashboard |
| Treaty/survey data models | ✅ Done | boundary_treaty, boundary_survey, etc. |

**Phase 1 summary:** Foundation is in place. Remaining work is incremental (e.g. default boundary list when no search, richer dispute workflow).

---

## Phase 2 — Security Layer

| Item | Status | Notes |
|------|--------|------|
| **Use case 1:** Boundary dispute management (Disputed/Contested/Under Litigation flags, parties, mediator, evidence, violence escalation alerts) | ✅ Done | boundary.dispute_status; dispute_type, party_a_type, party_b_type, assigned_mediator_id, escalated_to_violence; escalate button + BoundaryAlertLog |
| **Use case 2:** Jurisdictional responsibility matrix (Police/Military/DSS/NSCDC per boundary zone, notifications, briefing export) | ✅ Done | boundary.police_command, military_formation, dss_zone, nscdc_region; Security & jurisdiction tab; export planned |
| **Use case 7:** Security agency access portal (role-based read access, shapefile/PDF export, audit of access) | ✅ Done | ROLE_POLICE/MILITARY/DSS/NSCDC; Agency Portal section; GeoJSON export + access log |
| **Use case 8:** Peace agreement & treaty documentation (agreed coordinates, signed doc, publish, lock record) | ✅ Done | boundary_treaty.is_peace_agreement, published_at, resolution_document_id, is_locked; boundary.is_locked; commissioner-only edit |
| **Use case 9:** Alert & notification engine (dispute status alerts, incident alerts, escalation, cross-border) | ✅ Done | boundary_alert_log table; violence escalation creates alert; full push/WebSockets planned |
| **Use case 10:** Audit trail with security classification (Sensitive/Restricted, access logging, compliance reports) | ✅ Done | boundary.security_classification, is_locked; boundary_access_log on view; Security & jurisdiction tab |

---

## Phase 3 — Intelligence Layer

| Item | Status | Notes |
|------|--------|------|
| **Use case 3:** Border security integration (high-risk segments, checkpoints, crossing points, immigration/customs API, incident flags) | ✅ Done | boundary.is_high_risk, risk_type; boundary_checkpoint, boundary_crossing_point tables; Security tab; API stubs planned |
| **Use case 4:** Incident overlay & hotspot mapping (incidents tagged to boundary, heatmaps, dispute–incident correlation) | ✅ Done | boundary_incident table; Incidents section (log + list); has_active_incident on boundary; heatmap layer optional |
| **Use case 5:** Community land & grazing route registry (farmer/herder boundaries, corridors, dispute history) | ✅ Done | boundary.boundary_sub_type; Community & Grazing section; Security tab sub-type |
| **Use case 6:** Political representation fairness dashboard (constituency/population, gerrymandering flags, INEC feed) | ✅ Done | electoral_constituency table; Representation section; population/seats/underserved; INEC feed stub |

---

## Tech Stack (from framework)

| Component | Status | Notes |
|-----------|--------|------|
| PostGIS for spatial queries | 🔲 Planned | Enables “boundaries in zone”, jurisdiction lookups |
| WebSockets for real-time alerts | 🔲 Planned | Phase 2 alert engine |
| Role-based API gateways for agencies | 🔲 Planned | Phase 2 agency portal |
| PDF / Shapefile export for briefings | 🔲 Planned | Phase 2/7 |
| Encryption at rest for sensitive records | 🔲 Planned | Phase 2/10 |

---

## Quick reference

- **Strategy & use cases:** [STRATEGIC_INTEGRATION_FRAMEWORK.md](./STRATEGIC_INTEGRATION_FRAMEWORK.md)
- **Current implementation:** [BOUNDARY_COMMISSION_IMPLEMENTATION.md](./BOUNDARY_COMMISSION_IMPLEMENTATION.md)
- **Laravel boundary/dashboard:** `boundary-laravel/` (BoundaryController, commission members, audit trail, dashboard map)

Update this roadmap as Phase 2 and Phase 3 items are implemented.
