| Current Path : /var/git/cesa-v3/docs/specs/ |
| Current File : /var/git/cesa-v3/docs/specs/member-transformation-declaration-requirements.md |
# Member transformation declaration — requirements ## Menu - Authenticated users with `ROLE_MEMBER_FIRM` see a **Member Portal** navigation dropdown. - Menu item **Transformation Declaration** links to the transformation data capture form. ## Form access - Users authenticated via member portal (`user_login`) with a linked member firm may open the form. - Form displays transformation statistics for the **current calendar year** (declaration year). ## Prior-year prefill When the firm has **no** annual declaration transformation record for the current year: 1. Search prior years (year − 1, year − 2, …) in `ADec_tblMemberFirms` / `ADec_Transformation` (by `Prev_FirmID` = live firm id). 2. Use the **most recent** prior year that has declaration data to prefill the form. 3. If no prior annual data exists, prefill from live `tblMemberFirms` / `tblMemberFirmsTransformation` if present. 4. If still none, show a blank form with standard defaults. ## Save - Persist **only** to current-year rows in `ADec_tblMemberFirms` and `ADec_Transformation` (annual declaration tables). - Do **not** update live `tblMemberFirms` or `tblMemberFirmsTransformation` from the member portal; those operational/reporting tables are updated when staff approve copying approved declaration data. - **Total staff** (`TotalStaff` on the firm profile) must equal the sum of all occupational-band × demographic headcount fields in the transformation grid (70 count fields). The form must not save when these differ. ## Acceptance criteria - `ROLE_MEMBER_FIRM` users see Member Portal → Transformation Declaration. - Opening the form without current-year ADec data shows fields copied from the latest prior year when available. - Saving updates current-year `ADec_tblMemberFirms` and `ADec_Transformation` only. - Doctrine maps `ADecTransformation` to table `ADec_Transformation` (primary key `TransformID`). - Submitting the form with a total staff figure that does not match the summed grid headcounts shows a validation error on **Total staff** and does not persist.