Skip to content

feat(presence): register a vacation/absence via calendar.addVacation #64

Description

@nickknissen

What

aula vacations reads vacation registrations, but there is no way to create one. The portal has this write, and it is the correct tool for a planned absence, which report-sick deliberately does not cover (Aula has no future-dated sick report).

Grounding

Portal bundle, presence Vuex store (https://www.aula.dk/static/js/0.*.js, webpack module 152), sitting directly beside the UPDATE_SICK action:

ADD_ABSENCE: ({commit}, payload) =>
  post("?method=calendar.addVacation", payload)
    .then(r => { commit(MUTATE_SUCCESS_TEXT, "SUCCESS_TOAST_REGISTER_ABSENCE"); return r })
    .catch(() => commit(MUTATE_ERROR_TEXT, "API_ERROR_ADD_VACATION"))

Note the method lives under calendar.*, not presence.*, even though the presence UI is what calls it.

The mobile app decompilation (com.netcompany.aulanativeprivate, published in eisbaw/aulalibre) lists the same family: AddVacation, GetChildrenVacation, GetVacationAnnouncementsByChildren, GetVacationRegistrationOverview, GetVacationRegistrationsByChildren.

Work needed

The request payload is not pinned down yet. Before implementing, read it out of the bundle the same way the sick write was grounded in #63:

  1. Find the component dispatching ADD_ABSENCE and record the exact object it passes (child ids, start/end dates, a note field, and how the vacation "announcement" case differs from a plain registration).
  2. Cross-check against DTOs/Models.ComeGo vacation entries in the app decompilation's data_models.md.
  3. Check the permission gate: PresenceModule.VACATION already exists in models/presence.py, so PresenceConfiguration.can_edit(PresenceModule.VACATION) should gate the command exactly as report_sick gates report-sick.

Then: AulaApiClient.add_vacation(...), a CLI command (aula register-absence or a --add mode on aula vacations), the confirmation and --yes pattern used by the other writes, and tests covering the payload plus the permission skip.

Context

Found while grounding the sick report in #63. Deliberately left out of that PR to keep one write per change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions