fix(billing): validate New Invoice fields client-side #217

Merged
nrupard merged 2 commits from fix/MAPPS-214-invoice-form-validation into main 2026-06-16 16:26:35 +02:00
Owner

The New Invoice form let several bad line/header values through to an opaque 422. Add step="0.01" and min="0" to Unit Price so it accepts cents and rejects negatives, step="0.01"/min="0" to Quantity, and a submit-time check that flags a negative Quantity/Unit Price at the field instead of only in the generic banner. Add a Due Date >= Invoice Date check (ISO date lexicographic compare) that surfaces a field message before submit. Add client maxlength to Description (1000), PO Number (100), and Notes (2000) matching the server validator caps, and add the missing po_number/notes length validators on the invoice create/from-time-entries/update requests so client and server agree. Add maxlength props to the shared Input and Textarea components.

#MAPPS-214

The New Invoice form let several bad line/header values through to an opaque 422. Add `step="0.01"` and `min="0"` to Unit Price so it accepts cents and rejects negatives, `step="0.01"`/`min="0"` to Quantity, and a submit-time check that flags a negative Quantity/Unit Price at the field instead of only in the generic banner. Add a Due Date >= Invoice Date check (ISO date lexicographic compare) that surfaces a field message before submit. Add client `maxlength` to Description (1000), PO Number (100), and Notes (2000) matching the server validator caps, and add the missing `po_number`/`notes` length validators on the invoice create/from-time-entries/update requests so client and server agree. Add `maxlength` props to the shared Input and Textarea components. #MAPPS-214
fix(billing): validate New Invoice fields client-side
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 57s
347369ef2a
The New Invoice form let several bad line/header values through to an opaque 422. Add `step="0.01"` and `min="0"` to Unit Price so it accepts cents and rejects negatives, `step="0.01"`/`min="0"` to Quantity, and a submit-time check that flags a negative Quantity/Unit Price at the field instead of only in the generic banner. Add a Due Date >= Invoice Date check (ISO date lexicographic compare) that surfaces a field message before submit. Add client `maxlength` to Description (1000), PO Number (100), and Notes (2000) matching the server validator caps, and add the missing `po_number`/`notes` length validators on the invoice create/from-time-entries/update requests so client and server agree. Add `maxlength` props to the shared Input and Textarea components.

#MAPPS-214
Merge remote-tracking branch 'origin/main' into fix/MAPPS-214-invoice-form-validation
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m8s
Create release / Create release from merged PR (pull_request) Has been skipped
84d0c03c13
# Conflicts:
#	src/components/form.rs
nrupard deleted branch fix/MAPPS-214-invoice-form-validation 2026-06-16 16:26:35 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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!217
No description provided.