Skip to content

Fix driver route export import#213

Open
hir-al-14 wants to merge 4 commits into
benevolentbandwidth:mainfrom
hir-al-14:fix-driver-route-export-import
Open

Fix driver route export import#213
hir-al-14 wants to merge 4 commits into
benevolentbandwidth:mainfrom
hir-al-14:fix-driver-route-export-import

Conversation

@hir-al-14

Copy link
Copy Markdown
Contributor

Summary

  • Driver Assist can now import the exact JSON file exported from a single route on the Results page.
  • Existing Driver Assist upload formats still work.

Motivation

  • A route exported from Results should be usable by the driver without manual editing.
  • Before this change, Results exported a Route JSON shape, but Driver Assist only accepted session-save or raw session data JSON.

Changes

  • Frontend:

    • Added support for Results page route export JSON in the Driver Assist importer.
    • Maps exported route stops into Driver Assist stops:
      • sequence -> route order
      • addresseeName -> customer name
      • phoneNumber -> phone number
      • capacityUsed -> package count
      • note -> notes
      • lat / lng -> navigation coordinates
    • Updated /upload-route and /driver_assist to use the same Driver Assist route parser.
    • Kept existing session-save envelope and raw session data imports working.
    • Added regression coverage for importing a Results route export.
  • Backend:

    • No backend changes.

Validation

Frontend

  • npm.cmd --prefix app/ui run lint
  • npm.cmd --prefix app/ui run format:check
  • npm.cmd --prefix app/ui run typecheck
  • npm.cmd --prefix app/ui run test
  • npm.cmd --prefix app/ui run build
  • npm.cmd --prefix app/mobile run lint
  • npm.cmd --prefix app/mobile run typecheck

Backend

  • cmake --preset dev
  • .github/scripts/check-backend-static.sh build/dev
  • cmake --build --preset dev --parallel
  • ctest --preset dev --output-on-failure --no-tests=error -LE 'e2e|docker'

Risk

  • Low risk.
  • Change is limited to Driver Assist route import parsing.
  • Existing accepted upload formats are preserved.
  • Results export format is not changed.

Rollout and Recovery

  • Roll out normally with the frontend deploy.
  • If anything looks wrong, revert this PR. Existing session-save and raw session imports should return to the old behavior.

High-Signal PR Checklist

  • The summary states the user-visible or operational outcome, not just file names.
  • The motivation explains why this change is needed now.
  • The change list separates frontend, backend, infrastructure, and documentation work where applicable.
  • Validation includes exact commands run, relevant output, and any checks intentionally skipped.
  • Risks, migrations, feature flags, and rollback steps are called out when relevant.
  • Screenshots or request/response examples are included for UI and API behavior changes.

Related Issues

#199

  • Exporting a route from Results and uploading that file to Driver Assist populates the route.
  • Stops keep the correct order, address, recipient name, phone number, package count, notes, and coordinates.
  • Navigation uses exported lat / lng.
  • Existing session-save and raw session data uploads still work.
  • Invalid/unrecognized JSON still shows a validation error.
  • Regression test added for importing a Results route export.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant