# Triad Water Solutions — first-release setup and verification

## Release status
This is a synthetic workflow prototype with a secure Cloud foundation, not an approved live release. Demo changes are held in memory and reset on page reload. Staff records are a separate durable workspace; authenticated coordinator create-and-read was verified in the browser. The role selector only changes the demo label and does not grant live access.

**Verified in demo:** option preservation, evidence-source navigation, entrance review, version acknowledgement, internal notes, handover option accounting and export. Automated domain tests cover courtesy messages, duplicate events, historical events, service-window boundary, cross-midnight overlap and non-regressing delivery states.

**Not verified against Meta:** connected number, coexistence, inbound event, authorised send, media retrieval, history or delivery callback. Connection was declined. No campaign routing, number migration or real send was performed.

**Remaining implementation:** complete live normalised contacts/sites/conversations, background media and transcription jobs, role-specific live edit screens, durable handover workflow, offline drafts and expiry, operational metrics, configurable retention/correction/deletion workflows, full acceptance checks under three staff accounts. Do not use live client data until these are complete and tested.

## Staff setup
Use Staff sign-in. Email confirmation remains enabled. New accounts have no app role. Administrators assign coordinator, assessor, estimator, manager or admin in the protected role table; users cannot grant their own roles. Display names, avatars and preferences live separately from roles.
Live assessments use owner and assignment-based access. Site-unresolved records are withheld from assessors and estimators. The initial private staff workspace can create and read coordinator-owned assessments; complete role workflows are not yet connected to the demo screens.

## Official WhatsApp setup
1. An authorised Meta administrator inventories the business portfolio, WABA, advert phone number, existing provider, staff replies and linked devices. Record ownership and account permissions.
2. Link the official WhatsApp Business connector in Lovable. The existing workspace connection has not been linked to this app. It targets Graph API v25.0 through the official Lovable gateway; credentials stay server-side.
3. Check coexistence eligibility and supported devices with Meta before connecting the advertised number. If unavailable, the administrator decides test-number or migration; never deregister or move campaign destinations automatically.
4. Deploy the signed receiver at POST /api/public/whatsapp/webhook. Select this project under the connection’s Incoming messages. This redirects callbacks away from a previous destination. The connector handles Meta onboarding/challenge; this app verifies Lovable’s forwarded HMAC signature with the connection secret.
5. Verify a genuine inbound event persists in the inbox. Unknown payloads remain preserved. Delivery status reconciliation uses transactional row locks and retains provider times. Pending work is retried on later deliveries with a one-minute deferral after failure; quiet periods delay recovery. No standalone worker is currently configured.
6. Verify approved templates and purpose/permission evidence. Free-form requires a valid customer-service window. Advert attribution is not marketing consent. Live sending is deliberately not enabled in this release.
7. For supported Business-app coexistence, deploy before requesting contacts and history. Import requires the app to request sync within 24 hours of connecting. Reconnecting Lovable alone does not reopen an expired window. Historical payloads are preserved but not yet expanded into the live staff thread.
8. Run test-number sending and verify provider accepted, sent, delivered/read or failed callbacks separately from client slot agreement. Do not label Live healthy until all three directions are verified.

## AI and POPIA
The text extraction function uses the workspace default openai/gpt-6-astra, returns proposals and is not called automatically. Triad must approve vendor, region, retention and processing purposes before using personal data. Confirmed staff edits must be retained. The synthetic voice fixture currently has a transcript but no original audio clip; no transcription capability has been verified. Photos do not establish yield, water quality, compliance or treatment settings.

Private evidence uses assessment-ID folders in the assessment-evidence bucket. Role-restricted reads apply. An expiring-link flow, access-view audit, removal of obsolete access instructions, local cache expiry and retention execution still need completion. Offline caching is disabled rather than promising unsafe access expiry.

## One-minute role walkthroughs
**Coordinator:** Overview → Shared inbox → Mokoena conversation → click requirement evidence → review access change → accept/edit/reject → draft recap → Dispatch board → reserve or cancel slot. Demo sends never contact clients.
**Assessor:** My visits → Mokoena → read What changed → acknowledge the displayed version → tick checks → record measured space in metres and observation → save → open handover. Demo photographs remain in memory.
**Estimator:** Quote handover → compare both storage sizes → review common and option-specific works → note pending yield evidence → return question → account for each option → export/print → record quotation reference and sent date.

## Pilot and acceptance
Before pilot, test three separate role accounts, concurrent reservation attempts, reassignment revocation, private media denial by direct URL, stale saves and offline unseen-version acknowledgement. Database reservations use an assessor advisory lock to prevent overlaps, including concurrent attempts; confirmed slots require agreement evidence. These protections have been implemented but not yet exercised under concurrent authenticated accounts.
For ten live bookings, capture latest-brief acknowledgement before departure (count and percentage), material changes unacknowledged at departure (count), completed-assessment to handover elapsed time, repeated-information incidents and missed-information revisits. Exclude cancellations. Current demo shows no live denominator.

## Primary references — recheck before activation
- https://developers.facebook.com/documentation/business-messaging/whatsapp/overview
- https://developers.facebook.com/documentation/business-messaging/whatsapp/embedded-signup/onboarding-business-app-users/
- https://business.whatsapp.com/policy

Optional Outlook, Teams and CRM integrations remain deferred until the core live handover is complete.