fix(sla): validate target hours, rejecting negatives and junk (MAPPS-239) #238

Merged
vas2000-work merged 2 commits from fix/MAPPS-239-sla-target-hours-validation into main 2026-06-17 02:34:41 +02:00
Owner

SLA target-hours inputs are free text (H:MM + fractional, PMS-340); parse_hours mapped both empty and unparseable to None, so negatives saved and junk was silently dropped under a success toast. Add validate_hours: empty -> None, non-empty must parse and be non-negative else the save is rejected with an error toast.

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

Fixes MAPPS-239.

SLA target-hours inputs are free text (H:MM + fractional, PMS-340); parse_hours mapped both empty and unparseable to None, so negatives saved and junk was silently dropped under a success toast. Add validate_hours: empty -> None, non-empty must parse and be non-negative else the save is rejected with an error toast. Verified in-container (just pre-commit): fmt + clippy + wasm check + unit tests green. Fixes MAPPS-239.
fix(sla): validate target hours, rejecting negatives and junk
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 22s
7b2e5026a7
The SLA target-hours inputs are free text (to allow H:MM and fractional
hours, PMS-340), and parse_hours mapped both empty and unparseable input
to None - so a negative value was saved and unparseable junk was silently
dropped under a "Target saved" success toast. Add validate_hours: empty
stays None, but a non-empty value must parse and be non-negative or the
save is rejected with an error toast.

#MAPPS-239

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
style(sla): rustfmt block-wrap the long validate_hours error arm
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 2m2s
Create release / Create release from merged PR (pull_request) Has been skipped
184f90d23e
The None match arm exceeded the line width; block-wrap it to satisfy
cargo fmt --all --check (the check.yml fmt gate).

#MAPPS-239

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vas2000-work deleted branch fix/MAPPS-239-sla-target-hours-validation 2026-06-17 02:34:41 +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-apps!238
No description provided.