test(projects): pin oversized-budget 422 and company-id injection safety #283
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-316-project-budget-oversize-and-safe-company-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PMS-324 already added the request-layer budget validators (
validate_budget_amount/validate_budget_hours) and numeric-budget deserialization, so an oversized Budget Amount or Budget Hours is rejected with a controlled 422 instead of the 500 numeric-overflow / raw deserialization 422 the issue reports. The end-to-end suite, however, only exercised the negative / over-precise / non-numeric cases, never the over-the-column-limit boundary, and nothing pinned that a SQL-injection-shaped company value cannot reach the parameterized query.This adds
project_oversized_budget_and_safe_company_id, covering the PMS-316 acceptance criteria that were not yet guarded: budgets at the DECIMAL column maxima create cleanly, a budget_amount above DECIMAL(12, 2) and a budget_hours above DECIMAL(10, 2) each return 422 (not 500) on the create path, a non-UUID company_id (ZQA'); DROP TABLE companies;--) is rejected at request extraction because the field is a typed Option, and a normal create against the real company id still succeeds afterward (the companies table is intact). Frontend field-level validation and the form max-value constraints live in the mokosh-apps repo and are out of scope for this backend change.#PMS-316