# Emergency Contacts — integrated prototype module

## Entry points
- Public directory: /emergency-contacts; published contact details at /emergency-contacts/:id.
- Destination and attraction detail pages: shared emergency contact section, ordered by explicit destination link, district, region, then nationwide coverage.
- Admin: /admin/emergency-contacts with List All, Add New, Pending and Archived navigation.
- Visitor support link in the site header, mobile menu and footer.

## Try it
1. Browse the directory, search by name, filter by contact type, region or destination, then paginate. Open a contact for its service details.
2. Open Bwindi or another destination; its emergency section reads the same records as the directory.
3. Switch to Administrator in Demo controls. Create or edit a contact. Region and district/service-area changes clear destination selections. Multiple matching destinations can be selected.
4. Save a draft, then submit it. A different authorized officer approves and publishes it; use Roles & permissions to grant emergency_contacts actions to an existing role.
5. Try rejecting or returning a pending submission, deactivating a published record, archiving and restoring. Public visibility updates immediately. Decisions appear in Audit Trail and record history.
6. On fresh demo data Editor has create/edit/submit permissions and Reviewer has approval/publication/verification permissions. Existing saved roles are deliberately preserved: Administrator can assign new grants without resetting data.

## Records and workflow
Contact name, category, region, district/service area, linked destination IDs, coverage, address, phone, alternative phone, email, WhatsApp, Facebook, X/Twitter, hours, description and responsible organisation are stored together. All contact actions check the same role and organisation/region/category assignments used by the rest of the prototype. Category additions require configuration permission. Filtered exports require export permission.

Draft → Under review → Approved → Published, with rejection and changes-requested alternatives. Configured combined approval supports sample publication from review. Genuine records must first be approved and independently verified, even when combined approval is enabled. Every edit returns the record to Draft and clears verification. All decisions require a reason; verification asks for evidence. Self-approval follows the existing system configuration.

Only published, active, unarchived samples or verified genuine contacts appear publicly. Details and destination sections use the same rule. Duplicate name/phone/service-area combinations are rejected. Revision checks prevent stale edits or decisions. Destination links use stable IDs and survive renaming. Referenced destinations cannot be permanently deleted; contacts with destination links must be archived rather than deleted. Unlinked contact drafts may be deleted; their audit records remain.

## Seed and migration
26 fictional contacts span the six initial categories and four sample regions, with published, draft, pending, rejected, inactive and archived examples. Public results exceed one page. Sample phone fields use DEMO-NOT-DIALABLE and sample email/social fields use example.invalid. Calling and messaging actions are disabled for every sample. Samples cannot be marked genuinely verified.

Migration adds missing contact data and categories to saved version-2 browser state. Existing records, assignments, bookings and intentionally empty contact lists are preserved. No real emergency numbers are seeded. Automated validation uses isolated test data that is never included in the seed.

## Production boundaries
This remains a browser-local prototype, not a live emergency service. Role enforcement and audit history are simulated in editable browser storage. Production requires server authentication and authorization, durable database transactions and audit storage, approved contact sources, verification evidence and review intervals, and authoritative geography. The limited inherited service-area list includes Entebbe and does not claim to be an official district register. Operational officer assignments, scope grants and workflow policies are configuration, not hardcoded person names.

## Verification
29 service regression checks passed, including eight emergency-focused checks covering migration, scoped permissions, sample links, review separation, stale revisions, invalid links/URLs, duplicate prevention, shared visibility and destination references. TypeScript and the production build passed. No new browser-based visual or end-to-end QA was performed.
