Skip to content

Add Graviditetsbetinget fravær absence type (id 13) + fix Barselsorlov discard on update - #1684

Merged
renemadsen merged 1 commit into
stablefrom
feat/pregnancy-leave-absence-type
Aug 11, 2026
Merged

Add Graviditetsbetinget fravær absence type (id 13) + fix Barselsorlov discard on update#1684
renemadsen merged 1 commit into
stablefrom
feat/pregnancy-leave-absence-type

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Summary

  • New absence/message type 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.
  • Bug fix: the working-hours update path had 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.
  • Frontend: enum value 13 (append-only; dialog indexes checkboxes by enum order), workday-dialog checkbox (bottom of list), grid icon, working-hours dropdown entry, request-history label, PregnancyLeave i18n key in all 26 locales (da hand-verified).
  • Tests: seed-data assertions (exactly one Id 13 row + Id/Name uniqueness guards), message-persistence regression through CreateUpdate (10→10, 0→null, 13→13, 3→3, re-read from fresh context), DB-side seed check.
  • CI: ConfigurationSeedDataTests (shard b) and WorkingHoursMessagePersistenceTests (shard h) added to both workflow filter allowlists.
  • Cypress: new label appended to the leave-policies canonical list.

🤖 Generated with Claude Code

…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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 fix UpdatePlanning to treat 0 (not 10) 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.

@renemadsen
renemadsen merged commit e426b92 into stable Aug 11, 2026
39 checks passed
@renemadsen
renemadsen deleted the feat/pregnancy-leave-absence-type branch August 11, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants