# Features — flutter_webportal (Datafy Web)

Evidence date: 2026-10-14. Source: `main` at `b98b9e2` (2026-09-24). Per-page detail in the repo: `docs/FEATURE_REFERENCE.md`. This file records feature state for Silicon Ark and does not copy every widget.

Status values: **Current** (usable on this commit), **Partial**, **Placeholder**, **Documented only**, **Removed / superseded**.

## Current features

| Feature | Route / entry | Where |
|---|---|---|
| Email/password login, forgot password, logout | `/login`, navbar Logout | `lib/pages/auth/login/`, `navbar_widget.dart` |
| Dashboard overview, store scores, active users, user statistics | `/dashboard` | `dashboard_widget.dart`, `dashboard_overview_widget.dart`, `store_score_*`, `active_users_card_widget.dart`, `user_statistics_card_widget.dart` |
| Waterwheel / Superset reports session | Dashboard Reports | `waterwheel_reports_control.dart`, `waterwheel_client.dart` |
| Sjreport workbook import | Dashboard upload (not the Sjreport nav item) | `uploadfile.dart`, `datafy_api_client.dart` |
| Tasks list, filters, view, edit, exports | `/tasks` | `tasks_manage_tab.dart`, `lib/pages/tasks/` |
| Stores list, add, link rep | `/stores` | `stores_manage_tab.dart`, `lib/pages/stores/` |
| Users (reps and portal admins), link to customer and stores, Excel import, deactivate, delete | `/users` | `users_manage_tab.dart`, `lib/pages/users/` |
| Customers CRUD and category/product tabs | `/customers` | `customers_manage_tab.dart` |
| Products catalog, image, Excel import, ML drawer | `/products` | `products_manage_tab.dart` |
| Non-issues grid | `/nonIssues` | `non_issues_widget.dart` |
| Surveys manage, link, response viewer, Excel import/export | `/surveys`, slide-overs; routes `/viewSurvey`, `/viewSurveyResponse`, `/createSurvey` | `lib/pages/surveys/`, `lib/custom_code/widgets/surveys_*` |
| Specials (promos) overview, campaigns, link, import, completed export | `/promos` | `promos_page_overview_tab.dart`, `promos_campaigns_tab.dart` |
| KaChing overview, campaigns, customer-scoped linking, before/after photos, actor tracking, delete cascade | `/kachingNew` | `kaching_campaigns_tab.dart`, `lib/pages/kaching/` |
| SDC week report and combined week export | `/sdc-report` | `sdc_report_widget.dart`, `week_report_chart_widget.dart` |
| Activity notifications | `/notifications` | `notifications_widget.dart` |
| Profile | `/profile` | `profile_widget.dart` |
| Bedrock task image analysis | Task flows when the API define is set | `analyze_image_api` named in `docs/PROJECT_DOCUMENTATION.md` |
| Reverse geocode for activity addresses | Active-users and visit UI | `reverse_geocode.dart` (Portal `reverse-geocode`, concurrency cap documented in changelog) |

Navbar visibility is not the same as route existence. See business rule BR-NAV.

## Partial features

| Feature | What works | What does not |
|---|---|---|
| Sjreport page `/sjreport` | Route and shell exist. Widget includes `SjreportPageTabs`. | Body is `ComingsoonWidget`. Header text says “SDC Report”, not Sjreport. Navbar does not open this route. |
| Callsheet `/callsheet` | Authenticated empty shell. | No business UI. Navbar opens a coming-soon modal instead. |
| Create account `/createAccount` | Widget and `createAccountWithEmail` exist. | Route is not registered in `nav.dart`. |
| `notification_widget.dart` | Renders hard-coded items. | Not the live `user_activity` feed (`docs/FEATURE_REFERENCE.md`). |
| `edit_ka_ching_copy_copy` | File exists. | `docs/FEATURE_REFERENCE.md` calls it a stub shell. Not re-verified line by line. |
| Some FlutterFlow buttons | Present in the tree. | `docs/FEATURE_REFERENCE.md` says Dashboard Add Product, profile Edit Profile, and create-account Sign In are debug-only or unwired. **Requires Confirmation** if those buttons were wired after that doc was written. |

## Planned

No separate roadmap file was found. Items the product docs still call unfinished:

- Callsheet business UI (`docs/SCOPE.md`: route only).
- Sjreport dedicated page content (`docs/SCOPE.md`: use the dashboard import).
- `AWS-migration` kept only until the default-branch swap is verified (`bitbucket-pipelines.yml` comment). The pipeline body for `main` and `AWS-migration` is already the same S3 deploy.

Anything beyond that is **Unknown**.

## In development

`CHANGELOG.md` top section is **Unreleased**, so the following are on `main` in source but not cut as a version tag in that file. Treat them as **Current in git**, release status **Unknown**:

- KaChing actor and location tracking (completer, last viewed, last edited, GPS address).
- KaChing customer-scoped linking and assignment health.
- Customer store coverage note (stores that lost their active rep).
- Survey response viewer RPC `get_survey_response_detail`.
- Waterwheel session control on the dashboard.
- Campaign search by numeric id for KaChing and Specials.
- User bulk-import template instructions (role → table routing).

`docs/index.md` lists “Customer data isolation audit” as completed (2026-06-08) and TASK-0017 KaChing actor tracking as completed (2026-09-17).

## Recently changed

Taken from `CHANGELOG.md` Unreleased and September 2026 migrations. Not a full git log.

| Area | Change | Evidence |
|---|---|---|
| KaChing linking | Region → channel → paged stores for the campaigns customer; one RPC for manual, bulk, and Excel | `20260915183000_kaching_customer_scoped_linking.sql` |
| KaChing images | Master image edit updates link `default_image_url` only; 20KB upload cap removed | `CHANGELOG.md`, `edit_ka_ching_widget.dart` named there |
| KaChing delete | Cascade gallery + assignments + master | `20260916140000_kaching_delete_cascade.sql` |
| KaChing ids | Sequence retry when `id` lags `MAX(id)` on gallery and linked users | `20260917130000`, `20260917150000` |
| KaChing export | Admins export all Complete rows for the client; default from-date 1 year; notes and completed-by | `20260917120000` |
| Surveys | Slide-over answers; role fallback so portal Admins are not treated as managers with no links | `20260818100000`, changelog |
| Dashboard scope | Removed `store_customer_link` existence gate from overview, scores, active users, statistics | `20260821130000` through `20260821160000` |
| Bulk link | Skip existing links; set `active = 1`; multi-customer unique key | `20260806150000`, `20260817140000`, `20260819060000` |
| Security | Overview client dropdowns use linked customers only | `CHANGELOG.md` Security section, `customer_scope` |
| Deploy | `main` pipeline builds with greenfield defines and deploys to S3/CloudFront; semantics flag on | `bitbucket-pipelines.yml` |
| Superset URL | Host changed to `superset.waterwheel.datafy.co.za` | `CHANGELOG.md` |

## Deprecated or removed behaviour

| Item | Evidence | State |
|---|---|---|
| DB `net.http_post` triggers for imports | `docs/PROJECT_DOCUMENTATION.md` cites `20260630160000_option_a_disable_db_http_triggers.sql` | **Documented** as replaced by Option A (storage + queue + HTTP). File presence not re-opened in this pass. |
| `store_customer_link` as a hard gate on dashboard RPCs | August 2026 “no_scl_gate” migrations | **Removed** from those functions in repo SQL. Live DB **Unknown** until migrations are applied. |
| FTP deploy of `main` | `DEPLOY_AWS.md` and `README.md` still describe it. Pipeline comment moves FTP to `datafy-old`. | **Conflict**. See project plan. |
| Legacy Superset host `superset.waterwheel.datafyapp.co.za` | Changelog “Changed” | **Removed** from the cited widgets |
| KaChing edit image max size ~19.5KB | Changelog | **Removed** |
| Navbar query of all `customer_user` rows with no `user_id` | Changelog Security | **Removed** from overview dropdowns named there |

`SECURITY_SETUP.md` was listed in the 2026-09-28 onboarding scan and is absent now. Whether it was deleted or never on this branch history is **Unknown** (shallow clone).

## Feature map by role (implemented nav)

| Feature | All signed-in | Admin or Manager | SuperAdmin only |
|---|---|---|---|
| Dashboard, Tasks, Stores, Account, Logout | Yes | Yes | Yes |
| SDC Report | No | Yes | Yes |
| Products, Special, KaChing, Surveys, Users, Customers, Notifications | No | No | Yes |
| Sjreport and Callsheet menu items | No | No | Yes, and both open a coming-soon modal |

Direct URLs are only auth-gated (`nav.dart`). Role hiding is a navigation rule, not a router rule.
