Add Graviditetsbetinget fravær absence type (id 13) + fix Barselsorlov discard on update - #1684
Merged
Merged
Conversation
…v discard on update - Seed new message PregnancyLeave (Id 13, da: Graviditetsbetinget fravær) — Danish law distinguishes pregnancy-related absence from ordinary sick leave - Fix update path discarding MessageId 10 (Maternity): stale blank-sentinel hardcode '== 10' changed to '== 0' to match the create path - Frontend: enum value 13, checkbox in workday dialog, grid icon, message dropdown entry, PregnancyLeave i18n key in all 26 locales - Tests: seed-data assertions (id 13 + uniqueness guards), message persistence regression through CreateUpdate (10/0/13/3), DB seed check - CI: wire ConfigurationSeedDataTests (shard b) and WorkingHoursMessagePersistenceTests (shard h) into both workflows - Cypress: add the new label to the leave-policies canonical list Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new TimePlanning absence/message type for pregnancy-related absence (Id 13 / PregnancyLeave) across backend seed data and frontend enums/i18n, and fixes a persistence bug where message id 10 (Maternity / Barselsorlov) was cleared on update due to an incorrect sentinel check.
Changes:
- Backend: seed
PregnancyLeave(Id 13) and fixUpdatePlanningto treat0(not10) as the “no message” sentinel. - Tests/CI: add regression + seed assertions and include them in the sharded workflow filters.
- Frontend/E2E: append enum value 13, add dropdown/grid support, update Cypress leave-policies canonical list, and add i18n key in multiple locales.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/TimePlanningWorkingHoursService/TimePlanningWorkingHoursService.cs | Fixes update-path sentinel so Maternity (10) is not discarded; 0 clears message. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Data/Seed/Data/TimePlanningSeedMessages.cs | Adds seeded message PregnancyLeave with Id 13 and localized names. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/WorkingHoursMessagePersistenceTests.cs | Adds regression tests ensuring message ids (0/3/10/13) persist correctly and seed row exists. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/ConfigurationSeedDataTests.cs | Adds seed-catalog assertions for Id 13 and uniqueness guards for ids/names. |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/enUS.ts | Adds PregnancyLeave translation key (en-US). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/da.ts | Adds PregnancyLeave translation key (da). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/deDE.ts | Adds PregnancyLeave translation key (de-DE). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/elGR.ts | Adds PregnancyLeave translation key (el-GR). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/esES.ts | Adds PregnancyLeave translation key (es-ES). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/etET.ts | Adds PregnancyLeave translation key (et-ET). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/fiFI.ts | Adds PregnancyLeave translation key (fi-FI). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/frFR.ts | Adds PregnancyLeave translation key (fr-FR). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/hrHR.ts | Adds PregnancyLeave translation key (hr-HR). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/huHU.ts | Adds PregnancyLeave translation key (hu-HU). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/isIS.ts | Adds PregnancyLeave translation key (is-IS). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/itIT.ts | Adds PregnancyLeave translation key (it-IT). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ltLT.ts | Adds PregnancyLeave translation key (lt-LT). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/lvLV.ts | Adds PregnancyLeave translation key (lv-LV). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/nlNL.ts | Adds PregnancyLeave translation key (nl-NL). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/noNO.ts | Adds PregnancyLeave translation key (no-NO). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/plPL.ts | Adds PregnancyLeave translation key (pl-PL). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ptBR.ts | Adds PregnancyLeave translation key (pt-BR). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ptPT.ts | Adds PregnancyLeave translation key (pt-PT). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/roRO.ts | Adds PregnancyLeave translation key (ro-RO). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/skSK.ts | Adds PregnancyLeave translation key (sk-SK). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/slSL.ts | Adds PregnancyLeave translation key (sl-SL). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/svSE.ts | Adds PregnancyLeave translation key (sv-SE). |
| eform-client/src/app/plugins/modules/time-planning-pn/i18n/ukUA.ts | Adds PregnancyLeave translation key (uk-UA). |
| eform-client/src/app/plugins/modules/time-planning-pn/enums/time-planning-messages.enum.ts | Appends PregnancyLeave to enum so UI indices remain append-only. |
| eform-client/src/app/plugins/modules/time-planning-pn/consts/messages.ts | Adds PregnancyLeave to the translated message dropdown list. |
| eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-table/time-plannings-table.component.html | Adds grid icon/tooltip rendering for message id 13. |
| eform-client/cypress/e2e/plugins/time-planning-pn/k/leave-policies.spec.cy.ts | Extends canonical leave-policy label list with pregnancy absence. |
| .github/workflows/dotnet-core-pr.yml | Adds new test classes to shard filters for PR workflow. |
| .github/workflows/dotnet-core-master.yml | Adds new test classes to shard filters for master workflow. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PregnancyLeave(Id 13, da Graviditetsbetinget fravær, en Pregnancy-related absence, de Schwangerschaftsbedingte Abwesenheit) — Danish law distinguishes pregnancy-related absence from ordinary sick leave (Syg). Seeded at plugin startup (insert-by-Name with explicit Id, heal pass covers existing DBs). Excel report summary column and gRPC MessageLabel derive automatically from the seed.MessageId = model.Message == 10 ? null : model.Message— a stale blank-sentinel hardcode that silently discarded Barselsorlov (Maternity, id 10) on every edit. Now== 0, matching the create path.PregnancyLeavei18n key in all 26 locales (da hand-verified).CreateUpdate(10→10, 0→null, 13→13, 3→3, re-read from fresh context), DB-side seed check.ConfigurationSeedDataTests(shard b) andWorkingHoursMessagePersistenceTests(shard h) added to both workflow filter allowlists.🤖 Generated with Claude Code