feat(calendar): finish PMS-58 story (appointments, availability, time-off, on-call) #28

Closed
David wants to merge 0 commits from feat/calendar-story-pms-58 into main
Owner

Implements YouTrack story PMS-58 (calendar / scheduling). Targets main.

Sub-tasks

  • PMS-59 scaffold (extends existing calendar module with models.rs + service.rs).
  • PMS-60 appointments CRUD.
  • PMS-61 user availability replacement.
  • PMS-62 time off with manager-only approval workflow.
  • PMS-63 on-call schedules CRUD + GET /on-call/now resolver (weekly / daily rotation math; custom is owner-defined).

Behaviour-visible changes

  • /api/v1/appointments*, /api/v1/users/:id/availability, /api/v1/time-off*, /api/v1/on-call-schedules*, /api/v1/on-call/now move from 501 to real reads/writes.
  • /api/v1/calendar/events still returns the empty placeholder vec.

Test plan

  • cargo check --bin mokosh-server clean.
  • Smoke: POST /appointments then GET /appointments?user_id=<id> returns it.
  • Smoke: PUT /users/:id/availability {"windows": [...]} then GET round-trips.
  • Smoke: POST /time-off -> POST /time-off/:id/approval {"status":"approved"} flips the status.

Closes #PMS-58

Implements YouTrack story PMS-58 (calendar / scheduling). Targets `main`. ## Sub-tasks - PMS-59 scaffold (extends existing `calendar` module with `models.rs` + `service.rs`). - PMS-60 appointments CRUD. - PMS-61 user availability replacement. - PMS-62 time off with manager-only approval workflow. - PMS-63 on-call schedules CRUD + `GET /on-call/now` resolver (weekly / daily rotation math; custom is owner-defined). ## Behaviour-visible changes - `/api/v1/appointments*`, `/api/v1/users/:id/availability`, `/api/v1/time-off*`, `/api/v1/on-call-schedules*`, `/api/v1/on-call/now` move from 501 to real reads/writes. - `/api/v1/calendar/events` still returns the empty placeholder vec. ## Test plan - [ ] `cargo check --bin mokosh-server` clean. - [ ] Smoke: `POST /appointments` then `GET /appointments?user_id=<id>` returns it. - [ ] Smoke: `PUT /users/:id/availability {"windows": [...]}` then `GET` round-trips. - [ ] Smoke: `POST /time-off` -> `POST /time-off/:id/approval {"status":"approved"}` flips the status. Closes #PMS-58
feat(calendar): scaffold + appointments, availability, time-off, on-call
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
24ddf81093
PMS-58 batch (per-task splitting would have been arbitrary churn across `service.rs` / `routes.rs`):

- PMS-59 scaffold: adds `models.rs` and `service.rs` to the existing calendar module; `calendar_routes()` now takes a `CalendarService` and is mounted via `merge` so the route paths stay top-level. The legacy `/calendar/events` placeholder still returns an empty vec.
- PMS-60 appointments CRUD: `/appointments[/:id]` with `user_id` / type / date-range filter. Rejects `end_time < start_time`.
- PMS-61 user availability: `GET / PUT /users/:user_id/availability` replaces the whole week atomically. Non-admins can only edit their own.
- PMS-62 time off: `GET / POST /time-off`, `GET / DELETE /time-off/:id`, `POST /time-off/:id/approval` (manager-only approval workflow; status `approved | rejected`).
- PMS-63 on-call: schedules CRUD + `GET /on-call/now`. The resolver picks the current rotation slot for `weekly` (ISO week mod N) and `daily` (day-of-year mod N) rotation types, falling back to the first user_id for `custom`. Custom rotation math is intentionally deferred.

#PMS-59 State Done
#PMS-60 State Done
#PMS-61 State Done
#PMS-62 State Done
#PMS-63 State Done
vas2000-work closed this pull request 2026-05-21 02:42:56 +02:00
Some checks are pending
Create release / Create release from merged PR (pull_request) Has been skipped
Check / * (pull_request)
Required
E2E / * (pull_request)
Required

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!28
No description provided.