feat(sla): business-hours-aware SLA clock engine (PMS-106) #72

Merged
vas2000-work merged 3 commits from feat/pms-106-sla-clock into main 2026-06-05 04:12:56 +02:00
Owner

Implements PMS-106 core. New pure tz-aware clock engine (src/modules/sla/clock.rs): due_at consumes only working minutes, skipping nights/weekends/holidays, with a 24x7 wall-clock path. Extensive unit tests (101 lib tests incl. weekend skip, holiday mid-span, fractional hours, DST, NY tz). evaluate_for_ticket resolves policy (contract sla_id else tenant default) + computes first_response_due/resolution_due via the engine. Adds chrono-tz. tests/sla.rs integration test green. Breach/at-risk notification dispatch deferred (SlaService has no NotificationsService handle; follow-up). clippy -D warnings clean.

Implements PMS-106 core. New pure tz-aware clock engine (src/modules/sla/clock.rs): due_at consumes only working minutes, skipping nights/weekends/holidays, with a 24x7 wall-clock path. Extensive unit tests (101 lib tests incl. weekend skip, holiday mid-span, fractional hours, DST, NY tz). evaluate_for_ticket resolves policy (contract sla_id else tenant default) + computes first_response_due/resolution_due via the engine. Adds chrono-tz. tests/sla.rs integration test green. Breach/at-risk notification dispatch deferred (SlaService has no NotificationsService handle; follow-up). clippy -D warnings clean.
feat(sla): business-hours-aware SLA clock engine (PMS-106)
All checks were successful
Check / fmt + clippy + compile + tests (pull_request) Successful in 1m9s
Build OCI container / Build and push mokosh-api image (push) Successful in 3m15s
6bd23e49d0
PMS-106: replace the 24x7-only stub with a real SLA due-time engine. New pure, timezone-aware engine in src/modules/sla/clock.rs computes a due timestamp by consuming only working minutes from a weekly business-hours schedule, skipping nights, weekends and holiday dates, with a wall-clock path for 24x7 targets. It is the correctness core of the story and is covered by extensive unit tests (mid-window start, before-open/after-close roll-over, Friday to Monday weekend skip, holiday mid-span, fractional hours, exact-boundary, DST, America/New_York).

evaluate_for_ticket now resolves the applicable policy (ticket contract sla_id else the tenant default), loads the policy business hours + referenced holiday calendars, and computes first_response_due / resolution_due via the engine using each target's operational_hours. Adds chrono-tz.

Integration test tests/sla.rs asserts a Friday-late start lands on the next working day across a weekend. Breach/at-risk notification dispatch is deferred: SlaService is constructed without a NotificationsService; wiring it (Arc<NotificationsService> + dispatch "sla.breached"/"sla.at_risk") is a follow-up.

#PMS-106

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into feat/pms-106-sla-clock
All checks were successful
Check / fmt + clippy + compile + tests (pull_request) Successful in 1m18s
Build OCI container / Build and push mokosh-api image (push) Successful in 3m35s
d807030ed6
Merge branch 'main' into feat/pms-106-sla-clock
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + compile + tests (pull_request) Successful in 1m12s
Build OCI container / Build and push mokosh-api image (push) Successful in 3m33s
bc9e86a330
vas2000-work deleted branch feat/pms-106-sla-clock 2026-06-05 04:12:56 +02:00
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!72
No description provided.