Description
This task addresses the regression where the client-side session save/load utilities (exportSession.ts, importSession.ts, and session.schema.ts originally introduced in PRs #55 and #56) were dropped from the main branch. We need to reintroduce these files and build the necessary linking layer to connect them to the current /edit page state. This will enable a versioned JSON save format (version, savedAt, and data). The linking logic must handle data transformation: exporting requires validating the form state, geocoding addresses, and mapping the UI state into an OptimizeRequest payload. Conversely, importing requires parsing the validated JSON and mapping the OptimizeRequest back into the corresponding vehicle and delivery form rows on the Edit screen.
Scope
- Reinstating
exportSession.ts, importSession.ts, and session.schema.ts.
- Implementing the export linking logic: form state validation, geocoding vehicle start locations and delivery addresses, and mapping state to the
OptimizeRequest payload via downloadSessionSave.
- Implementing the import linking logic: validating the JSON, parsing the payload, and mapping the data back into the edit page's form state.
- Wiring the Import and Export actions to the existing UI error-handling components.
Goal
To guarantee that Route Managers using our stateless PWA can reliably save their complex route setups locally and resume them later, ensuring data integrity through versioned, validated JSON payloads.
Acceptance Criteria
Description
This task addresses the regression where the client-side session save/load utilities (
exportSession.ts,importSession.ts, andsession.schema.tsoriginally introduced in PRs #55 and #56) were dropped from the main branch. We need to reintroduce these files and build the necessary linking layer to connect them to the current/editpage state. This will enable a versioned JSON save format (version,savedAt, anddata). The linking logic must handle data transformation: exporting requires validating the form state, geocoding addresses, and mapping the UI state into anOptimizeRequestpayload. Conversely, importing requires parsing the validated JSON and mapping theOptimizeRequestback into the corresponding vehicle and delivery form rows on the Edit screen.Scope
exportSession.ts,importSession.ts, andsession.schema.ts.OptimizeRequestpayload viadownloadSessionSave.Goal
To guarantee that Route Managers using our stateless PWA can reliably save their complex route setups locally and resume them later, ensuring data integrity through versioned, validated JSON payloads.
Acceptance Criteria
.jsonfile to the user's device.route-save-YYYYMMDD-HHMM.json) to prevent users from accidentally overwriting previous saves..jsonfile contains a properly versioned and validated session payload, explicitly includingversion,savedAt, and dataproperties.OptimizeRequeststructure.OptimizeRequestpayload and perfectly repopulates the vehicles and deliveries into the edit page form rows.Assignee @hir-al-14