Description
On the Manage (/edit) page, saving a session reuses the same mapper as the optimize
flow. handleExportSession in page.tsx calls
mapEditStateToOptimizeRequest, which validates and geocodes each vehicle's start location
in sessionMapper.ts. Because the
starting location is only collected during optimization (via the "Enter starting location
for all driver routes" overlay), it is empty at save time and the mapper throws an error
about the missing starting location. This blocks a root manager from saving their work,
even though saving should not require a start location at all.
Goal
Allow a root manager to save their session from the Manage page without having entered a
starting location.
Reproduction
Steps
- Go to the Manage page (
/edit) from a clean state, without running optimization.
- Fill out all required information (vehicles and delivery addresses), confirming each row.
- Click "Save" in the top corner (Navbar / mobile bottom bar).
Expected: The session is saved (exported) successfully.
Actual: An error appears stating the starting location has not been entered, and the
session is not saved.
Environment: branch main. Affected files: app/ui/src/app/edit/page.tsx,
app/ui/src/app/edit/utils/sessionMapper.ts.
Scope
In scope
- Decouple the save/export path from the start-location requirement so it succeeds without
a starting location.
- Ensure saved sessions handle missing vehicle start locations gracefully (e.g. omit /
leave them blank) so they can be re-imported and later optimized.
Out of scope
- The optimize flow's start-location requirement and the depot address overlay (these
should still require a start location before optimizing).
- Any redesign of the session save file schema beyond what's needed to allow an absent
start location.
Acceptance Criteria
Assignee
@hir-al-14
Description
On the Manage (
/edit) page, saving a session reuses the same mapper as the optimizeflow.
handleExportSessionin page.tsx callsmapEditStateToOptimizeRequest, which validates and geocodes each vehicle's start locationin sessionMapper.ts. Because the
starting location is only collected during optimization (via the "Enter starting location
for all driver routes" overlay), it is empty at save time and the mapper throws an error
about the missing starting location. This blocks a root manager from saving their work,
even though saving should not require a start location at all.
Goal
Allow a root manager to save their session from the Manage page without having entered a
starting location.
Reproduction
Steps
/edit) from a clean state, without running optimization.Expected: The session is saved (exported) successfully.
Actual: An error appears stating the starting location has not been entered, and the
session is not saved.
Environment: branch
main. Affected files:app/ui/src/app/edit/page.tsx,app/ui/src/app/edit/utils/sessionMapper.ts.Scope
In scope
a starting location.
leave them blank) so they can be re-imported and later optimized.
Out of scope
should still require a start location before optimizing).
start location.
Acceptance Criteria
and no longer shows the "starting location not entered" error.
Assignee
@hir-al-14