Auto-fill aircraft type and airline from tail number #2
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/tail-number-aircraft-lookup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Enter or edit a tail number on the flight form and the aircraft is looked up by registration via AeroDataBox
/aircrafts/reg, auto-filling:aircraft_typerow by ICAO → IATA; inserts a new row when the type isn't seeded yet but has a real ICAO code. Always overwrites the field (registration is authoritative).Reuses the existing cached
getAircraftByReglookup (in-memory + 30-day DB cache + API-call logging).Changes
_enrichment-internal.ts: extractresolveAircraftType()(now optionally inserts), addmatchAirlineByName()+runEnrichAircraftByReg();buildPrefillkeeps its existing no-insert behavior.enrichment.ts: newenrichAircraftByRegPOST server fn, gated byrequireUserId.flight-form.tsx: tail-numberonBlurenrichment with spinner/note, request-id guard + dedup.pnpm typecheck,pnpm lint,pnpm test(23/23) all pass.