Skip to content

Add AAO engine, recommendations, and dispatch quality checks - #2

Open
ByteBand1t wants to merge 1 commit into
mainfrom
codex/implement-aao-engine-and-automatic-dispatch
Open

ByteBand1t wants to merge 1 commit into
mainfrom
codex/implement-aao-engine-and-automatic-dispatch

Conversation

@ByteBand1t

Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple, extensible AAO rule system that maps incident keywords to required vehicle types and surface automatic dispatch suggestions in the incident UI.
  • Allow quick assignment of available recommended units and give a small validation metric for dispatch quality without refactoring milestone 1 behavior.

Description

  • Added src/lib/aaoRules.ts containing a configurable mapping of incident keywords to required VehicleType[] (examples: NOTF, NOTF NA, FEU K, FEU, FEUY).
  • Extended the Zustand store in src/store/dispatch-store.ts with getRecommendedVehicles(incidentId), dispatchRecommended(incidentId), and validateDispatch(incidentId) plus a DispatchQuality type and a small countTypes helper to compare assigned vs recommended types.
  • Implemented AAO-aware quick-dispatch that only selects vehicles with status 1 or 2, assigns them (sets status to 3), and appends radio-log entries; the action skips unavailable units without failing.
  • Updated the incident detail UI (src/components/incidents/incident-detail.tsx) to add an "AAO Recommendations" section that shows recommended types, available matching vehicle instances, a Dispatch Recommended button, and a dispatch quality badge.
  • Updated seed data (prisma/seed.ts and in-memory seeds) to include incidents for NOTF, FEU K, and FEUY and to add vehicles including an ELW and an unavailable unit to exercise filtering.

Testing

  • Ran npm run lint which failed in this environment with next: not found because project dependencies are not installed.
  • Ran npm install which failed due to a 403 Forbidden response from the npm registry in this environment, so dependency installation and further automated checks were blocked.
  • No other automated tests were executed in the current environment due to the dependency/registry limitations.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant