Skip to content

refactor(events): read conflicts from the absences table - #572

Open
mindsers wants to merge 1 commit into
mainfrom
refactor/conflicts-read-absences
Open

mindsers wants to merge 1 commit into
mainfrom
refactor/conflicts-read-absences

Conversation

@mindsers

Copy link
Copy Markdown
Contributor

PR 1b of the event schedules plan (#533): the conflict readers read absences from their own table (#566).

What changes

Three readers move from day-off events, found through the declaring account's record, to Absence rows found by the person's record:

  • checkDayOffConflict: whether someone is away when they are assigned, which blocks the assignment on a published programme and flags it on a draft;
  • refreshConflictFlags: the conflict flags on a person's assignments when they declare or delete an absence;
  • listSlotCandidateFacts: the absence named next to a person in the list of people to pick from.

list-user-conflicts-in-range reads the stored flags, so it follows without a change.

Same answers as before:

References

Unchanged. All 35 reference tests come back byte-identical.

Rollout

During the rollout, the previous version can still declare an absence as a day-off event alone. The new readers don't see such an absence until the catch-up migration copies it, before the events are dropped (PR 2). Production holds no absences yet, so nothing is affected there today.

Verification

  • A new integration test: a person with only an Absence row is seen by all three readers, and a person with only a day-off event no longer is. It failed before the switch on all three.
  • The readers' unit tests now mock the absences table; the regression pin checks that absences are found by the person's record, not the declaring account. The candidate-facts integration fixture writes its absence twice, as createDayOff does.
  • Unit (653 files) and integration (125 files, two full runs) suites, lint, typecheck and every architecture gate.

Whether someone is away when assigned, the conflict flags on their assignments and the absences named while picking a person now read Absence by the person's record, instead of day-off events through the declaring account's record. Same answers: the references are unchanged. An absence row is enough on its own; a day-off event without one, as the previous version wrote during the rollout, no longer counts — the catch-up before the events are dropped copies it.

This branch has not been deployed

No deployments
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.

1 participant