# Features — intersect_cloud_prod (Simpleflow Hub)

Evidence date: 2026-10-12. Revision: `main` @ `f4affe1`.

Status words:

- **Current** — present on a route or called from a routed page at this revision.
- **Present, not routed** — source is in the commit; `lib/index.dart` does not export it. It may still be pushed by another widget.
- **Unused copy** — a second implementation whose class is not referenced outside its own files.
- **Outside this repo** — the app calls it, the implementation is not here.
- **Unknown** — not enough evidence.

No changelog and no second commit exist, so "recently changed" and "removed" cannot be dated. The whole tree arrived in `f4affe1` ("latest update", 2025-01-06).

## Current — account and shell

| Feature | Evidence | Notes |
|---|---|---|
| Email/password sign-in | `lib/pages/auth/login/login_widget.dart` | Loads tenant, roles, colours, then Dashboard |
| Forgot password, reset password, create-password page | `lib/index.dart` routes | Mail delivery is outside this repo |
| Session restore | `lib/main.dart` user stream | Supabase implicit auth flow |
| Splash (1 second) | `lib/main.dart` | |
| Phone bottom navigation | `lib/main.dart` `NavBarPage` | Home, Process Hub, Notifications, Tasks, More. Hidden on desktop |
| Desktop side navigation | `lib/pages/include/side_nav/side_nav_widget.dart` | See PRD section 5 |
| Tenant branding colours | Login action + `FFAppState` | Persisted in secure storage |
| System-admin tenant switcher | Side nav, only when nav is open and `systemRole == 'Admin'` | |
| Sign-out clearing roles | Side nav | Clears tenant name, system role, tenant role |
| English-only UI | `lib/main.dart` `supportedLocales` | |

## Current — administration

| Feature | Evidence |
|---|---|
| System-admin management home | Route `Management` → `pages/management/management` |
| Tenant-admin management home | Route `ManagementUser` |
| User list, add, edit (system admin) | `pages/management/users/` |
| User list for tenant admin | Route `UserListTenantAdmin` |
| Tenant list, add, edit | `pages/management/tenants/` |
| Client list, add, edit, link | `pages/management/clients/` |
| Role labels System Admin / System User and Tenant Admin / Tenant User | Add-user dropdowns. Stored as `Admin` or `User` |
| "Already linked" block when a user is linked to the tenant again | Add-user flow |
| Active flag on user and tenant | `user.active`, `tenant.active` |

Parallel screens with the same jobs also exist under `pages/user_management/`. The router exports the `pages/management/` copies. Treat `pages/user_management/` as **Present, not routed** unless a widget import is found for a specific screen.

## Current — Process Hub

| Feature | Evidence |
|---|---|
| Processes assigned to the tenant | `tenant_process` + `process`, ordered by `process.order` |
| Filter chips from `process.filter_name` | `process_hub_widget.dart` |
| Panels for the 15 known filter names | Listed in the PRD (FR-031) |
| Delete of `job_card` rows with null status when a filter chip changes | Same file, chip `onChanged` |

Alternate Process Hub widgets, **unused copies** (class definitions only, not exported, not referenced by the routed widget):

- `pages/process_hub/process_hub_v1`
- `pages/process_hub/process_hub_base`
- `pages/process_hub/process_hub_plateau`
- `pages/process_hub/process_hub_pest_elite`

## Current — work items

| Feature | Status values found | Evidence |
|---|---|---|
| Tasks | Created as `Open`. Completed as `Done`. Tags: Urgent, Project, Activity, Assistance | `pages/tasks/create_task`, `pages/tasks/tasks`, routed list at `pages/general_forms/tasks` |
| Task comments and files | | `task_comments`, bucket `files` on `pages/tasks/view_task` |
| Task PDF | | `lib/custom_code/actions/create_task_pdf.dart` |
| Job cards | Basic save sets `Submitted`. Null status is deleted by Process Hub filter changes | `job_card`, `job_card_item`, `pages/job_card/` |
| Job-card totals | | RPCs `calculate_total_job_card_new`, `calculate_sum_by_jobcard` (**outside this repo**) |
| Job-card PDF download | | `DownloadPdJobCardWidget`, `create_job_card_pdf`, `create_job_card_basic_pdf` |
| Building inspection | | `building_inspection_form`, Process Hub filter, PDF action |
| Equipment inspection | | `equipment_inspection_form`, PDF action |
| Scheduled inspection | | Process Hub filter name. Backing table was not isolated from the generic inspection forms. **Unknown** which table that panel writes |
| Equipment register (Assets and Parts) | | `equipment_register`, locations, assignment, change log. Search via `list_equipment` |
| Documents and per-user access | | `document`, `document_access`, RPCs `insert_document_access`, `get_user_documents_details` |
| Support tickets | Create sets `New`. Edit chips: `New`, `Pending`, `Complete` | `pages/pest_elite/support_ticket` and routed `pages/general_forms/support_ticket` |
| Ticket assignees, comments, files | | `support_ticket_assigned_users`, `support_comments`, `support_ticket_files` |
| Bookings and calendar | | `booking`, `booking_assigned_to`, route `Calendar` |
| Reports dropdown | Job Card Report, Quotes Report, Inspection Report | `pages/reporting/reports` |
| Notifications inbox | | `notification`, `user_notification` |
| Direct messages and group chats | | `messages`, `chat`, `chat_messages`, realtime `subscribe` |
| User profile and photo | | Route `Profile`, bucket `profilePictures` on My Profile |

## Current — Pest Elite forms

Reached from Process Hub when the filter name matches. Source: `lib/pages/pest_elite/`.

| Feature | Tables / actions |
|---|---|
| Site form and site map | `pest_elite_siteform`, `pest_elite_sitemap` |
| Service report | `pest_elite_service_report` |
| Recommendation report, severity Low / Moderate / High | `pest_elite_recommendation_report` |
| Action report and revisit dates | `pest_elite_action_report`, `pest_elite_action_report_revisit_dates` |
| Rodent, cockroach, fly, and SPI checklists plus traps | `pest_elite_checklist_*` and matching trap tables. Insert RPCs `insert_pest_elite_*_traps` |
| Bookings | `booking` (shared table) |
| PDFs | `create_pest_elite_site_form_pdf`, `create_pest_elite_recommendation_report_pdf`, `create_pest_elite_recommendation_report_pdf_copy`, `create_pest_elite_action_report_pdf` |

`create_pest_elite_recommendation_report_pdf_copy.dart` is a second generator. Which screen calls which file was not fully traced. Both are **Current** files in `lib/custom_code/actions/`.

## Current — Plateau forms

| Feature | Tables / actions |
|---|---|
| Non-conformance report, closed-out flag, target date | `plateau_non_conformance_report` |
| Corrective action report | `plateau_corrective_action_report` |
| Service report and areas treated | `plateau_service_report`, `plateau_service_report_areas_treated` |
| PDFs | `create_plateau_non_conformance_pdf`, `create_plateau_corrective_action_pdf`, `create_plateau_service_report_pdf` |

Duplicate Plateau create/edit widgets exist (for example `pages/plateau/service_report/...` and `pages/plateau/plateau_create_service_report/`). Process Hub constructs `PlateauNonConformanceReportEditWidget`, `PlateauCorrectiveActionReportEditWidget`, and the service-report list. Treat the copies Process Hub does not construct as **Present, not routed**.

## Current — platform

| Feature | Evidence | Notes |
|---|---|---|
| Supabase client | `lib/backend/supabase/supabase.dart` | URL from environment JSON |
| 109 table/view classes | `lib/backend/supabase/database/tables/` | Includes `list_*` views and `test` / `test_tenant` / `pdf_test` / `dummy_data_job_card` / `old_client` |
| Storage upload and delete-by-URL | `lib/backend/supabase/storage/storage.dart` | Buckets named in the PRD |
| Signature pads (three widgets) | `lib/custom_code/widgets/signature_pad*.dart` | |
| Dynamic form builder and draggable builder | `lib/custom_code/widgets/dynamic_form_builder.dart`, `dynamic_draggable_form_builder.dart` | Backed by `form_definition`, `form_field`, `form_submission` |
| Theme colour update after login | `update_app_colors_post_login.dart`, `on_login_success.dart` | `on_login_success` navigates to Dashboard. The login page also navigates itself |
| OTP helpers | `get_otp.dart`, `confirm_otp.dart` | **Unknown** which screen presents them |
| Password update and reset actions | `update_supabase_password.dart`, `reset_password.dart` | |
| HTML placeholder replacement for emails/PDFs | `replace_*_html_placeholders.dart` | |
| File upload / download / clear cache | `upload_file.dart`, `upload_file_jpg.dart`, `download_file.dart`, `clear_all_cache.dart` | |
| Web deploy | `bitbucket-pipelines.yml` | S3 + CloudFront. Build step commented out |
| Committed web build | `build/web` | Tracked because `/build/` is commented out in `.gitignore` |
| Android, iOS, Windows projects | `android/`, `ios/`, `windows/` | Not what the pipeline publishes |
| Deep link | Android manifest and iOS URL type | Scheme `simpleflowhub`, host `simpleflowhub.com` |
| App icon and splash config | `pubspec.yaml` `flutter_launcher_icons`, `flutter_native_splash.yaml` | |

## Present in the schema, behaviour not established

These client classes exist. A product feature was not confirmed from a screen:

| Name | Why it is listed |
|---|---|
| `department`, `department_user` | No department screen was read |
| `action`, `action_template`, `process_action`, `process_instance`, `process_step`, `user_process` | Process steps exist as columns. No step designer was identified |
| `global_colors` | Colours used at runtime come from the tenant row and `FFAppState` |
| `app_user` vs `user` | Two user-shaped tables |
| `old_client` | Name implies a retired client table. No migration notes |
| `test`, `test_tenant`, `pdf_test`, `dummy_data_job_card` | Names read as fixtures |
| `mail`, `send_que`, `email_template` | Client can insert or call `send_custom_email`. The sender is **outside this repo** |
| Sign in with Apple | Dependency and `AuthManager.signInWithApple`. Login screen uses email |
| Barcode scanner | FlutterFlow git dependency. No screen search was completed. **Unknown** if a page calls it |
| Hive and sqflite | Dependencies declared. Offline sync behaviour was not found. **Unknown** |

## Planned

No TODO, roadmap, or open milestone is in the repository. Nothing is marked **Planned** from evidence.

The empty repository `intersect_cloud_v2` is not a planned version of this app. See `project-plan.md`.

## Removed / deprecated

Cannot be asserted. There is one commit. Clues that something older remains:

- `old_client` table class.
- `equiment_inspection_assign_form` beside `equipment_inspection_assign_form` (spelling split).
- `pages/authentication` beside routed `pages/auth`.
- `pages/user_management` beside routed `pages/management`.
- `pages/tasks` beside routed `pages/general_forms/tasks`.
- Four extra Process Hub widgets.
- Recommendation PDF action whose file name ends in `_copy`.

**Requires Confirmation** before calling any of these deprecated.

## Not in this revision (scan vs git)

OVER-161 listed `sonar-project.properties` and `sonarqube_scan.bat` at the root. They are not in `f4affe1`. SonarQube is not a feature of this commit.
