Repository navigation
feat(soci): fill in the birth date from the codice fiscale - #160
Conversation
Typing a valid codice fiscale in Admit, Register or Edit sets the birth date it encodes. The code keeps only two digits of the year, so the century is the latest that doesn't put the birth after today. A date that already agrees with the code (e.g. one a century earlier, typed by hand) is kept, and the field stays editable.
|
No actionable comments were generated in the recent review. WalkthroughThe change adds helpers to derive a birth date from a codice fiscale and updates the Soci form to recalculate the draft birth date when the codice fiscale changes. The birth-date field also always references its hint. ChangesSoci birth-date autofill
Possibly related issues
Possibly related PRs
Change: Feature Merge Risk:
|
In the Soci forms (Admit socio, Register account, Edit details), typing a valid codice fiscale now sets the Birth date it encodes.
80→ 1980,05→ 2005, and26S30→ 1926-11-30.The logic is in
src/features/soci/codice-fiscale-birth.ts, kept apart fromcodice-fiscale.tsbecause that file is a copy of the backend's. Tests are intests/soci.test.mjs, covering omocodia, 29 February, the century rollover and invalid codes.pnpm check,pnpm typecheck,pnpm testandpnpm buildpass.