Summary
On /visualize/planner, enabling a Price change or Promotion assumption but leaving its From / To date inputs blank submits empty strings, and the backend rejects the request with an RFC 7807 422 (4 validation errors). The error is shown gracefully in red below Run simulation (no crash), but a user has no in-form signal that the dates are required.
Steps to reproduce
- Open
/visualize/planner, let a baseline predict job auto-select.
- Tick Price change (and/or Promotion) — leave the From/To date fields empty.
- Click Run simulation.
- Backend returns
422 — Request validation failed with 4 error(s).
Root cause
buildAssumptions() in frontend/src/pages/visualize/planner.tsx always sends start_date / end_date from the form state, which initialise to '' (useState('') at lines ~82-88). Empty strings fail the Pydantic date validation on PriceAssumption / PromotionAssumption.
Suggested fix
Either:
- Default
priceStart/priceEnd/promoStart/promoEnd to the forecast window (baseline train_end + 1 … + horizon) once a baseline job is selected; or
- Disable Run simulation / show inline field validation until an enabled assumption has both dates filled.
Found by
Real-browser dogfood of PRP-27 (/visualize/planner) on dev after PR #227.
Summary
On
/visualize/planner, enabling a Price change or Promotion assumption but leaving its From / To date inputs blank submits empty strings, and the backend rejects the request with an RFC 7807422(4 validation errors). The error is shown gracefully in red below Run simulation (no crash), but a user has no in-form signal that the dates are required.Steps to reproduce
/visualize/planner, let a baseline predict job auto-select.422—Request validation failed with 4 error(s).Root cause
buildAssumptions()infrontend/src/pages/visualize/planner.tsxalways sendsstart_date/end_datefrom the form state, which initialise to''(useState('')at lines ~82-88). Empty strings fail the Pydantic date validation onPriceAssumption/PromotionAssumption.Suggested fix
Either:
priceStart/priceEnd/promoStart/promoEndto the forecast window (baselinetrain_end + 1…+ horizon) once a baseline job is selected; orFound by
Real-browser dogfood of PRP-27 (
/visualize/planner) ondevafter PR #227.