Skip to content

Add multiple aircraft per account (fleets) - #58

Merged
dannysusername merged 1 commit into
mainfrom
newfeature
Nov 9, 2026
Merged

dannysusername merged 1 commit into
mainfrom
newfeature

Conversation

@dannysusername

Copy link
Copy Markdown
Owner

One account can now track up to 25 aircraft. Each plane has its own info card, block time and time in service (with manual floors), service timeline, and log book.

  • Data: new aircraft table; timeline rows, flights, suggestions, subscriptions and import proposals point at an aircraft (and keep user_id for ownership checks).
  • Existing accounts: AircraftBackfill runs on boot and turns each account into its first aircraft, and drops the old one-subscription-per-user constraint. Idempotent. Checked on a copy of a local PostgreSQL DB: all rows, order, hours and floors carried over; second boot changed nothing. Legacy users columns stay one release (see docs/migrations/2026-11-09_multi_aircraft.sql).
  • Safety: every dashboard request sends the aircraft on screen (X-Aircraft-Id), checked against the signed-in owner in one resolver. Another account's aircraft is a 404; two tabs on two planes can't mix.
  • UI: header plane picker with overdue / due-soon counts. Add aircraft in 3 taps on a phone (tail number only, 16px input, Save stays above the keyboard). Remove asks for the tail number; the last plane can't be removed.
  • Other features: one alert email for the whole fleet, grouped by tail. PDF covers the plane on screen. Flight sync per plane. MCP gets list_aircraft, and imports name their target aircraft.
  • Small fixes: removed the empty-timeline "Import with AI" prompt; narrow headers show Share / Import with AI as icons; / now redirects to /dashboard instead of a 404 when signed in.

After deploy: check the boot log for Aircraft backfill: N users, M rows attached on staging before promoting.

Tests: 211 unit/integration, 82 browser.

One account can now track up to 25 aircraft. Each plane has its own info
card, block time and time in service (with their manual floors), service
timeline, and log book.

- New Aircraft entity. Per-plane fields move off User; timeline rows,
  flights, flight suggestions, subscriptions and import proposals point
  at an aircraft and keep user_id for ownership checks.
- AircraftBackfill runs on boot: each existing account's data becomes its
  first aircraft, and the old one-subscription-per-user constraint is
  dropped. Idempotent; checked against a copy of a PostgreSQL database.
  The legacy users columns stay one release (see the migration note).
- Every dashboard request carries the aircraft on screen (X-Aircraft-Id),
  ownership-checked in one resolver, so two tabs on two planes can't mix.
- Header plane picker with overdue / due-soon counts. Add aircraft works
  in 3 taps on a phone (tail number only, 16px input, Save above the
  keyboard). Remove asks for the tail number; the last plane can't go.
- Alerts send one email for the whole fleet, grouped by tail number. PDF
  covers the plane on screen; flight sync is per plane.
- MCP: new list_aircraft tool; imports name their target aircraft.
- Removes the empty-timeline "Import with AI" prompt; narrow headers show
  Share / Import with AI as icons. The bare / address now redirects to
  /dashboard instead of a 404.
@dannysusername
dannysusername merged commit b91bace into main Nov 9, 2026
4 checks passed
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