fix(validation): reject non-positive time-entry duration_minutes (PMS-384) #291

Merged
vas2000-work merged 2 commits from fix/PMS-384-time-entry-duration-validation into main 2026-06-17 02:31:15 +02:00
Owner

A directly-supplied duration_minutes bypassed the service's start/end negativity guard, so a negative value was stored and corrupted timesheet sums and total_amount. Add #[validate(range(min = 1))] on Create/Update TimeEntryRequest so the request layer rejects it with a 422.

Verified in-container (just pre-commit): fmt + clippy + check + unit + doc tests green.

Fixes PMS-384.

A directly-supplied duration_minutes bypassed the service's start/end negativity guard, so a negative value was stored and corrupted timesheet sums and total_amount. Add #[validate(range(min = 1))] on Create/Update TimeEntryRequest so the request layer rejects it with a 422. Verified in-container (just pre-commit): fmt + clippy + check + unit + doc tests green. Fixes PMS-384.
fix(validation): reject non-positive time-entry duration_minutes
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 1m25s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 2m40s
Integration / integration tests (pull_request) Successful in 5m2s
87598da7a5
A directly-supplied duration_minutes bypassed the service's start/end
negativity guard, so a negative value was stored and corrupted timesheet
sums and total_amount. Add #[validate(range(min = 1))] to
duration_minutes on Create/Update TimeEntryRequest so the request layer
rejects it with a 422 (the < 0 service guard only fired on the computed
start/end path).

#PMS-384

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge branch 'main' into fix/PMS-384-time-entry-duration-validation
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
E2E / Playwright against staging (pull_request) Successful in 45s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 1m54s
Integration / integration tests (pull_request) Successful in 7m57s
f7366bf557
vas2000-work deleted branch fix/PMS-384-time-entry-duration-validation 2026-06-17 02:31:15 +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!291
No description provided.