diff --git a/README.md b/README.md
index 8017766..790f263 100644
--- a/README.md
+++ b/README.md
@@ -12,13 +12,13 @@ No install, no setup, nothing to download. Register a username + password and yo
A multi-user maintenance and flight-hours tracker for general-aviation aircraft owners:
-- **Service timeline** — track every recurring maintenance item (annual, transponder/pitot-static tests, VOR checks, oil changes, etc.) on a **calendar cycle** (days/months/years) *or* an **engine-hours cycle**. Each row shows last-done, next-due, and live "time left," and a one-click **Complete Maintenance** button rolls the dates and hours forward automatically.
-- **Hours tracking** — block time and time in service, each with a manual baseline "floor," so log-book activity can only ever raise the displayed hours, never silently lower them.
-- **Log book** — record flights by hand (from/to airport, block time and time in service out and in) **or import a Garmin avionics CSV** and let the app derive block time (oil pressure > 15 psi) and airborne time (groundspeed > 35 kt) for you.
+- **Status Sheet** — track every recurring maintenance item (annual, transponder/pitot-static tests, VOR checks, oil changes, etc.) on a **calendar cycle** (days/months/years) *or* an **engine-hours cycle**. Each row shows last-done, next-due, and live "time left." Enter a Last Done date or hours and the **Due Date fills in automatically** from the cycle (a Due Date you typed yourself is never overwritten), and **Mark complete** asks when the work was done (starting from the Due Date), then rolls the Due Date and hours forward one cycle from there. Hours always show a decimal (25.0).
+- **Hours tracking** — Hobbs time and time in service, each with a manual baseline "floor," so log-book activity can only ever raise the displayed hours, never silently lower them.
+- **Log book** — record flights by hand (from/to airport, Hobbs time and time in service out and in) **or import a Garmin avionics CSV** and let the app derive Hobbs time (oil pressure > 15 psi) and airborne time (groundspeed > 35 kt) for you.
- **Aircraft info card** — make/model, tail number, owner, and serial number, editable inline.
-- **Fleets** — track up to 25 aircraft in one account. Each plane has its own info card, hours, service timeline, and log book; a picker in the header switches between them and shows which ones have items overdue or due soon.
+- **Fleets** — track up to 25 aircraft in one account. Each plane has its own info card, hours, Status Sheet, and log book; a picker in the header switches between them and shows which ones have items overdue or due soon.
-Each account is fully isolated — its own aircraft, service timelines, flight logs, and custom maintenance descriptions. Ownership is enforced server-side on every write, and every request names the aircraft it is for, so an action always lands on the plane on screen.
+Each account is fully isolated — its own aircraft, Status Sheets, flight logs, and custom maintenance descriptions. Ownership is enforced server-side on every write, and every request names the aircraft it is for, so an action always lands on the plane on screen.
## Using it
@@ -26,13 +26,13 @@ Each account is fully isolated — its own aircraft, service timelines, flight l
2. **Fill in your aircraft info** — make/model, tail number, owner, serial.
- **More than one plane?** Tap the aircraft button in the header → **Add aircraft**, type the tail number, **Save**. You land on the new plane, ready for its first maintenance item. Switch planes from the same button; Aviary remembers the last one you looked at.
- Maintenance alerts stay account-wide: one email covers every plane, grouped by tail number.
-3. **Build your service timeline** — add maintenance items with a calendar or hours cycle. Rows are drag-reorderable, and you can insert title rows to group them.
-4. **Set your hours** — enter current block time and time in service manually, or let the log book keep them current.
+3. **Build your Status Sheet** — add maintenance items with a calendar or hours cycle. Rows are drag-reorderable, and you can insert title rows to group them.
+4. **Set your hours** — enter current Hobbs time and time in service manually, or let the log book keep them current.
5. **Log flights** — add entries by hand, or upload a Garmin CSV and Aviary computes the times and updates your meters.
## Connect an AI assistant
-Aviary is also an MCP server, so an AI assistant can import your existing maintenance records — a spreadsheet, a typed list, another tracker's export — into your service timeline.
+Aviary is also an MCP server, so an AI assistant can import your existing maintenance records — a spreadsheet, a typed list, another tracker's export — into your Status Sheet.
The easiest way in is the **Import with AI** button on the dashboard — it shows the address with a Copy button and these same steps.
@@ -48,7 +48,7 @@ You sign in on Aviary's own login page; the assistant never sees your password.
1. Give the assistant your records — paste a list or attach a spreadsheet — and ask it to import them into Aviary. If you track more than one aircraft, say which tail number they're for (the assistant can list your aircraft).
2. It shows you a **proposal** first: the items it will add, anything flagged for you to check (unclear dates, no due date, items you already have), and any rows it couldn't use and why.
-3. Tell it to go ahead. The items are added to the bottom of your service timeline. Nothing is added before you confirm, and existing items are never changed or deleted.
+3. Tell it to go ahead. The items are added to the bottom of your Status Sheet. Nothing is added before you confirm, and existing items are never changed or deleted.
Any row with a name can be imported — including on-condition items with no dates. Values that can't be used are left blank with a note.
@@ -131,10 +131,10 @@ push to main
| Tool | What it does |
|---|---|
| `get_import_format` | Item fields, rules, and an example |
-| `list_service_timeline` | The owner's current items |
-| `propose_timeline_import` | Validates items into a proposal (24 h); changes nothing |
+| `list_status_sheet` | The owner's current items |
+| `propose_status_sheet_import` | Validates items into a proposal (24 h); changes nothing |
| `continue_poor_fit` | Continues a proposal where most rows didn't fit, after the owner agrees |
-| `confirm_timeline_import` | Adds exactly the proposal's items, all or nothing |
+| `confirm_status_sheet_import` | Adds exactly the proposal's items, all or nothing |
| `list_flights` | The owner's logged flights |
**Config:** `aviary.oauth.issuer` (env `AVIARY_OAUTH_ISSUER`) is the site's public URL; the MCP address is that plus `/mcp`. It defaults to `http://localhost:8080` locally and `https://aviary.danielibarra.com` on Heroku — set it on staging to the staging URL, or sign-in there points at production.
@@ -163,12 +163,12 @@ Design and contract: [specs/004-public-aviary-stats/](specs/004-public-aviary-st
The app is a small, conventional Spring MVC project under `src/main/java/com/example/AviaryService/`:
-- **`controllers/UserController.java`** — every route: auth pages, the dashboard, timeline CRUD + reordering, hours updates, flight-log CRUD, the Garmin CSV parser, and "Complete Maintenance."
-- **`entity/`** — `User`, `ServiceTimeline`, `FlightLog`, `DescriptionOption` (+ a `DTO/` for timeline updates).
+- **`controllers/UserController.java`** — every route: auth pages, the dashboard, Status Sheet CRUD + reordering, hours updates, flight-log CRUD, the Garmin CSV parser, and "Complete Maintenance."
+- **`entity/`** — `User`, `StatusSheetItem`, `FlightLog`, `DescriptionOption` (+ a `DTO/` for Status Sheet updates).
- **`repositories/`** — Spring Data JPA repositories, all scoped by user.
- **`config/`** — `SecurityConfig` (login/logout, BCrypt, per-route access, the `/mcp` bearer-token chain) and `DataSeeder` (the H2 demo data).
- **`oauth/`** — the OAuth authorization server for MCP sign-in (client metadata documents, hashed token storage, token checks).
-- **`mcp/`** — MCP tools; **`services/imports/`** + **`util/TimelineImportRules`** — import proposals, confirm, and the Import with AI page's connections.
+- **`mcp/`** — MCP tools; **`services/imports/`** + **`util/StatusSheetImportRules`** — import proposals, confirm, and the Import with AI page's connections.
- **`resources/templates/`** + **`resources/static/`** — Thymeleaf views and the dashboard's CSS/JS.
Deeper design docs live in **[docs/](docs/)** — see `ARCHITECTURE.md`, `BACKEND.md`, `FRONTEND.md`, `DATABASE.md`, and `BUILD_AND_DEPLOY.md`. A **Share/Export** feature (print / PDF / email / text) is specced in `docs/specs/SHARE_EXPORT_SPEC.md` but not yet built.
diff --git a/docs/architecture/ARCHITECTURE.md b/docs/architecture/ARCHITECTURE.md
index b4f9b40..045e9e9 100644
--- a/docs/architecture/ARCHITECTURE.md
+++ b/docs/architecture/ARCHITECTURE.md
@@ -12,10 +12,10 @@ Spring Boot 3.4.3 · Java 21 · Spring MVC + Security + Data JPA · Thymeleaf ·
## Shape (monolith)
- **One controller** (`UserController`) holds every route. No service layer; controllers talk to repositories directly.
- **4 JPA entities** → 4 tables, all scoped to a `User`.
-- **3 Thymeleaf pages**: `login`, `register`, `dashboard`. The dashboard is the whole app (two tabs: Service Timeline + Log Book).
+- **3 Thymeleaf pages**: `login`, `register`, `dashboard`. The dashboard is the whole app (two tabs: Status Sheet + Log Book).
## Request flow (a typical dashboard edit)
-1. Browser loads `GET /dashboard` → `UserController` fetches the user's timelines, flight logs, hours, aircraft info → Thymeleaf renders `dashboard.html`.
+1. Browser loads `GET /dashboard` → `UserController` fetches the user's Status Sheet items, flight logs, hours, aircraft info → Thymeleaf renders `dashboard.html`.
2. User edits a cell → `dashboard.js` debounces and `POST`s JSON via axios (with the Spring CSRF token from ``) to an endpoint like `/update/{id}`.
3. Controller updates the entity via the repository and returns JSON.
4. "Time Left" is computed **client-side** from the due date + current time in service hours.
@@ -23,8 +23,8 @@ Spring Boot 3.4.3 · Java 21 · Spring MVC + Security + Data JPA · Thymeleaf ·
## Cross-cutting concerns
- **Auth:** Spring Security form login, BCrypt passwords, single `USER` role. See [BACKEND](BACKEND.md#auth).
- **Per-user scoping:** every entity has a `user_id`; queries filter by the authenticated user. See [DATABASE](DATABASE.md).
-- **AI assistants (MCP):** `/mcp` is an MCP server secured by Aviary's own OAuth authorization server (CIMD clients, PKCE, opaque hashed tokens). Assistants preview and import service timeline items; nothing is saved until the owner confirms. See [BACKEND](BACKEND.md#mcp-server--ai-assistant-sign-in).
-- **Hours model:** flight logs roll up into `User.blockTimeHours` / `timeInServiceHours`, which maintenance due-dates count against.
+- **AI assistants (MCP):** `/mcp` is an MCP server secured by Aviary's own OAuth authorization server (CIMD clients, PKCE, opaque hashed tokens). Assistants preview and import Status Sheet items; nothing is saved until the owner confirms. See [BACKEND](BACKEND.md#mcp-server--ai-assistant-sign-in).
+- **Hours model:** flight logs roll up into `User.hobbsTimeHours` / `timeInServiceHours`, which maintenance due-dates count against.
## Known issues (high level — details in the area maps)
- Local dev uses **in-memory H2** (data is lost on restart). See [DATABASE](DATABASE.md).
diff --git a/docs/architecture/BACKEND.md b/docs/architecture/BACKEND.md
index 9b3ae54..3e78612 100644
--- a/docs/architecture/BACKEND.md
+++ b/docs/architecture/BACKEND.md
@@ -28,25 +28,31 @@
| GET | `/register` | — | `register` view | |
| POST | `/register` | `username`, `password` | redirect `/login` | trims username; requires username 3-50 chars `[A-Za-z0-9._-]`, password 8-72 chars; rejects duplicates |
| GET | `/login` | — | `login` view | |
-| GET | `/dashboard` | — | `dashboard` view | loads timelines, flight logs, hours, aircraft info for the auth user |
-| POST | `/dashboard` | JSON timeline fields | row JSON or 302 | adds a Service Timeline row; assigns next `timelineOrder` |
-| POST | `/update/{id}` | `TimelineUpdateDTO` | status JSON | partial update of a timeline row. Ownership checked (403 if not owner) |
-| DELETE | `/delete/{id}` | — | 200 / 403 / 404 | deletes a timeline row. Ownership checked (403 if not owner) |
-| POST | `/updateOrder` | `List` ids | void | reorders timelines; user-scoped, matches ids with `.equals` |
-| POST | `/updateUserInfo` | JSON aircraft fields | status JSON | updates makeModel/tailNumber/ownerName/makeModelSN for auth user |
-| POST | `/updateHours` | `blockTimeToAdd`/`timeInServiceToAdd`/`newBlockTime`/`newTimeInService` | hours JSON | set-or-add block time / time in service. 400 for NaN/Infinity, a negative set value, or an add that would go below 0 (checked before anything changes) |
+| GET | `/dashboard` | — | `dashboard` view | loads Status Sheet items, flight logs, hours, aircraft info for the auth user |
+| POST | `/dashboard` | JSON Status Sheet fields | row JSON or 302 | adds a Status Sheet row; assigns next `statusSheetOrder`. Spec 010: also takes `dueDateAuto`/`dueHoursAuto` from the add row; a part stays auto only if it equals Last Done + cycle; `"false"` with a blank value keeps a removed Due Date blank. |
+| POST | `/update/{id}` | `StatusSheetItemUpdateDTO` (+ `dueDateTouched`, `dueHoursTouched`) | saved row JSON: `lastDoneDate`, `lastDoneHours`, `dueDateDate`, `dueDateHours`, `timeLeft`, `warnings` | update of a Status Sheet row. Ownership checked (403 if not owner). Auto-fills the Due Date from Last Done + cycle (spec 007, `DueDateAutoFill`); hours must be numbers (400 "Hours must be a number, e.g. 25.0"). Both touched flags missing = older dashboard.js, saved as sent. |
+| GET | `/statusSheet/{id}/cyclePreview` | — | `{dueDateDate, dueDateHours, canReset, reason}` | what "Reset to cycle" would set (Last Done + cycle). Ownership checked (403). |
+| POST | `/resetDueToCycle/{id}` | — | saved row JSON (same as `/update`) | sets Due Date = Last Done + cycle, keeps Last Done, marks it auto again. 400 with the reason when there is nothing to reset. Ownership checked (403). |
+| GET | `/statusSheet/{id}/completePreview?doneDate=&doneHours=` | — | `{hasCalendar, hasHours, doneDate, doneHours, nextDueDate, nextDueHours, expectedDueDate, expectedDueHours, canSave, reason}` | spec 008: what the "When was this done?" box starts with (Due Date → Last Done + cycle → today; hours: Due hours → Last Done hours + cycle → empty) and the next Due Date for edited values. Ownership checked (403). |
+| POST | `/statusSheet/addRowResolve` | JSON: previous + current Last Done / cycle, shown Due Date parts, `dueDateAuto`/`dueHoursAuto`, `dueDateTouched`/`dueHoursTouched` | `{dueDateDate, dueDateAuto, dueDateHours, dueHoursAuto, lastDoneHours, warnings}` | spec 010: what the add row's Due Date should show, using the same `DueDateAutoFill` rules as saved rows. Saves nothing. Uses `@CurrentAircraft` (ownership-checked) for the Time in Service note. |
+| POST | `/completeMaintenance/{id}` | `{doneDate, doneHours, expectedDueDate, expectedDueHours}` | saved row JSON | spec 008: Last Done = done date / hours, Due = + cycle (only parts with a cycle and a value). **409** "This row changed. Open it again to review." if the stored Due Date differs from `expected*` (double-click, other tab). Empty body = older page: old today-based behavior. |
+| DELETE | `/delete/{id}` | — | 200 / 403 / 404 | deletes a Status Sheet row. Ownership checked (403 if not owner) |
+| POST | `/updateOrder` | `List` ids | void | reorders Status Sheet items; user-scoped, matches ids with `.equals` |
+| POST | `/updateUserInfo` | JSON aircraft fields | status JSON | updates makeModel/tailNumber/operatorName/makeModelSN for auth user |
+| POST | `/updateHours` | `hobbsTimeToAdd`/`timeInServiceToAdd`/`newHobbsTime`/`newTimeInService` | hours JSON | set-or-add Hobbs time / time in service. 400 for NaN/Infinity, a negative set value, or an add that would go below 0 (checked before anything changes) |
| GET | `/flightlogs` | — | `List` JSON | auth user's logs |
| POST | `/addflightlog` | `FlightLog` JSON | log + new totals JSON | recomputes hours via `calculateMergedHours` |
| DELETE | `/deleteflightlog/{id}` | — | status + new totals | **ownership checked** (403 if not owner) |
| DELETE | `/deleteOption/{id}` | — | text | description option; **ownership checked** (403 if not owner) |
## Key logic
-- **`calculateMergedHours(logs, useBlockTime)`** — sums flight time across all logs by **merging overlapping intervals** so overlapping flights don't double-count. Block time uses `blockTimeOut`/`blockTimeIn`; time in service uses `timeInServiceOut`/`timeInServiceIn`. Result is written back to `User.blockTimeHours`/`timeInServiceHours` on add/delete of a log.
-- **`saveCustomDescriptionOption`** — persists a user's custom Service Timeline "Description" values so they reappear in the dropdown.
-- **Hours "last updated" stamps:** `/updateHours` sets `blockTimeUpdatedAt`/`timeInServiceUpdatedAt` (UTC `Instant`) + `*UpdatedSource = "manual"` for whichever value changed; `/addflightlog` and `/deleteflightlog` set both with source `"flightlog"`. `GET /dashboard` passes the 4 values (timestamps as ISO strings) to the view, which renders them in the browser's local time.
+- **`calculateMergedHours(logs, useHobbsTime)`** — sums flight time across all logs by **merging overlapping intervals** so overlapping flights don't double-count. Hobbs time uses `hobbsTimeOut`/`hobbsTimeIn`; time in service uses `timeInServiceOut`/`timeInServiceIn`. Result is written back to `User.hobbsTimeHours`/`timeInServiceHours` on add/delete of a log.
+- **`saveCustomDescriptionOption`** — persists a user's custom Status Sheet "Description" values so they reappear in the dropdown.
+- **Hours "last updated" stamps:** `/updateHours` sets `hobbsTimeUpdatedAt`/`timeInServiceUpdatedAt` (UTC `Instant`) + `*UpdatedSource = "manual"` for whichever value changed; `/addflightlog` and `/deleteflightlog` set both with source `"flightlog"`. `GET /dashboard` passes the 4 values (timestamps as ISO strings) to the view, which renders them in the browser's local time.
## Time Left + PDF
-- `DueDates.formatTimeLeft(dueDate, dueHours, today, currentTimeInService)` is the one server-side Time Left formatter (smart format, see [FRONTEND](FRONTEND.md)). Used by `PdfExportService` (computed at render time — the stored `timeLeft` column goes stale) and `/completeMaintenance/{id}`.
+- `DueDates.formatTimeLeft(dueDate, dueHours, today, currentTimeInService)` is the one server-side Time Left formatter (one line, parts joined by " · ", "hrs": `2 mo 12 days left · 480 hrs overdue`, spec 011; `calculateTimeLeft` in dashboard.js and the Excel formula match) (smart format, see [FRONTEND](FRONTEND.md)). Used by `PdfExportService` (computed at render time — the stored `timeLeft` column goes stale) and `/completeMaintenance/{id}`.
+- `DueDateAutoFill` (spec 007) decides the Due Date to save when Last Done or the cycle changes: date = `DueDates.nextDueDate` (same as Complete Maintenance, exact day), hours = Last Done + cycle hours. Owner-typed Due Dates are kept (`dueDateAuto` / `dueHoursAuto` = FALSE). Also the one hours formatter for Last Done / Due Date (`formatHours`: 1–3 decimals, `25` → `25.0`). Unit tests: `DueDateAutoFillTest`; endpoint tests: `StatusSheetAutoFillTest`.
- `GET /pdf?today=yyyy-MM-dd` — optional browser date, trusted only within ±1 day of the server date. PDF includes a Date column for flights (UTC date of block/service start) and prints hours with at least one decimal.
## Local demo data
@@ -56,8 +62,8 @@
Aviary is an MCP server at `POST /mcp` (Spring AI, Streamable HTTP, SYNC) and its own OAuth authorization server, so AI assistants sign in as an owner.
- **Sign-in:** authorization code + PKCE (S256 only), public clients only. Assistants identify with a **Client ID Metadata Document**: `client_id` is an https URL that `CimdFetcher` downloads (SSRF-guarded: https, no IP literals, no private/loopback/link-local DNS, no redirects, 5 KB, 5 s) and `CimdRegisteredClientRepository` turns into a client (cached 1 h). Dynamic Client Registration is off. Loopback redirect URIs may use any port (`AuthorizationServerConfig.validateRedirectUri`). Owner approves on `/oauth2/consent` (`ConsentController`).
- **Tokens:** opaque, 7 days, no refresh tokens (Spring Authorization Server 1.4 gives public clients none). Stored by `JpaOAuth2AuthorizationService` in `oauth_authorizations` with token values **SHA-256 hashed**. `LocalOpaqueTokenIntrospector` checks every `/mcp` call against that table, so **Disconnect** (`/account/connections`, deletes the row) cuts an assistant off on its next request. No/dead token → 401 with `WWW-Authenticate: Bearer resource_metadata=…`; token without `aviary.read` → 403.
-- **Tools** (`mcp/`): `list_flights`, `get_import_format`, `list_service_timeline`, `propose_timeline_import`, `continue_poor_fit`, `confirm_timeline_import`. Each checks its scope and gets the owner from `McpCurrentUser` (the token's user — never a parameter).
-- **Import:** `TimelineImportService` + pure `util/TimelineImportRules`. Propose stores an `import_proposals` row (24 h, one open per owner) and changes nothing; confirm adds exactly the proposed rows after the existing ones in one transaction (all or nothing), never edits existing rows, skips name matches unless the owner opts in, and writes a `timeline_import_records` row. Rate limits: 30 proposals / 10 confirms per owner per hour.
+- **Tools** (`mcp/`): `list_flights`, `get_import_format`, `list_status_sheet`, `propose_status_sheet_import`, `continue_poor_fit`, `confirm_status_sheet_import`. Each checks its scope and gets the owner from `McpCurrentUser` (the token's user — never a parameter).
+- **Import:** `StatusSheetImportService` + pure `util/StatusSheetImportRules`. Propose stores an `import_proposals` row (24 h, one open per owner) and changes nothing; confirm adds exactly the proposed rows after the existing ones in one transaction (all or nothing), never edits existing rows, skips name matches unless the owner opts in, and writes a `timeline_import_records` row. Rate limits: 30 proposals / 10 confirms per owner per hour.
## Input limits & rate limits
- **Text length:** every text column is varchar(255). `Validation.maxLength` checks item/description/aircraft fields/airports/description options up front and returns a 400 with a readable message; `GlobalExceptionHandler` catches anything missed. The AeroAPI key is capped at 100 chars (it's stored encrypted, which roughly doubles its length).
@@ -66,7 +72,7 @@ Aviary is an MCP server at `POST /mcp` (Spring AI, Streamable HTTP, SYNC) and it
- Unexpected exceptions in `/update/{id}` and `/updateHours` are logged and return a generic message instead of `e.getMessage()`.
## Known issues
-- **(FIXED 2026-05-25) IDOR / broken access control:** `/update/{id}` and `/delete/{id}` now load the authenticated user and return 403 unless `timeline.getUser().getId()` matches — same ownership pattern as `/deleteflightlog` and `/deleteOption`.
+- **(FIXED 2026-05-25) IDOR / broken access control:** `/update/{id}` and `/delete/{id}` now load the authenticated user and return 403 unless `Status Sheet.getUser().getId()` matches — same ownership pattern as `/deleteflightlog` and `/deleteOption`.
- **(FIXED 2026-05-25) `updateOrder` id comparison:** now uses `t.getId().equals(id)` instead of `==` (reference compare).
- **No regression test yet** for the ownership checks — worth adding (user A cannot mutate user B's rows → expect 403).
- **Debug logging:** many `System.out.println` calls (incl. a per-login timing print in `SecurityConfig`). Replace with the SLF4J `log` or remove.
diff --git a/docs/architecture/DATABASE.md b/docs/architecture/DATABASE.md
index c8a2d7d..f066d75 100644
--- a/docs/architecture/DATABASE.md
+++ b/docs/architecture/DATABASE.md
@@ -12,29 +12,33 @@ All ids are `@GeneratedValue(IDENTITY)`. Every row belongs to a `User` via `user
### `users` (`User`)
`id`, `username` (unique, not null), `password` (BCrypt, not null), `aeroApiKey` (encrypted, see `AeroApiKeyConverter`; one key per account), `last_viewed_aircraft_id` (FK → `aircraft`, nullable — the aircraft the dashboard opens on).
-One-to-many (cascade ALL) → `aircraft`, `serviceTimeline`, `flightLogs`.
+One-to-many (cascade ALL) → `aircraft`, `statusSheet`, `flightLogs`.
**Legacy columns (kept, unmapped):** `block_time_hours`, `time_in_service_hours`, `make_model`, `tail_number`, `owner_name`, `make_modelsn`, both `*_updated_at`, both `*_updated_source`, both `*_manual_baseline`. These held the single aircraft before fleets. `AircraftBackfill` copies them into each account's first aircraft on boot; nothing else reads them. They stay one release so a rollback still works, then get dropped (see `docs/migrations/2026-11-09_multi_aircraft.sql`).
### `aircraft` (`Aircraft`)
-`id`, `user_id` (not null), `tailNumber` (upper-cased, spaces removed), `tail_number_key` (comparison key, null when blank; unique with `user_id`), `makeModel`, `ownerName`, `makeModelSN`, `blockTimeHours` / `timeInServiceHours` (Double), `blockTimeManualBaseline` / `timeInServiceManualBaseline` (Double, manually-set floor so log activity can't silently lower the displayed total), `blockTimeUpdatedAt` / `timeInServiceUpdatedAt` (`Instant`), `blockTimeUpdatedSource` / `timeInServiceUpdatedSource` ("manual" | "flightlog"), `createdAt`. One airplane in the owner's fleet; at most 25 per user, at least 1.
+`id`, `user_id` (not null), `tailNumber` (upper-cased, spaces removed), `tail_number_key` (comparison key, null when blank; unique with `user_id`), `makeModel`, `operatorName` (column `owner_name`; renamed in code Nov 2026, spec 009 — `OperatorColumnMappingTest` guards the pin), `makeModelSN`, `hobbsTimeHours` / `timeInServiceHours` (Double), `hobbsTimeManualBaseline` / `timeInServiceManualBaseline` (Double, manually-set floor so log activity can't silently lower the displayed total), `hobbsTimeUpdatedAt` / `timeInServiceUpdatedAt` (`Instant`), `hobbsTimeUpdatedSource` / `timeInServiceUpdatedSource` ("manual" | "flightlog"), `createdAt`. One airplane in the owner's fleet; at most 25 per user, at least 1.
-### `service_timelines` (`ServiceTimeline`)
-`id`, `item`, `isTitle` (boolean — title row vs item row), `description`, `cycle`, `lastDone`, `dueDate`, `timeLeft`, `timelineOrder` (Integer, display order **within one aircraft**), `user_id`, `aircraft_id`.
+### `service_timelines` (`StatusSheetItem`)
+`id`, `item`, `isTitle` (boolean — title row vs item row), `description`, `cycle`, `cycleCalendarValue` + `cycleCalendarUnit` (DAYS | MONTHS | YEARS), `cycleHours`, `lastDoneDate`, `lastDoneHours`, `dueDateDate`, `dueDateHours` (hours stored as text in the `25.0` format, 1–3 decimals; legacy non-numeric text kept as is), `dueDateAuto`, `dueHoursAuto` (Boolean, nullable — spec 007: TRUE = Due Date part auto-filled from Last Done + cycle, FALSE = typed by the owner and never overwritten, null = row from before Nov 2026, decided by comparing with the cycle math), `timeLeft`, `statusSheetOrder` (Integer, display order **within one aircraft**), `user_id`, `aircraft_id`.
+
+**Status Sheet keeps its old storage names.** `StatusSheetItem` is pinned to table `service_timelines` and `statusSheetOrder` to column `timeline_order`; `StatusSheetImportRecord` to `timeline_import_records`. The Nov 2026 rename changed only the Java names, so no data moved. `StatusSheetColumnMappingTest` guards this.
### `flight_logs` (`FlightLog`)
-`id`, `fromAirport`, `toAirport`, `blockTimeIn`, `blockTimeOut`, `timeInServiceIn`, `timeInServiceOut` (all Double, nullable), `blockTimeStart`, `blockTimeEnd` (`Instant`, nullable — engine start/stop, UTC), `timeInServiceStart`, `timeInServiceEnd` (`Instant`, nullable — wheels-off/wheels-on, UTC), `source` (String "manual" | "csv" | "aeroapi", nullable — see `FlightLog.getEffectiveSource()` and `HoursService.recomputeChain`), `faFlightId` (String, nullable — set only when the row came from an accepted `FlightSuggestion`), `user_id`, `aircraft_id`. Hours math only ever looks at one aircraft's flights.
+`id`, `fromAirport`, `toAirport`, `hobbsTimeIn`, `hobbsTimeOut`, `timeInServiceIn`, `timeInServiceOut` (all Double, nullable), `hobbsTimeStart`, `hobbsTimeEnd` (`Instant`, nullable — engine start/stop, UTC), `timeInServiceStart`, `timeInServiceEnd` (`Instant`, nullable — wheels-off/wheels-on, UTC), `source` (String "manual" | "csv" | "aeroapi", nullable — see `FlightLog.getEffectiveSource()` and `HoursService.recomputeChain`), `faFlightId` (String, nullable — set only when the row came from an accepted `FlightSuggestion`), `user_id`, `aircraft_id`. Hours math only ever looks at one aircraft's flights.
+
+**Hobbs columns keep their old names.** In `aircraft` and `flight_logs`, every `hobbsTime*` field is pinned with `@Column(name = "block_time_…")` (e.g. `hobbsTimeHours` → `block_time_hours`, `hobbsTimeOut` → `block_time_out`). The Nov 2026 rename changed only the Java names, so no data moved. Do not remove those pins: `ddl-auto=update` would add new, empty `hobbs_time_*` columns. `HobbsColumnMappingTest` guards this.
### `description_options` (`DescriptionOption`)
-`id`, `option` (not null), `user_id`. Stores a user's custom Service Timeline description choices.
+`id`, `option` (not null), `user_id`. Stores a user's custom Status Sheet description choices.
### `flight_suggestions` (`FlightSuggestion`)
`id`, `tailNumber`, `faFlightId` (unique per user), `departureTime`, `arrivalTime` (`Instant`), `origin`, `destination`, `status` (String "pending" | "accepted" | "dismissed"), `createdAt`, `user_id`, `aircraft_id` (the aircraft whose subscription found it). AeroAPI-detected flights awaiting a user decision — see `docs/ADSB_SYNC_SPEC.md`.
### `import_proposals` (`ImportProposal`)
-`id`, `user_id` (not null), `status` ("OPEN" | "NEEDS_FIT_CONFIRMATION" | "CONFIRMED" | "REPLACED" | "EXPIRED"), `itemsJson` / `rejectedJson` (TEXT, JSON lists), `submittedCount`, `createdAt`, `expiresAt` (+24 h), `confirmedAt`, `connectionClientId`, `aircraft_id` (target aircraft; null after that aircraft is removed). An AI assistant's previewed timeline import; at most one OPEN/NEEDS_FIT_CONFIRMATION per user per aircraft.
+`id`, `user_id` (not null), `status` ("OPEN" | "NEEDS_FIT_CONFIRMATION" | "CONFIRMED" | "REPLACED" | "EXPIRED"), `itemsJson` / `rejectedJson` (TEXT, JSON lists), `submittedCount`, `createdAt`, `expiresAt` (+24 h), `confirmedAt`, `connectionClientId`, `aircraft_id` (target aircraft; null after that aircraft is removed). An AI assistant's previewed Status Sheet import; at most one OPEN/NEEDS_FIT_CONFIRMATION per user per aircraft.
-### `timeline_import_records` (`TimelineImportRecord`)
+### `timeline_import_records` (`StatusSheetImportRecord`)
`id`, `user_id` (not null), `proposalId`, `clientId`, `clientName`, `itemCount`, `importedAt`, `aircraftLabel` (tail number at import time, text). One row per confirmed import; shown on Connected assistants.
### `subscriptions` (`Subscription`)
@@ -47,7 +51,7 @@ String `id`, `registeredClientId` (assistant's CIMD URL), `principalName` (usern
Composite key (`registeredClientId`, `principalName`), `authorities`. Approved scopes per assistant per owner.
## Relationships
-`User` 1—* `Aircraft` (1..25). `Aircraft` 1—* `ServiceTimeline`, `FlightLog`, `FlightSuggestion`; 0..1 `Subscription`. Child rows keep `user_id` too, so ownership checks never depend on a join; services keep `row.user == row.aircraft.user`. `User` 1—* `DescriptionOption`, alert settings and recipients stay account-wide. `User` 1—* `ServiceTimeline`, `FlightLog` are cascade ALL with JSON managed/back references.
+`User` 1—* `Aircraft` (1..25). `Aircraft` 1—* `StatusSheetItem`, `FlightLog`, `FlightSuggestion`; 0..1 `Subscription`. Child rows keep `user_id` too, so ownership checks never depend on a join; services keep `row.user == row.aircraft.user`. `User` 1—* `DescriptionOption`, alert settings and recipients stay account-wide. `User` 1—* `StatusSheetItem`, `FlightLog` are cascade ALL with JSON managed/back references.
## Boot-time backfill
`config/AircraftBackfill` runs before the seeders on every boot: it drops the old `subscriptions(user_id)` unique constraint and, for each user without an aircraft, creates one from the legacy `users` columns and sets `aircraft_id` on that user's rows where it is null. Idempotent; logs `Aircraft backfill: N users, M rows attached`. The `aircraft_id` columns are nullable in the schema only because `ddl-auto=update` can't add NOT NULL to a populated table.
@@ -56,7 +60,7 @@ Composite key (`registeredClientId`, `principalName`), `authorities`. Approved s
- `UserRepository.findByUsername`
- `AircraftRepository.findByIdAndUser` (the only way to load a client-supplied aircraft id) / `findByUserOrderByIdAsc`
- `FlightLogRepository.findByAircraft`
-- `ServiceTimelineRepository.findByAircraftOrderByTimelineOrderAsc` / `findMaxTimelineOrderByAircraft` (`@Query` for max order) / `findByUserOrderByAircraftIdAscTimelineOrderAsc` (whole fleet, for alerts and picker counts)
+- `StatusSheetItemRepository.findByAircraftOrderByStatusSheetOrderAsc` / `findMaxStatusSheetOrderByAircraft` (`@Query` for max order) / `findByUserOrderByAircraftIdAscStatusSheetOrderAsc` (whole fleet, for alerts and picker counts)
- `DescriptionOptionRepository.findByUser`
## Gotchas
diff --git a/docs/architecture/FRONTEND.md b/docs/architecture/FRONTEND.md
index 59091c8..4fc50b9 100644
--- a/docs/architecture/FRONTEND.md
+++ b/docs/architecture/FRONTEND.md
@@ -12,9 +12,9 @@ Each stylesheet defines the same CSS-variable palette (`--primary` green `#2C9B6
## Dashboard structure
- Fixed header (logo, **Share** menu, logout, settings gear). Share is a popover card (`.share-dropdown`, toggled via `hidden` + `aria-expanded` by `setShareOpen()` in `dashboard.js`): Print, Download PDF, then a divider and Email/Text marked with a "Soon" pill (`.share-coming-soon`). Closes on outside click, Escape, or picking an item; Arrow keys move between items. Styled with theme tokens so it works in dark mode.
-- "My Hours" card: shows block time and time in service, each with a small muted "last updated" line under it (`.hours-block` / `.hours-updated`) — local date + time + relative ("2 days ago") + source ("you edited it" / "from a flight log"). Edit panel can **set** or **add** hours.
-- Two tabs: **Service Timeline** and **Log Book**.
-- Service Timeline table: drag-reorder (SortableJS via grip handle), title rows vs item rows, a custom Description dropdown (with add/remove custom options), and a Calendar/Clock picker for Last Done / Due Date. "Time Left" is computed client-side.
+- "My Hours" card: shows Hobbs time and time in service, each with a small muted "last updated" line under it (`.hours-block` / `.hours-updated`) — local date + time + relative ("2 days ago") + source ("you edited it" / "from a flight log"). Edit panel can **set** or **add** hours.
+- Two tabs: **Status Sheet** and **Log Book**.
+- Status Sheet table: drag-reorder (SortableJS via grip handle), title rows vs item rows, a custom Description dropdown (with add/remove custom options), and a Calendar/Clock picker for Last Done / Due Date. "Time Left" is computed client-side. It is drawn as colored pills by `setTimeLeftText` (spec 011): one pill per limit, no icons ("45 d", "480 h"), green / amber (within the user's alert lead time, `data-lead-days` / `data-lead-hours` on `#sortable-info-table`) / red, and the word "overdue" after an overdue pill (once if both). The plain words stay on the cell (`data-plain` + print-only `.tl-plain`) for saving, the add row, print and Excel. After a row saves, `applySavedRow` shows what the server saved, so an auto-filled Due Date appears without a reload (never rewriting a box the owner is typing in). Hours boxes tidy to 1–3 decimals on blur (`formatSheetHours`, same rule as the server). `rowDueTouched` tells the server when the owner edited a Due Date part themselves. Typo warnings render in `.row-warning` under Last Done. The row's roll-forward button opens `showChoice` with **Mark complete** and **Reset to cycle (date)**; it first calls `flushRowSave` so pending edits are saved, then `GET /statusSheet/{id}/cyclePreview` to fill and enable the Reset choice. Choosing Mark complete opens `openDoneBox` ("When was this done?"): prefilled from `completePreview`, live "Next due" (250 ms debounced preview), Save disabled while saving, toast built from the saved values. The add row (not saved yet) keeps its own `addRowState` (previous inputs, auto/typed per Due Date part) and calls `POST /statusSheet/addRowResolve` (250 ms debounced) so its Due Date fills before Add; typing or Remove in its Due Date makes that part the user's; the flags go with the Add request; `resetAddRowState` after Add. No Mark complete / Reset / background saving in the add row.
- Log Book table: existing rows are **readonly**; an add-row appends a flight.
## `dashboard.js` patterns (~1400 lines, one file)
@@ -28,7 +28,7 @@ Each stylesheet defines the same CSS-variable palette (`--primary` green `#2C9B6
- **Last Done / Due Date menu** buttons read Add / Remove (state is the button text). Removing a field that has a value takes two taps: the first arms it as a red "Remove?" (`.confirm-remove`), the second removes it and auto-saves; reopening the menu disarms it (`disarmRemoveButton`). Empty fields remove on one tap.
- **`[hidden]` always wins** (`[hidden] { display: none !important; }` at the top of `dashboardstyle.css`). Toggle visibility with `el.hidden`; rules like `.settings-table tr { display: flex }` used to override the attribute and show hidden rows.
- **Mobile (≤960px) Settings**: each row stacks the label above a full-width, wrapping value area with 42px controls.
-- **Mobile (≤960px) Service Timeline** renders each row as a card (`dashboardstyle.css`, "Service Timeline cards"). Saved cards and the add card share the same rules via `#sortable-info-table :is(.sortable tr:not(.title-row), .add-row)`; spacing/tap size are CSS variables on `#sortable-info-table` (`--cell-px`, `--cell-py`, `--tap`) and are fluid down to ~300px. There are deliberately no breakpoints below 960px.
+- **Mobile (≤960px) Status Sheet** renders each row as a card (`dashboardstyle.css`, "Status Sheet cards"). Saved cards and the add card share the same rules via `#sortable-info-table :is(.sortable tr:not(.title-row), .add-row)`; spacing/tap size are CSS variables on `#sortable-info-table` (`--cell-px`, `--cell-py`, `--tap`) and are fluid down to ~300px. There are deliberately no breakpoints below 960px.
- **Notifications:** `showToast()` / `showConfirm()` replaced native `alert()`/`confirm()`.
- **Hours "last updated":** `formatUpdated(iso, source)` + `relativeTime()` render the My Hours freshness lines in the browser's local timezone (server stores UTC). `renderUpdatedFromData()` on load (reads `data-updated`/`data-source` attrs); `markUpdatedNow()` after a live change. Uses `textContent`, not `innerHTML`.
- **Excel export:** `exportToExcel()` (SheetJS) is implemented but its button is commented out in `dashboard.html` (intentionally hidden).
@@ -49,4 +49,4 @@ Each stylesheet defines the same CSS-variable palette (`--primary` green `#2C9B6
## Import with AI page
- `GET /account/connections` (`connections.html`): titled "Import with AI". An always-visible connect box shows this site's MCP address (`mcpUrl` = `aviary.oauth.issuer` + `/mcp`, so staging shows staging's), a Copy button (`js/connections.js`, falls back to selecting the address), three steps, the per-assistant "where to find it" list (`fragments/assistant-hints.html` — one line per assistant, update there when an app moves its menu), and what to do next. The connected-assistant list and recent imports sit below under "Connected assistants".
-- Dashboard entry points: header `#connections-link` (robot icon + "Import with AI"; text hidden under 420px, `aria-label` kept) and `#import-ai-prompt` above the empty Service Timeline (server-rendered only when there are no rows; `dashboard.js` removes it via a MutationObserver when the first row is added). Both are `no-print`.
+- Dashboard entry points: header `#connections-link` (robot icon + "Import with AI"; text hidden under 420px, `aria-label` kept) and `#import-ai-prompt` above the empty Status Sheet (server-rendered only when there are no rows; `dashboard.js` removes it via a MutationObserver when the first row is added). Both are `no-print`.
diff --git a/docs/architecture/project_structure.text b/docs/architecture/project_structure.text
index 20e94a8..103f848 100644
--- a/docs/architecture/project_structure.text
+++ b/docs/architecture/project_structure.text
@@ -44,12 +44,12 @@
- entity
- DescriptionOption.class
- DTO
- - TimelineUpdateDTO.class
- - ServiceTimeline.class
+ - StatusSheetItemUpdateDTO.class
+ - StatusSheetItem.class
- User.class
- repositories
- DescriptionOptionRepository.class
- - ServiceTimelineRepository.class
+ - StatusSheetItemRepository.class
- UserRepository.class
- static
- css
@@ -85,12 +85,12 @@
- entity
- DescriptionOption.class
- DTO
- - TimelineUpdateDTO.class
- - ServiceTimeline.class
+ - StatusSheetItemUpdateDTO.class
+ - StatusSheetItem.class
- User.class
- repositories
- DescriptionOptionRepository.class
- - ServiceTimelineRepository.class
+ - StatusSheetItemRepository.class
- UserRepository.class
- test
- com
@@ -189,12 +189,12 @@
- entity
- DescriptionOption.java
- DTO
- - TimelineUpdateDTO.java
- - ServiceTimeline.java
+ - StatusSheetItemUpdateDTO.java
+ - StatusSheetItem.java
- User.java
- repositories
- DescriptionOptionRepository.java
- - ServiceTimelineRepository.java
+ - StatusSheetItemRepository.java
- UserRepository.java
- resources
- application-heroku.properties
diff --git a/docs/backend-notes/TRANSACTIONAL.md b/docs/backend-notes/TRANSACTIONAL.md
index 75a79c1..8198251 100644
--- a/docs/backend-notes/TRANSACTIONAL.md
+++ b/docs/backend-notes/TRANSACTIONAL.md
@@ -64,7 +64,7 @@ for shredding — including A's work.
|---|---|
| `services/HoursService.java` | `updateHours` |
| `services/UserService.java` | `registerUser`, `updateUserInfo` |
-| `services/TimelineService.java` | `addTimeline` |
+| `services/StatusSheetService.java` | `addStatusSheet` |
| `services/DescriptionOptionService.java` | `saveCustomDescriptionOption`, `addOption`, `deleteOption`, `cleanupAndLoadDescriptionOptions` |
| `services/SubscriptionService.java` | `toggle` |
@@ -72,7 +72,7 @@ for shredding — including A's work.
| File | Method |
|---|---|
-| `controllers/UserController.java` | `updateTimeline`, `addFlightLog`, `completeMaintenance`, `addDescriptionOption`, `deleteFlightLog` |
+| `controllers/UserController.java` | `updateStatusSheet`, `addFlightLog`, `completeMaintenance`, `addDescriptionOption`, `deleteFlightLog` |
### The clearest example of why it matters
@@ -82,14 +82,14 @@ for shredding — including A's work.
flightLogRepository.delete(log); // 1. remove the log
List remainingLogs = flightLogRepository.findByUser(user);
-double newBlockTime = hoursService.recomputeChain(user, true);
+double newHobbsTime = hoursService.recomputeChain(user, true);
double newTimeInService = hoursService.recomputeChain(user, false);
-user.setBlockTimeHours(newBlockTime);
+user.setHobbsTimeHours(newHobbsTime);
...
userRepository.save(user); // 2. recompute the hours
```
-If step 1 commits and step 2 does not, the aircraft has a deleted flight but stale block time
+If step 1 commits and step 2 does not, the aircraft has a deleted flight but stale Hobbs time
and time in service hours on screen. That is the exact bug class the recent commits have been fixing.
`@Transactional` is what guarantees both or neither.
@@ -130,7 +130,7 @@ public ResponseEntity<...> updateHours(...) { // no @Transactional here
}
```
-**Leaky — `UserController.updateTimeline` and `UserController.deleteFlightLog`.** Both
+**Leaky — `UserController.updateStatusSheet` and `UserController.deleteFlightLog`.** Both
carry `@Transactional` *and* wrap their whole body in `catch (Exception e)`. The exception
never escapes, so the foreman files the work order regardless. In `deleteFlightLog` that
means the delete can commit while the hours recomputation failed — a 500 goes to the
@@ -141,7 +141,7 @@ controllers catch and format the response.
### 2. Nested transactional calls share one transaction
-`UserController.updateTimeline` calls `descriptionOptionService.saveCustomDescriptionOption`,
+`UserController.updateStatusSheet` calls `descriptionOptionService.saveCustomDescriptionOption`,
which is itself `@Transactional`. It does not get its own transaction — it joins the
controller's.
@@ -156,7 +156,7 @@ Calling a `@Transactional` method from another method in the *same class* skips
entirely, so no transaction is opened, silently.
This codebase is currently safe — every call crosses a bean boundary (controller → service,
-or `TimelineService` → `descriptionOptionService`). Worth remembering before moving a
+or `StatusSheetService` → `descriptionOptionService`). Worth remembering before moving a
transactional method's caller into the same class.
### 4. `@Transactional` on a controller holds the connection too long
@@ -188,7 +188,7 @@ Run the app:
(`-Pdev` is defined in `build.gradle` and serves templates/CSS live from `src/` so frontend
edits show without a rebuild.)
-Then log in and change the block time hours. Expect log lines like:
+Then log in and change the Hobbs time hours. Expect log lines like:
```
Getting transaction for [com.example.AviaryService.services.HoursService.updateHours]
@@ -202,8 +202,8 @@ Two experiments worth doing once:
- **See a rollback.** Call the update-hours endpoint with all four parameters empty.
`HoursService` throws `IllegalArgumentException`, and the log should show
`Initiating transaction rollback` instead of commit.
-- **See transactions nest.** Save a timeline row with a brand-new custom description.
- `updateTimeline` calls `saveCustomDescriptionOption`, which is also `@Transactional`.
+- **See transactions nest.** Save a Status Sheet row with a brand-new custom description.
+ `updateStatusSheet` calls `saveCustomDescriptionOption`, which is also `@Transactional`.
The log should show `Participating in existing transaction` — trap 2, visible.
To see the SQL landing between the begin and commit lines, flip
diff --git a/docs/planning/SERVICE_LAYER_PLAN.md b/docs/planning/SERVICE_LAYER_PLAN.md
index d372bf2..3b68ab8 100644
--- a/docs/planning/SERVICE_LAYER_PLAN.md
+++ b/docs/planning/SERVICE_LAYER_PLAN.md
@@ -38,7 +38,7 @@ from a scheduled job or tested without web types.
Look at which repository a method touches. Everything hitting
`flightLogRepository` belongs to one service; everything hitting
-`serviceTimelineRepository` to another. That is usually the natural seam.
+`statusSheetRepository` to another. That is usually the natural seam.
## The five services
@@ -77,17 +77,17 @@ Uses `descriptionOptionRepository`.
Uses `userRepository`. Holds the floor rule — displayed hours may rise, never fall.
-### 4. TimelineService (~220 lines)
+### 4. StatusSheetService (~220 lines)
| Method | Line | Size |
|---|---|---|
| `completeMaintenance` | 698 | 69 |
-| `updateTimeline` | 306 | 59 |
-| `addTimeline` | 143 | 57 |
+| `updateStatusSheet` | 306 | 59 |
+| `addStatusSheet` | 143 | 57 |
| `updateOrder` | 406 | 19 |
-| `deleteTimeline` | 365 | 14 |
+| `deleteStatusSheet` | 365 | 14 |
-Uses `serviceTimelineRepository`.
+Uses `statusSheetRepository`.
### 5. FlightLogService (~290 lines)
@@ -155,7 +155,7 @@ Smallest first, so the pattern is second nature before the hard ones.
1. `UserService` — 2 methods, practice run
2. `DescriptionOptionService` — 4 small methods
3. `HoursService` — self-contained math
-4. `TimelineService` — bigger, more entangled
+4. `StatusSheetService` — bigger, more entangled
5. `FlightLogService` — biggest payoff, do it last
**One service at a time, compile after each.** A 965-line rewrite in one pass with
diff --git a/docs/specs/ADSB_DATA_SOURCE.md b/docs/specs/ADSB_DATA_SOURCE.md
index 6ed8e8e..bf1748d 100644
--- a/docs/specs/ADSB_DATA_SOURCE.md
+++ b/docs/specs/ADSB_DATA_SOURCE.md
@@ -130,7 +130,7 @@ Each has three variants — `scheduled_`, `estimated_`, `actual_`. **Use `actual
only**; the others are predictions.
> **`actual_off` → `actual_on` is the flight.** Duration = the difference between
-> them. This is *airborne* time, not block time.
+> them. This is *airborne* time, not Hobbs time.
#### Fields we use
diff --git a/docs/specs/ADSB_SYNC_SPEC.md b/docs/specs/ADSB_SYNC_SPEC.md
index bd5fd46..663d14a 100644
--- a/docs/specs/ADSB_SYNC_SPEC.md
+++ b/docs/specs/ADSB_SYNC_SPEC.md
@@ -12,7 +12,7 @@ License forbids mixing it with another real-time flight data provider.
| Field | What it is | Source |
|---|---|---|
-| **Block Time** | engine-on to engine-off | manual entry only |
+| **Hobbs Time** | engine-on to engine-off | manual entry only |
| **Time in Service** | wheels-off to wheels-on (the real maintenance clock) | manual entry, CSV upload, or AeroAPI |
AeroAPI's `actual_off`/`actual_on` map directly to Time in Service. It's just a
@@ -40,7 +40,7 @@ suggestion until the user presses Add — nothing writes itself.
for that as a possible future feature.
4. New flights are saved as `FlightSuggestion` rows, `pending`.
5. They show up as a banner on the Log Book tab. **Add** creates a real
- `FlightLog` row (airports + departure/arrival time; Block Time is left
+ `FlightLog` row (airports + departure/arrival time; Hobbs Time is left
blank and Time in Service is filled in from the flight's airborne
duration) and flips the suggestion to
`accepted`. **Dismiss** flips it to `dismissed`. Both are permanent — an
diff --git a/docs/specs/ALERTS_SPEC.md b/docs/specs/ALERTS_SPEC.md
index f4ae117..93eae2e 100644
--- a/docs/specs/ALERTS_SPEC.md
+++ b/docs/specs/ALERTS_SPEC.md
@@ -3,7 +3,7 @@
Status: **Backend + email built (Amazon SES); SMS = model + logging sender only; UI = functional** · Last updated: 2026-10-18
Alerts the aircraft owner (and anyone they add — a maintenance shop, a partner)
-when a Service Timeline item is near or past its due date. Email goes through
+when a Status Sheet item is near or past its due date. Email goes through
Amazon SES (`SesEmailService`). SMS is stubbed (`LoggingSmsSender`) until a real
provider is wired up.
@@ -18,13 +18,13 @@ for this tail". This is a different concern with its own entities.
one check per user per day.
- `checkHour` is in the **server's time zone** (`ZoneId.systemDefault()`). On
Heroku that is UTC.
-- On a check, every non-title item on the Service Timeline gets a **level**:
+- On a check, every non-title item on the Status Sheet gets a **level**:
`OK` → `DUE_SOON` → `OVERDUE`.
- `OVERDUE` — `daysLeft < 0` or `hoursLeft < 0`
- `DUE_SOON` — `0 ≤ daysLeft ≤ leadTimeDays` or `0 ≤ hoursLeft ≤ leadTimeHours`
- else `OK`
- An item has two limits (calendar and flight hours); the worse one wins.
-- Each item stores the level it **last alerted at** (`ServiceTimeline.alertLevel`)
+- Each item stores the level it **last alerted at** (`StatusSheetItem.alertLevel`)
and when (`alertLastFiredAt`).
- A digest is sent only if **either**:
1. some item moved to a worse level than it last alerted at, **or**
@@ -43,7 +43,7 @@ settings, and a readiness line. Backed by `PUT /alerts/preferences`.
`GET /alerts/preferences` → `readiness.missing`:
- "Add at least one maintenance item"
- "Set your tail number"
- - "Set your owner name"
+ - "Set your operator name"
- "Enter aircraft hours"
Advisory only; the server does not block turning alerts on.
- **Every time** `enabled` flips false→true, the server snapshots each item's
@@ -63,7 +63,7 @@ settings, and a readiness line. Backed by `PUT /alerts/preferences`.
| `confirmToken` | random URL-safe token, unique |
| `createdAt`, `confirmedAt`, `reminderSentAt` | timestamps |
-Flow: **add → PENDING** → confirm email sent ("[owner name] added you to receive
+Flow: **add → PENDING** → confirm email sent ("[operator name] added you to receive
maintenance alerts for [tail]", with Confirm and Decline links) → recipient
confirms (`ACCEPTED`) or declines (`DECLINED`). Only `ACCEPTED` recipients get
digests.
@@ -71,7 +71,7 @@ digests.
Rules on add (`AlertRecipientService.add`), checked in this order:
1. Address is valid (not blank, ≤ 254 chars, email or E.164 format); label ≤ 100.
-2. Owner has an **owner name** and **tail number** (`requireProfile`). Also
+2. Owner has an **operator name** and **tail number** (`requireProfile`). Also
checked on Resend. If either is cleared later, emails fall back to
"The aircraft owner" / "your aircraft" (`AlertText`).
3. Same channel + address already on the list:
@@ -111,10 +111,10 @@ nothing is saved.
- **Body (plain text):** "Maintenance status for [tail] ([make/model])" + timestamp
→ baseline note or "What changed" → full status, worst first. Each line puts
the overdue part first, e.g. `OVERDUE Annual Inspection — 480.0 hrs overdue ·
- 106 days left` → aircraft hours (Block Time / Time in Service).
+ 106 days left` → aircraft hours (Hobbs Time / Time in Service).
- **Attachment:** dashboard PDF (`PdfExportService.generateDashboardPdf`), built
once per digest.
-- **Footer:** "You're receiving this because [owner name] added you to maintenance
+- **Footer:** "You're receiving this because [operator name] added you to maintenance
alerts for [tail]. The full dashboard is attached as a PDF." + unsubscribe link
(`/alerts/unsubscribe?token=…`) + postal address if configured (CAN-SPAM).
**No dashboard link:** recipients have no login.
@@ -132,7 +132,7 @@ Per-user defaults in `AlertPreference`: `leadTimeDays` (30), `leadTimeHours`
`overdueRenudgeDays` (7, min 1), `lastCheckedOn` (LocalDate, null),
`baselineSentAt` (Instant, null).
- **`AlertRecipient`** — as table above.
-- **`ServiceTimeline`** has `alertLevel` (String, nullable) and
+- **`StatusSheetItem`** has `alertLevel` (String, nullable) and
`alertLastFiredAt` (Instant, nullable).
- **`AlertSendLog`** — `recipientId`, `channel`, `sentAt`. Backs the digest rate
limit. Rows older than 30 days are pruned.
diff --git a/docs/specs/SHARE_EXPORT_SPEC.md b/docs/specs/SHARE_EXPORT_SPEC.md
index 0104f48..493ed57 100644
--- a/docs/specs/SHARE_EXPORT_SPEC.md
+++ b/docs/specs/SHARE_EXPORT_SPEC.md
@@ -88,14 +88,14 @@ intentionally bypass all of it.
Scope applies to **all four actions, including Print**:
-- **This tab** (default) — only the active tab (Service Timeline *or* Log Book).
+- **This tab** (default) — only the active tab (Status Sheet *or* Log Book).
- **Full dashboard** — both tabs' content in one document. Slightly more work on
both render paths (must reveal/render both sections).
## PDF content = data only, no UI chrome
-The PDF contains only the record content: **Service Timeline, Aircraft Info,
-Hours (block time / time in service), and Log Book**. All interactive controls are excluded —
+The PDF contains only the record content: **Status Sheet, Aircraft Info,
+Hours (Hobbs time / time in service), and Log Book**. All interactive controls are excluded —
the Share menu, grip handles, trash/delete icons, complete-maintenance button,
chevrons, dropdowns, etc.
@@ -164,7 +164,7 @@ for their attachment/link instead of building their own renderer.
with alert invites/resends) → 429 past the cap.
- **Tokenized PDF links** (for SMS) must be unguessable + expiring so records
can't be enumerated.
-- **Empty timeline** — disable Share or guard against emailing a blank PDF.
+- **Empty Status Sheet** — disable Share or guard against emailing a blank PDF.
- **States** — "Generating…" loading state; reuse existing `showToast` for
success/failure.
- **Excel export** — currently commented out; omit from the menu until real.
diff --git a/src/browserTest/java/com/example/AviaryService/browser/AddRowAutoFillTest.java b/src/browserTest/java/com/example/AviaryService/browser/AddRowAutoFillTest.java
new file mode 100644
index 0000000..0e8c76a
--- /dev/null
+++ b/src/browserTest/java/com/example/AviaryService/browser/AddRowAutoFillTest.java
@@ -0,0 +1,174 @@
+package com.example.AviaryService.browser;
+
+import com.example.AviaryService.entity.StatusSheetItem;
+import com.example.AviaryService.entity.User;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
+import com.microsoft.playwright.Locator;
+import com.microsoft.playwright.assertions.LocatorAssertions;
+import com.microsoft.playwright.options.LoadState;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Spec 010 in a real browser: the add row fills its Due Date from Last Done +
+ * cycle before Add (behaviors 1-8), and the saved row matches.
+ */
+class AddRowAutoFillTest extends BrowserTestBase {
+
+ @Autowired
+ StatusSheetItemRepository statusSheetItems;
+
+ private static final LocatorAssertions.HasValueOptions WAIT = new LocatorAssertions.HasValueOptions().setTimeout(5000);
+
+ private Locator add;
+
+ private List open() {
+ String username = seedUser("password");
+ List errors = new ArrayList<>();
+ page.onConsoleMessage(m -> { if ("error".equals(m.type())) errors.add(m.text()); });
+ page.setViewportSize(1400, 900);
+ loginAs(username, "password");
+ page.waitForLoadState(LoadState.NETWORKIDLE);
+ add = page.locator("tr.add-row");
+ return errors;
+ }
+
+ private Locator cell(String label) {
+ return add.locator("td[data-label='" + label + "']");
+ }
+
+ private void openPart(String label, String type) {
+ cell(label).locator(".trigger-dropdown").click();
+ cell(label).locator(".add-type[data-type='" + type + "']").click();
+ }
+
+ @Test
+ void addRowFillsBeforeAddAndSavedRowMatches() {
+ List errors = open();
+ add.locator("textarea[name='item']").fill("Oil change");
+
+ // 2: Last Done first, cycle afterwards.
+ openPart("Last Done", "calendar");
+ cell("Last Done").locator("input[type='date']").fill("2026-10-30");
+ add.locator("input[name='cycleCalendarValue']").fill("1");
+ add.locator("select[name='cycleCalendarUnit']").selectOption("MONTHS");
+
+ // 1: Due Date fills (calendar opened by itself) before Add.
+ Locator dueDate = cell("Due Date").locator("input[type='date']");
+ assertThat(dueDate).hasValue("2026-11-30", WAIT);
+
+ // Hours too, and 6: 25 -> 25.0 on leaving the box.
+ add.locator("input[name='cycleHours']").fill("100");
+ openPart("Last Done", "clock");
+ Locator lastHours = cell("Last Done").locator("input.extra-input[type='text']");
+ lastHours.fill("25");
+ add.locator("textarea[name='item']").click();
+ assertThat(lastHours).hasValue("25.0");
+ assertThat(cell("Due Date").locator("input.extra-input[type='text']")).hasValue("125.0", WAIT);
+
+ // 8: Add -> saved row matches, add row clears.
+ add.locator("button.add-button").click();
+ page.waitForLoadState(LoadState.NETWORKIDLE);
+ Locator saved = page.locator("tr.auto-save-row").last();
+ assertThat(saved.locator("td:nth-child(6) input[type='date']")).hasValue("2026-11-30", WAIT);
+ assertThat(saved.locator("td:nth-child(6) input.extra-input[type='text']")).hasValue("125.0");
+ assertThat(add.locator("td[data-label='Due Date'] input.extra-input")).hasCount(0);
+ assertThat(add.locator("textarea[name='item']")).hasValue("");
+
+ StatusSheetItem row = statusSheetItems.findAll().stream()
+ .filter(i -> "Oil change".equals(i.getItem())).findFirst().orElseThrow();
+ assertTrue(row.getDueDateAuto(), "auto-filled in the add row stays auto after Add");
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void typedAndRemovedDueDatesAreRespectedAndLastDoneClears() {
+ List errors = open();
+ add.locator("textarea[name='item']").fill("Annual");
+ add.locator("input[name='cycleCalendarValue']").fill("1");
+ add.locator("select[name='cycleCalendarUnit']").selectOption("MONTHS");
+ openPart("Last Done", "calendar");
+ Locator lastDate = cell("Last Done").locator("input[type='date']");
+ lastDate.fill("2026-10-30");
+ Locator dueDate = cell("Due Date").locator("input[type='date']");
+ assertThat(dueDate).hasValue("2026-11-30", WAIT);
+
+ // 5: clearing Last Done clears the auto Due Date.
+ lastDate.fill("");
+ assertThat(dueDate).hasCount(0, new LocatorAssertions.HasCountOptions().setTimeout(5000));
+
+ // 3: typed Due Date stays when Last Done changes.
+ lastDate.fill("2026-10-30");
+ assertThat(dueDate).hasValue("2026-11-30", WAIT);
+ dueDate.fill("2027-06-01");
+ page.waitForTimeout(600);
+ lastDate.fill("2026-12-05");
+ page.waitForTimeout(800);
+ assertThat(dueDate).hasValue("2027-06-01");
+
+ // 4: Remove stays removed until Last Done or the cycle changes.
+ cell("Due Date").locator(".trigger-dropdown").click();
+ Locator remove = cell("Due Date").locator(".add-type[data-type='calendar']");
+ remove.click();
+ remove.click(); // confirm "Remove?"
+ page.waitForTimeout(800);
+ assertThat(dueDate).hasCount(0);
+ add.locator("textarea[name='item']").fill("Annual inspection"); // unrelated change
+ page.waitForTimeout(800);
+ assertThat(dueDate).hasCount(0);
+ lastDate.fill("2026-12-10");
+ assertThat(dueDate).hasValue("2027-01-10", WAIT);
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void futureLastDoneShowsANoteButAddStillWorks() {
+ List errors = open();
+ add.locator("textarea[name='item']").fill("ELT");
+ add.locator("input[name='cycleCalendarValue']").fill("12");
+ add.locator("select[name='cycleCalendarUnit']").selectOption("MONTHS");
+ openPart("Last Done", "calendar");
+ String future = java.time.LocalDate.now().plusYears(1).toString();
+ cell("Last Done").locator("input[type='date']").fill(future);
+ assertThat(cell("Last Done").locator(".row-warning")).hasText("Last Done is in the future. Check the date.");
+ int before = statusSheetItems.findAll().size();
+ add.locator("button.add-button").click();
+ page.waitForLoadState(LoadState.NETWORKIDLE);
+ page.waitForTimeout(500);
+ assertEquals(before + 1, statusSheetItems.findAll().size(), "note does not block Add");
+ assertThat(cell("Last Done").locator(".row-warning")).hasCount(0);
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void titleModeFillsNothing() {
+ List errors = open();
+ add.locator("input[name='cycleCalendarValue']").fill("1");
+ add.locator("select[name='cycleCalendarUnit']").selectOption("MONTHS");
+ openPart("Last Done", "calendar");
+ cell("Last Done").locator("input[type='date']").fill("2026-10-30");
+ assertThat(cell("Due Date").locator("input[type='date']")).hasValue("2026-11-30", WAIT);
+ cell("Due Date").locator(".trigger-dropdown").click();
+ Locator remove = cell("Due Date").locator(".add-type[data-type='calendar']");
+ remove.click();
+ remove.click();
+ page.waitForTimeout(600);
+
+ page.locator(".row-type-option[data-type='title']").click();
+ // Title mode hides Last Done / Due Date, so nothing can fill or show a note.
+ assertThat(cell("Last Done").locator("input[type='date']")).isHidden();
+ page.evaluate("() => { const i = document.querySelector('.add-row td[data-label=\"Last Done\"] input[type=date]');"
+ + " i.value = '2026-11-15'; i.dispatchEvent(new Event('input', {bubbles: true})); }");
+ page.waitForTimeout(800);
+ assertThat(cell("Due Date").locator("input[type='date']")).hasCount(0);
+ assertThat(cell("Last Done").locator(".row-warning")).hasCount(0);
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/BrowserTestBase.java b/src/browserTest/java/com/example/AviaryService/browser/BrowserTestBase.java
index 2152501..6323811 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/BrowserTestBase.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/BrowserTestBase.java
@@ -1,7 +1,7 @@
package com.example.AviaryService.browser;
import com.example.AviaryService.entity.Aircraft;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
import com.example.AviaryService.repositories.AircraftRepository;
import com.example.AviaryService.repositories.UserRepository;
@@ -105,12 +105,12 @@ protected Aircraft aircraftOf(String username) {
* These take the combined "2025-10-01 100.5" form the tests were written
* with (either part optional) and split it.
*/
- protected static void setLastDone(ServiceTimeline t, String value) {
+ protected static void setLastDone(StatusSheetItem t, String value) {
t.setLastDoneDate(datePart(value));
t.setLastDoneHours(hoursPart(value));
}
- protected static void setDueDate(ServiceTimeline t, String value) {
+ protected static void setDueDate(StatusSheetItem t, String value) {
t.setDueDateDate(datePart(value));
t.setDueDateHours(hoursPart(value));
}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/ConnectionsPageTest.java b/src/browserTest/java/com/example/AviaryService/browser/ConnectionsPageTest.java
index 5168221..b1a5e14 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/ConnectionsPageTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/ConnectionsPageTest.java
@@ -10,9 +10,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import com.example.AviaryService.entity.OAuthAuthorizationEntity;
-import com.example.AviaryService.entity.TimelineImportRecord;
+import com.example.AviaryService.entity.StatusSheetImportRecord;
import com.example.AviaryService.repositories.OAuthAuthorizationRepository;
-import com.example.AviaryService.repositories.TimelineImportRecordRepository;
+import com.example.AviaryService.repositories.StatusSheetImportRecordRepository;
/**
* Import with AI page: the connect box (address, Copy, steps, hints) is always
@@ -25,7 +25,7 @@ class ConnectionsPageTest extends BrowserTestBase {
OAuthAuthorizationRepository authorizationRepository;
@Autowired
- TimelineImportRecordRepository importRecordRepository;
+ StatusSheetImportRecordRepository importRecordRepository;
private void seedConnection(String username) {
OAuthAuthorizationEntity e = new OAuthAuthorizationEntity();
@@ -38,7 +38,7 @@ private void seedConnection(String username) {
e.setAccessTokenIssuedAt(Instant.now());
authorizationRepository.save(e);
- TimelineImportRecord r = new TimelineImportRecord();
+ StatusSheetImportRecord r = new StatusSheetImportRecord();
r.setUser(userRepository.findByUsername(username));
r.setClientId(e.getRegisteredClientId());
r.setClientName("Test Assistant");
diff --git a/src/browserTest/java/com/example/AviaryService/browser/DashboardLayoutTest.java b/src/browserTest/java/com/example/AviaryService/browser/DashboardLayoutTest.java
index 517629f..ac0d905 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/DashboardLayoutTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/DashboardLayoutTest.java
@@ -1,8 +1,8 @@
package com.example.AviaryService.browser;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.example.AviaryService.repositories.UserRepository;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.LoadState;
@@ -31,7 +31,7 @@ class DashboardLayoutTest extends BrowserTestBase {
UserRepository users;
@Autowired
- ServiceTimelineRepository timelines;
+ StatusSheetItemRepository statusSheetItems;
private List attachConsoleErrorListener() {
List errors = new ArrayList<>();
@@ -43,17 +43,17 @@ private List attachConsoleErrorListener() {
private void seedThreeRows(User user) {
for (int i = 1; i <= 3; i++) {
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(user);
t.setAircraft(aircraftOf(user));
t.setItem("Row " + i);
t.setIsTitle(false);
- t.setTimelineOrder(i);
+ t.setStatusSheetOrder(i);
t.setDescription("Inspect");
setLastDone(t, "2025-10-01");
setDueDate(t, "2026-12-01");
t.setTimeLeft("");
- timelines.save(t);
+ statusSheetItems.save(t);
}
}
@@ -103,13 +103,13 @@ void addButtonExactlyFillsItsParentForm() {
void shortItemTextareaStartsAtAboutOneLineHeight() {
String username = seedUser("password");
User u = users.findByUsername(username);
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(u);
t.setAircraft(aircraftOf(u));
t.setItem("Oil"); // single short token — should fit one line
t.setIsTitle(false);
- t.setTimelineOrder(1);
- timelines.save(t);
+ t.setStatusSheetOrder(1);
+ statusSheetItems.save(t);
var errors = attachConsoleErrorListener();
loginAs(username, "password");
@@ -186,18 +186,18 @@ void dateInputsStayInsideTheirCellsWhenWindowIsNarrow() {
String username = seedUser("password");
User u = users.findByUsername(username);
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(u);
t.setAircraft(aircraftOf(u));
t.setItem("Magneto");
t.setIsTitle(false);
- t.setTimelineOrder(1);
+ t.setStatusSheetOrder(1);
t.setDescription("Inspect");
// Both a date and an hours value so each cell renders both inputs.
setLastDone(t, "2025-10-01 100.5");
setDueDate(t, "2026-12-01 250");
t.setTimeLeft("");
- timelines.save(t);
+ statusSheetItems.save(t);
loginAs(username, "password");
page.waitForLoadState(LoadState.NETWORKIDLE);
@@ -317,17 +317,17 @@ void timeLeftColumnIsSizedToContentNotAFatFixedWidth() {
// A long-overdue calendar date yields a wide value like
// "9600 days overdue" — the widest realistic Time Left content.
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(u);
t.setAircraft(aircraftOf(u));
t.setItem("Engine");
t.setIsTitle(false);
- t.setTimelineOrder(1);
+ t.setStatusSheetOrder(1);
t.setDescription("Inspect");
setLastDone(t, "2000-01-01");
setDueDate(t, "2000-01-01");
t.setTimeLeft("");
- timelines.save(t);
+ statusSheetItems.save(t);
loginAs(username, "password");
page.waitForLoadState(LoadState.NETWORKIDLE);
@@ -376,17 +376,17 @@ void calendarAlwaysStacksAboveHoursRegardlessOfAddOrder() {
// Empty Last Done / Due Date so the row starts with no inputs — just
// the chevron — and we drive the +/- menu ourselves.
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(u);
t.setAircraft(aircraftOf(u));
t.setItem("Battery");
t.setIsTitle(false);
- t.setTimelineOrder(1);
+ t.setStatusSheetOrder(1);
t.setDescription("Inspect");
setLastDone(t, "");
setDueDate(t, "");
t.setTimeLeft("");
- timelines.save(t);
+ statusSheetItems.save(t);
loginAs(username, "password");
page.waitForLoadState(LoadState.NETWORKIDLE);
diff --git a/src/browserTest/java/com/example/AviaryService/browser/DashboardMobileCardsTest.java b/src/browserTest/java/com/example/AviaryService/browser/DashboardMobileCardsTest.java
index 8d8f14e..10fb66a 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/DashboardMobileCardsTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/DashboardMobileCardsTest.java
@@ -1,10 +1,10 @@
package com.example.AviaryService.browser;
import com.example.AviaryService.entity.FlightLog;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
import com.example.AviaryService.repositories.FlightLogRepository;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.example.AviaryService.repositories.UserRepository;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
@@ -22,7 +22,7 @@
/**
* Regression tests for the mobile cards.
*
- * At phone width (<=768px) each Service Timeline row and each Log Book row
+ * At phone width (<=768px) each Status Sheet row and each Log Book row
* collapses into a card. The current design requires, on a 390px viewport:
* - the card lays out as a CSS grid (not the old space-between flex rows),
* - the Item is a bold headline (font-weight 700),
@@ -44,26 +44,26 @@ class DashboardMobileCardsTest extends BrowserTestBase {
UserRepository users;
@Autowired
- ServiceTimelineRepository timelines;
+ StatusSheetItemRepository statusSheetItems;
@Autowired
FlightLogRepository flightLogs;
private void seedData(User user) {
- ServiceTimeline title = new ServiceTimeline();
+ StatusSheetItem title = new StatusSheetItem();
title.setUser(user);
title.setAircraft(aircraftOf(user));
title.setItem("ENGINE");
title.setIsTitle(true);
- title.setTimelineOrder(0);
- timelines.save(title);
+ title.setStatusSheetOrder(0);
+ statusSheetItems.save(title);
- ServiceTimeline item = new ServiceTimeline();
+ StatusSheetItem item = new StatusSheetItem();
item.setUser(user);
item.setAircraft(aircraftOf(user));
item.setItem("Annual Inspection");
item.setIsTitle(false);
- item.setTimelineOrder(1);
+ item.setStatusSheetOrder(1);
item.setDescription("Inspect");
item.setCycleCalendarValue(12);
item.setCycleCalendarUnit("MONTHS");
@@ -71,15 +71,15 @@ private void seedData(User user) {
setLastDone(item, "2025-06-01");
setDueDate(item, "2026-06-01 2450.0");
item.setTimeLeft("11 mo\n86.0 hrs");
- timelines.save(item);
+ statusSheetItems.save(item);
FlightLog log = new FlightLog();
log.setUser(user);
log.setAircraft(aircraftOf(user));
log.setFromAirport("KSQL");
log.setToAirport("KPAO");
- log.setBlockTimeOut(1234.5);
- log.setBlockTimeIn(1236.1);
+ log.setHobbsTimeOut(1234.5);
+ log.setHobbsTimeIn(1236.1);
log.setTimeInServiceOut(1100.2);
log.setTimeInServiceIn(1101.5);
flightLogs.save(log);
@@ -108,12 +108,12 @@ private void openDashboardOnPhone() {
}
@Test
- void serviceTimelineCardUsesFlatBorderlessFields() {
+ void statusSheetCardUsesFlatBorderlessFields() {
openDashboardOnPhone();
Locator row = page.locator("tr.auto-save-row").first();
assertEquals("grid", cssOf(row, "display"),
- "Saved service-timeline card should lay out as a CSS grid on mobile");
+ "Saved Status Sheet card should lay out as a CSS grid on mobile");
// Item is a bold headline.
Locator itemText = row.locator("td[data-label='Item'] textarea");
diff --git a/src/browserTest/java/com/example/AviaryService/browser/DueDateAutoFillTest.java b/src/browserTest/java/com/example/AviaryService/browser/DueDateAutoFillTest.java
new file mode 100644
index 0000000..11b55b6
--- /dev/null
+++ b/src/browserTest/java/com/example/AviaryService/browser/DueDateAutoFillTest.java
@@ -0,0 +1,238 @@
+package com.example.AviaryService.browser;
+
+import com.example.AviaryService.entity.StatusSheetItem;
+import com.example.AviaryService.entity.User;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
+import com.microsoft.playwright.Locator;
+import com.microsoft.playwright.options.LoadState;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
+
+/**
+ * Spec 007 in a real browser: after the owner enters Last Done, the
+ * auto-filled Due Date appears on screen without reloading the page, and
+ * hours tidy to the 25.0 format when the owner leaves the box.
+ */
+class DueDateAutoFillTest extends BrowserTestBase {
+
+ @Autowired
+ StatusSheetItemRepository statusSheetItems;
+
+ private StatusSheetItem seed(String username, Integer calValue, String calUnit, Double cycleHours,
+ String lastDoneDate, String lastDoneHours) {
+ User user = userRepository.findByUsername(username);
+ StatusSheetItem t = new StatusSheetItem();
+ t.setUser(user);
+ t.setAircraft(aircraftOf(user));
+ t.setItem("Oil change");
+ t.setIsTitle(false);
+ t.setStatusSheetOrder(0);
+ t.setCycleCalendarValue(calValue);
+ t.setCycleCalendarUnit(calUnit);
+ t.setCycleHours(cycleHours);
+ t.setLastDoneDate(lastDoneDate);
+ t.setLastDoneHours(lastDoneHours);
+ return statusSheetItems.save(t);
+ }
+
+ private List open(String username) {
+ List errors = new ArrayList<>();
+ page.onConsoleMessage(m -> { if ("error".equals(m.type())) errors.add(m.text()); });
+ loginAs(username, "password");
+ page.waitForLoadState(LoadState.NETWORKIDLE);
+ return errors;
+ }
+
+ @Test
+ void dueDateAppearsRightAfterLastDoneWithoutReload() {
+ String username = seedUser("password");
+ StatusSheetItem item = seed(username, 1, "MONTHS", null, "2026-09-15", null);
+ List errors = open(username);
+
+ Locator row = page.locator("tr.auto-save-row[data-id='" + item.getId() + "']");
+ Locator lastDone = row.locator("td:nth-child(5) input[type='date']");
+ lastDone.fill("2026-10-30");
+
+ // No reload: the Due Date shows up in place once the save returns.
+ Locator due = row.locator("td:nth-child(6) input[type='date']");
+ assertThat(due).hasValue("2026-11-30", new com.microsoft.playwright.assertions.LocatorAssertions.HasValueOptions().setTimeout(5000));
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void hoursTidyOnBlurAndDueHoursFill() {
+ String username = seedUser("password");
+ StatusSheetItem item = seed(username, null, null, 100.0, null, "900");
+ List errors = open(username);
+
+ Locator row = page.locator("tr.auto-save-row[data-id='" + item.getId() + "']");
+ Locator lastHours = row.locator("td:nth-child(5) input.extra-input[type='text']");
+ assertThat(lastHours).hasValue("900.0"); // stored "900", shown with a decimal
+
+ lastHours.fill("950");
+ row.locator("td:nth-child(2)").click(); // leave the box
+ assertThat(lastHours).hasValue("950.0");
+
+ Locator dueHours = row.locator("td:nth-child(6) input.extra-input[type='text']");
+ assertThat(dueHours).hasValue("1050.0", new com.microsoft.playwright.assertions.LocatorAssertions.HasValueOptions().setTimeout(5000));
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ // Reported bug: 12 mo -> 1 mo -> delete the number -> Remove the Due Date
+ // calendar. The old Due Date used to reappear straight away.
+ @Test
+ void removedDueDateStaysRemovedWhenCycleNumberIsDeleted() {
+ String username = seedUser("password");
+ StatusSheetItem item = seed(username, 12, "MONTHS", null, "2020-12-01", null);
+ List errors = open(username);
+
+ Locator row = page.locator("tr.auto-save-row[data-id='" + item.getId() + "']");
+ Locator due = row.locator("td:nth-child(6) input[type='date']");
+ Locator cycleNumber = row.locator("input[name='cycleCalendarValue']");
+
+ // Setting Last Done again fills 12 months later.
+ row.locator("td:nth-child(5) input[type='date']").fill("2020-12-01");
+ cycleNumber.fill("12");
+ assertThat(due).hasValue("2021-12-01", new com.microsoft.playwright.assertions.LocatorAssertions.HasValueOptions().setTimeout(5000));
+
+ cycleNumber.fill("1");
+ assertThat(due).hasValue("2021-01-01", new com.microsoft.playwright.assertions.LocatorAssertions.HasValueOptions().setTimeout(5000));
+
+ cycleNumber.fill("");
+ page.waitForTimeout(1200); // let that save finish
+
+ Locator dueCell = row.locator("td:nth-child(6)");
+ dueCell.locator(".trigger-dropdown").click();
+ Locator remove = dueCell.locator(".add-type[data-type='calendar']");
+ remove.click(); // "Remove?" (has a value)
+ remove.click(); // confirm
+ page.waitForTimeout(1500); // save + response
+
+ assertThat(due).hasCount(0);
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void rollForwardBoxOffersResetToCycleForATypedDueDate() {
+ String username = seedUser("password");
+ StatusSheetItem item = seed(username, 1, "MONTHS", null, "2020-12-01", null);
+ List errors = open(username);
+
+ Locator row = page.locator("tr.auto-save-row[data-id='" + item.getId() + "']");
+ Locator due = row.locator("td:nth-child(6) input[type='date']");
+ row.locator("td:nth-child(5) input[type='date']").fill("2020-12-01");
+ assertThat(due).hasValue("2021-01-01", new com.microsoft.playwright.assertions.LocatorAssertions.HasValueOptions().setTimeout(5000));
+
+ // Owner types their own Due Date, then opens the box right away
+ // (before the 500ms save would have gone out on its own).
+ due.fill("2021-03-15");
+ row.locator(".complete-btn").click();
+
+ Locator reset = page.locator(".choice-box button[data-choice='reset']");
+ assertThat(reset).hasText("Reset to cycle (01/01/2021)");
+ assertThat(reset).isEnabled();
+ assertThat(page.locator(".choice-box button[data-choice='complete']")).isEnabled();
+ reset.click();
+
+ assertThat(due).hasValue("2021-01-01", new com.microsoft.playwright.assertions.LocatorAssertions.HasValueOptions().setTimeout(5000));
+ assertThat(row.locator("td:nth-child(5) input[type='date']")).hasValue("2020-12-01");
+
+ // Now it matches: Reset is grayed out with the reason.
+ row.locator(".complete-btn").click();
+ assertThat(reset).isDisabled();
+ assertThat(page.locator(".choice-box")).containsText("Due Date already matches the cycle");
+ page.keyboard().press("Escape");
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ // ── Spec 008: Mark complete asks "When was this done?" ────────────
+
+ private StatusSheetItem seedDue(String username, Integer calValue, String calUnit, Double cycleHours,
+ String lastDoneDate, String lastDoneHours, String dueDate, String dueHours) {
+ StatusSheetItem t = seed(username, calValue, calUnit, cycleHours, lastDoneDate, lastDoneHours);
+ t.setDueDateDate(dueDate);
+ t.setDueDateHours(dueHours);
+ return statusSheetItems.save(t);
+ }
+
+ private void openMarkComplete(Locator row) {
+ row.locator(".complete-btn").click();
+ page.locator(".choice-box button[data-choice='complete']").click();
+ assertThat(page.locator(".done-box")).isVisible();
+ }
+
+ @Test
+ void markCompleteRollsFromTheDueDateWithTruthfulToast() {
+ String username = seedUser("password");
+ StatusSheetItem item = seedDue(username, 1, "MONTHS", 100.0, "2026-11-01", "1200.0", "2026-12-01", "1300.0");
+ List errors = open(username);
+ Locator row = page.locator("tr.auto-save-row[data-id='" + item.getId() + "']");
+
+ openMarkComplete(row);
+ Locator box = page.locator(".done-box");
+ assertThat(box.locator("input[name='doneDate']")).hasValue("2026-12-01");
+ assertThat(box.locator("input[name='doneHours']")).hasValue("1300.0");
+ assertThat(box.locator(".done-next")).hasText("Next due: 01/01/2027 · 1400.0 hrs");
+
+ // Editing the date updates "Next due" live.
+ box.locator("input[name='doneDate']").fill("2026-11-20");
+ assertThat(box.locator(".done-next")).hasText("Next due: 12/20/2026 · 1400.0 hrs");
+ box.locator("input[name='doneDate']").fill("2026-12-01");
+ assertThat(box.locator(".done-next")).hasText("Next due: 01/01/2027 · 1400.0 hrs");
+
+ // Double-click Save: rolls once.
+ box.locator(".confirm-btn.ok").dblclick();
+ assertThat(page.locator(".toast").last()).containsText("Rolled forward. Last Done 12/01/2026 · 1300.0 hrs, Due 01/01/2027 · 1400.0 hrs.");
+ assertThat(row.locator("td:nth-child(5) input[type='date']")).hasValue("2026-12-01");
+ assertThat(row.locator("td:nth-child(6) input[type='date']")).hasValue("2027-01-01");
+ assertThat(row.locator("td:nth-child(6) input.extra-input[type='text']")).hasValue("1400.0");
+ assertThat(page.locator(".done-box")).hasCount(0);
+
+ // Second time: the box previews the next cycle.
+ openMarkComplete(row);
+ assertThat(page.locator(".done-box input[name='doneDate']")).hasValue("2027-01-01");
+ assertThat(page.locator(".done-box .done-next")).hasText("Next due: 02/01/2027 · 1500.0 hrs");
+ page.keyboard().press("Escape");
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void emptyBoxesGrayOutSaveAndRowWithNothingStartsWithToday() {
+ String username = seedUser("password");
+ StatusSheetItem item = seedDue(username, 1, "MONTHS", 100.0, null, null, null, null);
+ List errors = open(username);
+ Locator row = page.locator("tr.auto-save-row[data-id='" + item.getId() + "']");
+
+ openMarkComplete(row);
+ Locator box = page.locator(".done-box");
+ assertThat(box.locator("input[name='doneDate']")).hasValue(java.time.LocalDate.now().toString());
+ assertThat(box.locator("input[name='doneHours']")).hasValue("");
+
+ box.locator("input[name='doneDate']").fill("");
+ assertThat(box.locator(".done-next")).hasText("Enter when it was done.");
+ assertThat(box.locator(".confirm-btn.ok")).isDisabled();
+ page.keyboard().press("Escape");
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ // Spec 011: no hint text under Mark complete; Reset keeps its reason.
+ @Test
+ void markCompleteHasNoHintButResetKeepsItsReason() {
+ String username = seedUser("password");
+ StatusSheetItem item = seedDue(username, 1, "MONTHS", null, "2026-11-01", null, "2026-12-01", null);
+ List errors = open(username);
+ Locator row = page.locator("tr.auto-save-row[data-id='" + item.getId() + "']");
+ row.locator(".complete-btn").click();
+ Locator complete = page.locator(".choice-box .choice-item:has(button[data-choice='complete'])");
+ assertThat(complete.locator(".choice-hint")).hasCount(0);
+ Locator reset = page.locator(".choice-box .choice-item:has(button[data-choice='reset'])");
+ assertThat(reset.locator(".choice-hint")).hasText("Due Date already matches the cycle");
+ page.keyboard().press("Escape");
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/FleetPickerTest.java b/src/browserTest/java/com/example/AviaryService/browser/FleetPickerTest.java
index 022a5e1..9d10aec 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/FleetPickerTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/FleetPickerTest.java
@@ -10,9 +10,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import com.example.AviaryService.entity.Aircraft;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.options.LoadState;
@@ -23,7 +23,7 @@
*/
class FleetPickerTest extends BrowserTestBase {
- @Autowired ServiceTimelineRepository timelines;
+ @Autowired StatusSheetItemRepository statusSheetItems;
private Aircraft a;
private Aircraft b;
@@ -46,14 +46,14 @@ private void seedFleet() {
}
private void row(User u, Aircraft on, String item, int order, String due) {
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(u);
t.setAircraft(on);
t.setItem(item);
t.setIsTitle(false);
- t.setTimelineOrder(order);
+ t.setStatusSheetOrder(order);
t.setDueDateDate(due);
- timelines.save(t);
+ statusSheetItems.save(t);
}
private List visibleItems(Page p) {
@@ -117,8 +117,8 @@ void actionInAnOlderTabLandsOnThatTabsAircraft() {
+ " return r.status; }");
assertEquals(200, ((Number) status).intValue());
- assertTrue(timelines.findByAircraftOrderByTimelineOrderAsc(a).stream().anyMatch(t -> t.getItem().equals("Tab one row")));
- assertTrue(timelines.findByAircraftOrderByTimelineOrderAsc(b).stream().noneMatch(t -> t.getItem().equals("Tab one row")));
+ assertTrue(statusSheetItems.findByAircraftOrderByStatusSheetOrderAsc(a).stream().anyMatch(t -> t.getItem().equals("Tab one row")));
+ assertTrue(statusSheetItems.findByAircraftOrderByStatusSheetOrderAsc(b).stream().noneMatch(t -> t.getItem().equals("Tab one row")));
}
// The plane button must never sit under Share / Import with AI / Logout,
diff --git a/src/browserTest/java/com/example/AviaryService/browser/FlightLogTableEdgeCasesTest.java b/src/browserTest/java/com/example/AviaryService/browser/FlightLogTableEdgeCasesTest.java
index 827b9c4..50b89ae 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/FlightLogTableEdgeCasesTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/FlightLogTableEdgeCasesTest.java
@@ -43,15 +43,15 @@ private void assertNoConsoleErrors(List errors) {
}
private FlightLog saveLog(User user, String from, String to,
- Double blockTimeOut, Double blockTimeIn,
+ Double hobbsTimeOut, Double hobbsTimeIn,
Double timeInServiceOut, Double timeInServiceIn) {
FlightLog log = new FlightLog();
log.setUser(user);
log.setAircraft(aircraftOf(user));
log.setFromAirport(from);
log.setToAirport(to);
- log.setBlockTimeOut(blockTimeOut);
- log.setBlockTimeIn(blockTimeIn);
+ log.setHobbsTimeOut(hobbsTimeOut);
+ log.setHobbsTimeIn(hobbsTimeIn);
log.setTimeInServiceOut(timeInServiceOut);
log.setTimeInServiceIn(timeInServiceIn);
return flightLogs.save(log);
@@ -86,8 +86,8 @@ void typicalLogRendersAllCellsWithDecimalHours() {
assertThat(row).hasCount(1);
assertThat(row.locator("input[name='fromAirport']")).hasValue("KAAA");
assertThat(row.locator("input[name='toAirport']")).hasValue("KBBB");
- assertThat(row.locator("input[name='blockTimeOut']")).hasValue("100.0");
- assertThat(row.locator("input[name='blockTimeIn']")).hasValue("101.5");
+ assertThat(row.locator("input[name='hobbsTimeOut']")).hasValue("100.0");
+ assertThat(row.locator("input[name='hobbsTimeIn']")).hasValue("101.5");
assertThat(row.locator("input[name='timeInServiceOut']")).hasValue("50.0");
assertThat(row.locator("input[name='timeInServiceIn']")).hasValue("51.5");
@@ -113,8 +113,8 @@ void nullAirportsAndHoursRenderEmptyWithoutBreaking() {
assertThat(row).hasCount(1);
assertThat(row.locator("input[name='fromAirport']")).hasValue("");
assertThat(row.locator("input[name='toAirport']")).hasValue("");
- assertThat(row.locator("input[name='blockTimeOut']")).hasValue("");
- assertThat(row.locator("input[name='blockTimeIn']")).hasValue("");
+ assertThat(row.locator("input[name='hobbsTimeOut']")).hasValue("");
+ assertThat(row.locator("input[name='hobbsTimeIn']")).hasValue("");
assertThat(row.locator("input[name='timeInServiceOut']")).hasValue("");
assertThat(row.locator("input[name='timeInServiceIn']")).hasValue("");
@@ -134,8 +134,8 @@ void zeroDurationLegRendersWithZeroValues() {
page.waitForLoadState(LoadState.NETWORKIDLE);
var row = page.locator("tbody#logbook-body tr.log-row[data-id='" + log.getId() + "']");
- assertThat(row.locator("input[name='blockTimeOut']")).hasValue("0.0");
- assertThat(row.locator("input[name='blockTimeIn']")).hasValue("0.0");
+ assertThat(row.locator("input[name='hobbsTimeOut']")).hasValue("0.0");
+ assertThat(row.locator("input[name='hobbsTimeIn']")).hasValue("0.0");
assertThat(row.locator("input[name='timeInServiceOut']")).hasValue("0.0");
assertThat(row.locator("input[name='timeInServiceIn']")).hasValue("0.0");
@@ -153,7 +153,7 @@ void veryLargeHoursValueRenders() {
page.waitForLoadState(LoadState.NETWORKIDLE);
var row = page.locator("tbody#logbook-body tr.log-row[data-id='" + log.getId() + "']");
- assertThat(row.locator("input[name='blockTimeIn']")).hasValue("99999.9");
+ assertThat(row.locator("input[name='hobbsTimeIn']")).hasValue("99999.9");
assertThat(row.locator("input[name='timeInServiceIn']")).hasValue("99999.9");
assertNoConsoleErrors(errors);
diff --git a/src/browserTest/java/com/example/AviaryService/browser/HoursInfoMarksTest.java b/src/browserTest/java/com/example/AviaryService/browser/HoursInfoMarksTest.java
new file mode 100644
index 0000000..51d2faa
--- /dev/null
+++ b/src/browserTest/java/com/example/AviaryService/browser/HoursInfoMarksTest.java
@@ -0,0 +1,96 @@
+package com.example.AviaryService.browser;
+
+import com.microsoft.playwright.Locator;
+import com.microsoft.playwright.options.LoadState;
+import org.junit.jupiter.api.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Spec 005: info marks next to Hobbs Time and Time in Service on My Hours.
+ * Checks the text, that hover/focus/tap reveal it, that tapping elsewhere
+ * closes it, and that it fits a phone screen without horizontal scroll.
+ */
+class HoursInfoMarksTest extends BrowserTestBase {
+
+ private static final String HOBBS_TIP =
+ "Hobbs time: engine running time, from engine start to shutdown. Includes taxi and run-up.";
+ private static final String TIS_TIP =
+ "Flight time: time in the air, from takeoff to landing. Used for maintenance and inspections.";
+
+ private String tipDisplay(Locator mark) {
+ return (String) mark.evaluate("el => getComputedStyle(el, '::after').display");
+ }
+
+ private List openDashboard() {
+ String username = seedUser("password");
+ List errors = new ArrayList<>();
+ page.onConsoleMessage(m -> { if ("error".equals(m.type())) errors.add(m.text()); });
+ loginAs(username, "password");
+ page.waitForLoadState(LoadState.NETWORKIDLE);
+ return errors;
+ }
+
+ @Test
+ void infoMarksHaveTheRightTextAndOpenOnHoverFocusAndTap() {
+ List errors = openDashboard();
+ Locator hobbs = page.locator("#hobbs-time-info");
+ Locator tis = page.locator("#time-in-service-info");
+
+ assertThat(hobbs).hasAttribute("aria-label", HOBBS_TIP);
+ assertThat(hobbs).hasAttribute("data-tip", HOBBS_TIP);
+ assertThat(tis).hasAttribute("aria-label", TIS_TIP);
+ assertThat(tis).hasAttribute("data-tip", TIS_TIP);
+
+ assertEquals("none", tipDisplay(hobbs), "tooltip hidden by default");
+
+ hobbs.hover();
+ page.waitForTimeout(200);
+ assertEquals("block", tipDisplay(hobbs), "hover shows tooltip");
+
+ page.mouse().move(0, 0);
+ tis.click();
+ page.waitForTimeout(200);
+ assertTrue(tis.getAttribute("class").contains("open"), "tap opens tooltip");
+ page.locator("h3:has-text('My Hours')").click();
+ assertTrue(!tis.getAttribute("class").contains("open"), "tap elsewhere closes it");
+
+ page.keyboard().press("Tab");
+ tis.focus();
+ page.keyboard().press("Escape");
+ assertTrue(!tis.getAttribute("class").contains("open"));
+
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void statusSheetTabHasMaintenanceInspectionsTag() {
+ List errors = openDashboard();
+ Locator tag = page.locator("#status-sheet-info");
+ assertThat(page.locator(".tab-button[data-tab='status-sheet-tab']")).hasText("Status Sheet");
+ assertThat(tag).hasAttribute("data-tip", "Maintenance/inspections");
+ assertThat(tag).hasAttribute("aria-label", "Status Sheet: maintenance/inspections");
+ tag.hover();
+ page.waitForTimeout(200);
+ assertEquals("block", tipDisplay(tag), "hover shows the tag text");
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void infoMarksFitAPhoneScreen() {
+ page.setViewportSize(360, 740);
+ openDashboard();
+ Locator tis = page.locator("#time-in-service-info");
+ tis.scrollIntoViewIfNeeded();
+ tis.click();
+ page.waitForTimeout(200);
+ Object overflow = page.evaluate(
+ "() => document.documentElement.scrollWidth > document.documentElement.clientWidth");
+ assertEquals(false, overflow, "open tooltip must not cause horizontal scroll at 360px");
+ }
+}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/HoursTableEdgeCasesTest.java b/src/browserTest/java/com/example/AviaryService/browser/HoursTableEdgeCasesTest.java
index 17a83f2..35c888d 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/HoursTableEdgeCasesTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/HoursTableEdgeCasesTest.java
@@ -41,7 +41,7 @@ private void assertNoConsoleErrors(List errors) {
@Test
void freshUserShowsZeroHoursAndEmptyAircraftInfo() {
- // User with no edits — getBlockTimeHours/getTimeInServiceHours default to 0.0,
+ // User with no edits — getHobbsTimeHours/getTimeInServiceHours default to 0.0,
// aircraft info fields are null.
String username = seedUser("password");
List errors = attachConsoleErrorListener();
@@ -49,17 +49,17 @@ void freshUserShowsZeroHoursAndEmptyAircraftInfo() {
loginAs(username, "password");
page.waitForLoadState(LoadState.NETWORKIDLE);
- // Hours block always renders "Block Time: 0.0" / "Time in Service: 0.0" for
+ // Hours block always renders "Hobbs Time: 0.0" / "Time in Service: 0.0" for
// a brand-new user because the getters coalesce null → 0.0.
- assertThat(page.locator("#current-block-time-display")).containsText("Block Time:");
- assertThat(page.locator("#current-block-time-display")).containsText("0");
+ assertThat(page.locator("#current-hobbs-time-display")).containsText("Hobbs Time:");
+ assertThat(page.locator("#current-hobbs-time-display")).containsText("0");
assertThat(page.locator("#current-time-in-service-display")).containsText("Time in Service:");
assertThat(page.locator("#current-time-in-service-display")).containsText("0");
// Aircraft info inputs are empty for a fresh user.
assertThat(page.locator("input[name='makeModel']")).hasValue("");
assertThat(page.locator("input[name='tailNumber']")).hasValue("");
- assertThat(page.locator("input[name='ownerName']")).hasValue("");
+ assertThat(page.locator("input[name='operatorName']")).hasValue("");
assertThat(page.locator("input[name='makeModelSN']")).hasValue("");
assertNoConsoleErrors(errors);
@@ -69,7 +69,7 @@ void freshUserShowsZeroHoursAndEmptyAircraftInfo() {
void decimalHoursRenderWithoutTruncation() {
String username = seedUser("password");
Aircraft u = aircraftOf(username);
- u.setBlockTimeHours(1234.5);
+ u.setHobbsTimeHours(1234.5);
u.setTimeInServiceHours(987.6);
aircraftRepository.save(u);
@@ -79,11 +79,11 @@ void decimalHoursRenderWithoutTruncation() {
// The display string is built by Thymeleaf string-concat which uses
// Double.toString(); 1234.5 should appear verbatim.
- assertThat(page.locator("#current-block-time-display")).containsText("1234.5");
+ assertThat(page.locator("#current-hobbs-time-display")).containsText("1234.5");
assertThat(page.locator("#current-time-in-service-display")).containsText("987.6");
// The "Edit" form input mirrors the same value.
- assertThat(page.locator("#current-block-time")).hasValue("1234.5");
+ assertThat(page.locator("#current-hobbs-time")).hasValue("1234.5");
assertThat(page.locator("#current-time-in-service")).hasValue("987.6");
assertNoConsoleErrors(errors);
@@ -93,7 +93,7 @@ void decimalHoursRenderWithoutTruncation() {
void veryLargeHoursValueRenders() {
String username = seedUser("password");
Aircraft u = aircraftOf(username);
- u.setBlockTimeHours(99999.9);
+ u.setHobbsTimeHours(99999.9);
u.setTimeInServiceHours(99999.9);
aircraftRepository.save(u);
@@ -101,7 +101,7 @@ void veryLargeHoursValueRenders() {
loginAs(username, "password");
page.waitForLoadState(LoadState.NETWORKIDLE);
- assertThat(page.locator("#current-block-time-display")).containsText("99999.9");
+ assertThat(page.locator("#current-hobbs-time-display")).containsText("99999.9");
assertThat(page.locator("#current-time-in-service-display")).containsText("99999.9");
assertNoConsoleErrors(errors);
@@ -113,7 +113,7 @@ void aircraftInfoFieldsPopulateInputs() {
Aircraft u = aircraftOf(username);
u.setMakeModel("Cessna 172");
u.setTailNumber("N12345");
- u.setOwnerName("Daniel I.");
+ u.setOperatorName("Daniel I.");
u.setMakeModelSN("17280342");
aircraftRepository.save(u);
@@ -123,7 +123,7 @@ void aircraftInfoFieldsPopulateInputs() {
assertThat(page.locator("input[name='makeModel']")).hasValue("Cessna 172");
assertThat(page.locator("input[name='tailNumber']")).hasValue("N12345");
- assertThat(page.locator("input[name='ownerName']")).hasValue("Daniel I.");
+ assertThat(page.locator("input[name='operatorName']")).hasValue("Daniel I.");
assertThat(page.locator("input[name='makeModelSN']")).hasValue("17280342");
assertNoConsoleErrors(errors);
@@ -158,7 +158,7 @@ void zeroHoursRendersWithoutCollapsingToEmpty() {
// not render as blank.
String username = seedUser("password");
Aircraft u = aircraftOf(username);
- u.setBlockTimeHours(0.0);
+ u.setHobbsTimeHours(0.0);
u.setTimeInServiceHours(0.0);
aircraftRepository.save(u);
@@ -166,9 +166,9 @@ void zeroHoursRendersWithoutCollapsingToEmpty() {
loginAs(username, "password");
page.waitForLoadState(LoadState.NETWORKIDLE);
- // "Block Time: 0.0" must include the "0" — not "Block Time: ".
- assertThat(page.locator("#current-block-time-display")).containsText("Block Time:");
- assertThat(page.locator("#current-block-time-display")).containsText("0");
+ // "Hobbs Time: 0.0" must include the "0" — not "Hobbs Time: ".
+ assertThat(page.locator("#current-hobbs-time-display")).containsText("Hobbs Time:");
+ assertThat(page.locator("#current-hobbs-time-display")).containsText("0");
assertNoConsoleErrors(errors);
}
@@ -179,18 +179,18 @@ void manualSourceStampSetsHoursUpdatedDataAttributes() {
// dashboard.js reads to render the "last updated" label.
String username = seedUser("password");
Aircraft u = aircraftOf(username);
- u.setBlockTimeHours(50.0);
- u.setBlockTimeUpdatedAt(java.time.Instant.parse("2025-10-01T12:00:00Z"));
- u.setBlockTimeUpdatedSource("manual");
+ u.setHobbsTimeHours(50.0);
+ u.setHobbsTimeUpdatedAt(java.time.Instant.parse("2025-10-01T12:00:00Z"));
+ u.setHobbsTimeUpdatedSource("manual");
aircraftRepository.save(u);
List errors = attachConsoleErrorListener();
loginAs(username, "password");
page.waitForLoadState(LoadState.NETWORKIDLE);
- assertThat(page.locator("#block-time-updated"))
+ assertThat(page.locator("#hobbs-time-updated"))
.hasAttribute("data-source", "manual");
- assertThat(page.locator("#block-time-updated"))
+ assertThat(page.locator("#hobbs-time-updated"))
.hasAttribute("data-updated", "2025-10-01T12:00:00Z");
assertNoConsoleErrors(errors);
diff --git a/src/browserTest/java/com/example/AviaryService/browser/ImportWithAiEntryTest.java b/src/browserTest/java/com/example/AviaryService/browser/ImportWithAiEntryTest.java
index 7bbfeb2..156ff5a 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/ImportWithAiEntryTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/ImportWithAiEntryTest.java
@@ -5,20 +5,20 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
-import com.example.AviaryService.entity.ServiceTimeline;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.entity.StatusSheetItem;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.microsoft.playwright.options.LoadState;
/**
* Ways into the Import with AI page from the dashboard: the labeled header
- * control (text on desktop, named icon on a phone). The empty-timeline
+ * control (text on desktop, named icon on a phone). The empty Status Sheet
* "Have records in a spreadsheet?" prompt was removed; an empty aircraft
* shows only "Add your first maintenance item".
*/
class ImportWithAiEntryTest extends BrowserTestBase {
@Autowired
- ServiceTimelineRepository timelineRepository;
+ StatusSheetItemRepository statusSheetItemRepository;
private void assertNoSidewaysScroll(int width) {
Object overflow = page.evaluate("document.documentElement.scrollWidth > window.innerWidth");
@@ -51,10 +51,10 @@ void headerShowsNamedIconOnPhone() {
assertNoSidewaysScroll(390);
}
- // ---- empty timeline ----
+ // ---- empty Status Sheet ----
@Test
- void emptyTimelineShowsFirstItemButtonAndNoImportPrompt() {
+ void emptyStatusSheetShowsFirstItemButtonAndNoImportPrompt() {
page.setViewportSize(1280, 800);
loginAs(seedUser("password123"), "password123");
@@ -68,23 +68,23 @@ void neitherControlPrints() {
loginAs(seedUser("password123"), "password123");
page.emulateMedia(new com.microsoft.playwright.Page.EmulateMediaOptions()
.setMedia(com.microsoft.playwright.options.Media.PRINT));
- assertThat(page.locator("#empty-timeline")).isHidden();
+ assertThat(page.locator("#empty-statusSheetItem")).isHidden();
assertThat(page.locator("#connections-link")).isHidden();
}
@Test
- void timelineWithItemsHasNoPrompt() {
+ void statusSheetWithItemsHasNoPrompt() {
page.setViewportSize(1280, 800);
String username = seedUser("password123");
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(userRepository.findByUsername(username));
t.setAircraft(aircraftOf(userRepository.findByUsername(username)));
t.setItem("Annual");
- t.setTimelineOrder(0);
- timelineRepository.save(t);
+ t.setStatusSheetOrder(0);
+ statusSheetItemRepository.save(t);
loginAs(username, "password123");
- assertThat(page.locator("#empty-timeline")).hasCount(0);
+ assertThat(page.locator("#empty-statusSheetItem")).hasCount(0);
}
@Test
@@ -92,12 +92,12 @@ void addingFirstRowRemovesPromptWithoutReload() {
page.setViewportSize(1280, 800);
loginAs(seedUser("password123"), "password123");
page.waitForLoadState(LoadState.NETWORKIDLE);
- assertThat(page.locator("#empty-timeline")).isVisible();
+ assertThat(page.locator("#empty-statusSheetItem")).isVisible();
page.locator(".add-row td[data-label='Item'] textarea").fill("Oil change");
page.locator("td.add-cell form button.add-button").click();
assertThat(page.locator(".sortable tr[data-id]")).hasCount(1);
- assertThat(page.locator("#empty-timeline")).hasCount(0);
+ assertThat(page.locator("#empty-statusSheetItem")).hasCount(0);
}
}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineGridTest.java b/src/browserTest/java/com/example/AviaryService/browser/StatusSheetGridTest.java
similarity index 93%
rename from src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineGridTest.java
rename to src/browserTest/java/com/example/AviaryService/browser/StatusSheetGridTest.java
index 682240b..0b85355 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineGridTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/StatusSheetGridTest.java
@@ -1,8 +1,8 @@
package com.example.AviaryService.browser;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.example.AviaryService.repositories.UserRepository;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
@@ -14,7 +14,7 @@
import java.nio.file.Paths;
/**
- * Regression tests for the "continuous grid" service-timeline redesign.
+ * Regression tests for the "continuous grid" Status Sheet redesign.
*
* The redesign made every cell's field fill its whole grid cell (borderless,
* vertically centered) so there is no dead gap above/below short controls when
@@ -28,30 +28,30 @@
* These tests guard each of those against regressions and drop before/after
* screenshots (saved row + add row) at two desktop widths into the build report.
*/
-class ServiceTimelineGridTest extends BrowserTestBase {
+class StatusSheetGridTest extends BrowserTestBase {
@Autowired
UserRepository users;
@Autowired
- ServiceTimelineRepository timelines;
+ StatusSheetItemRepository statusSheetItems;
/** A title row + one item row whose two-line Cycle makes the row tall. */
private long seedTallCycleRow(User user) {
- ServiceTimeline title = new ServiceTimeline();
+ StatusSheetItem title = new StatusSheetItem();
title.setUser(user);
title.setAircraft(aircraftOf(user));
title.setItem("ENGINE - LEFT");
title.setIsTitle(true);
- title.setTimelineOrder(1);
- timelines.save(title);
+ title.setStatusSheetOrder(1);
+ statusSheetItems.save(title);
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(user);
t.setAircraft(aircraftOf(user));
t.setItem("Oil & filter change");
t.setIsTitle(false);
- t.setTimelineOrder(2);
+ t.setStatusSheetOrder(2);
t.setDescription("Inspect");
t.setCycleCalendarValue(50);
t.setCycleCalendarUnit("DAYS");
@@ -59,7 +59,7 @@ private long seedTallCycleRow(User user) {
setLastDone(t, ""); // empty → exercises the "Add date / hrs" placeholder
setDueDate(t, "");
t.setTimeLeft("");
- timelines.save(t);
+ statusSheetItems.save(t);
return t.getId();
}
@@ -234,7 +234,7 @@ void screenshotsSavedAndAddRowsAtMultipleDesktopWidths() {
page.setViewportSize(w, 800);
page.waitForLoadState(LoadState.NETWORKIDLE);
Path shot = Paths.get("build", "reports", "browserTest-screenshots",
- "timeline-grid-" + w + ".png");
+ "status-sheet-grid-" + w + ".png");
shot.toFile().getParentFile().mkdirs();
page.screenshot(new Page.ScreenshotOptions().setPath(shot).setFullPage(true));
}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineMobileDragTest.java b/src/browserTest/java/com/example/AviaryService/browser/StatusSheetMobileDragTest.java
similarity index 97%
rename from src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineMobileDragTest.java
rename to src/browserTest/java/com/example/AviaryService/browser/StatusSheetMobileDragTest.java
index 357220f..a6ec34f 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineMobileDragTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/StatusSheetMobileDragTest.java
@@ -1,8 +1,8 @@
package com.example.AviaryService.browser;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.example.AviaryService.repositories.UserRepository;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
@@ -39,7 +39,7 @@
* Screenshots of the grip and a before/after drag are dropped into the build
* report at build/browsertest-screenshots/.
*/
-class ServiceTimelineMobileDragTest extends BrowserTestBase {
+class StatusSheetMobileDragTest extends BrowserTestBase {
private static final int PHONE_W = 390;
private static final int PHONE_H = 844;
@@ -48,35 +48,35 @@ class ServiceTimelineMobileDragTest extends BrowserTestBase {
UserRepository users;
@Autowired
- ServiceTimelineRepository timelines;
+ StatusSheetItemRepository statusSheetItems;
/** Two plain item rows (no title) so a drag swap is unambiguous. */
private void seedTwoItems(User user) {
- ServiceTimeline alpha = new ServiceTimeline();
+ StatusSheetItem alpha = new StatusSheetItem();
alpha.setUser(user);
alpha.setAircraft(aircraftOf(user));
alpha.setItem("Alpha Item");
alpha.setIsTitle(false);
- alpha.setTimelineOrder(0);
+ alpha.setStatusSheetOrder(0);
alpha.setDescription("Inspect");
alpha.setCycleCalendarValue(12);
alpha.setCycleCalendarUnit("MONTHS");
setLastDone(alpha, "2025-06-01");
setDueDate(alpha, "2026-06-01");
- timelines.save(alpha);
+ statusSheetItems.save(alpha);
- ServiceTimeline bravo = new ServiceTimeline();
+ StatusSheetItem bravo = new StatusSheetItem();
bravo.setUser(user);
bravo.setAircraft(aircraftOf(user));
bravo.setItem("Bravo Item");
bravo.setIsTitle(false);
- bravo.setTimelineOrder(1);
+ bravo.setStatusSheetOrder(1);
bravo.setDescription("Test");
bravo.setCycleCalendarValue(6);
bravo.setCycleCalendarUnit("MONTHS");
setLastDone(bravo, "2025-01-01");
setDueDate(bravo, "2025-07-01");
- timelines.save(bravo);
+ statusSheetItems.save(bravo);
}
private void openDashboardOnPhone() {
@@ -269,18 +269,18 @@ void calendarPickerDoesNotOverlapChevronOnMobile() {
private void seedFourItems(User user) {
String[] names = { "Alpha Item", "Bravo Item", "Charlie Item", "Delta Item" };
for (int i = 0; i < names.length; i++) {
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(user);
t.setAircraft(aircraftOf(user));
t.setItem(names[i]);
t.setIsTitle(false);
- t.setTimelineOrder(i);
+ t.setStatusSheetOrder(i);
t.setDescription("Desc " + i);
t.setCycleCalendarValue(12);
t.setCycleCalendarUnit("MONTHS");
setLastDone(t, "2025-06-01");
setDueDate(t, "2026-06-01");
- timelines.save(t);
+ statusSheetItems.save(t);
}
}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineMobileLayoutTest.java b/src/browserTest/java/com/example/AviaryService/browser/StatusSheetMobileLayoutTest.java
similarity index 95%
rename from src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineMobileLayoutTest.java
rename to src/browserTest/java/com/example/AviaryService/browser/StatusSheetMobileLayoutTest.java
index 55c5eaa..7705de3 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineMobileLayoutTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/StatusSheetMobileLayoutTest.java
@@ -1,8 +1,8 @@
package com.example.AviaryService.browser;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.example.AviaryService.repositories.UserRepository;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Page;
@@ -21,7 +21,7 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
- * Regression tests for the mobile service-timeline layout redesign:
+ * Regression tests for the mobile Status Sheet layout redesign:
*
* - each saved item card lays out 1 / 2-2 / 1 (Item headline full width;
* Description|Last Done; Cycle|Due Date; Time Left full width), so the left
@@ -34,7 +34,7 @@
* Screenshots of the collapsed card and the title-mode add row are dropped into
* the build report.
*/
-class ServiceTimelineMobileLayoutTest extends BrowserTestBase {
+class StatusSheetMobileLayoutTest extends BrowserTestBase {
private static final int PHONE_W = 390;
private static final int PHONE_H = 844;
@@ -43,23 +43,23 @@ class ServiceTimelineMobileLayoutTest extends BrowserTestBase {
UserRepository users;
@Autowired
- ServiceTimelineRepository timelines;
+ StatusSheetItemRepository statusSheetItems;
private void seedData(User user) {
- ServiceTimeline title = new ServiceTimeline();
+ StatusSheetItem title = new StatusSheetItem();
title.setUser(user);
title.setAircraft(aircraftOf(user));
title.setItem("ENGINE");
title.setIsTitle(true);
- title.setTimelineOrder(0);
- timelines.save(title);
+ title.setStatusSheetOrder(0);
+ statusSheetItems.save(title);
- ServiceTimeline item = new ServiceTimeline();
+ StatusSheetItem item = new StatusSheetItem();
item.setUser(user);
item.setAircraft(aircraftOf(user));
item.setItem("Annual Inspection");
item.setIsTitle(false);
- item.setTimelineOrder(1);
+ item.setStatusSheetOrder(1);
item.setDescription("Inspect");
item.setCycleCalendarValue(12);
item.setCycleCalendarUnit("MONTHS");
@@ -67,7 +67,7 @@ private void seedData(User user) {
setLastDone(item, "2025-06-01");
setDueDate(item, "2026-06-01 2450.0");
item.setTimeLeft("11 mo\n86.0 hrs");
- timelines.save(item);
+ statusSheetItems.save(item);
}
private double[] rectOf(Locator loc) {
@@ -279,7 +279,7 @@ void timeLeftIsHorizontallyCentered() {
}
@Test
- void serviceTimelineNeverOverflowsViewportAcrossBreakpoints() {
+ void statusSheetNeverOverflowsViewportAcrossBreakpoints() {
String username = seedUser("password");
User u = users.findByUsername(username);
seedData(u);
@@ -299,7 +299,7 @@ void serviceTimelineNeverOverflowsViewportAcrossBreakpoints() {
}
// Visual evidence at a width that used to overflow with the desktop table.
if (w == 850) {
- Path shot = Paths.get("build", "browsertest-screenshots", "timeline-850-no-overflow.png");
+ Path shot = Paths.get("build", "browsertest-screenshots", "status-sheet-850-no-overflow.png");
try {
Files.createDirectories(shot.getParent());
} catch (Exception ignored) { }
@@ -307,7 +307,7 @@ void serviceTimelineNeverOverflowsViewportAcrossBreakpoints() {
}
}
if (over.length() > 0) {
- throw new AssertionError("Service timeline overflows the viewport at:" + over);
+ throw new AssertionError("Status Sheet overflows the viewport at:" + over);
}
}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineTableEdgeCasesTest.java b/src/browserTest/java/com/example/AviaryService/browser/StatusSheetTableEdgeCasesTest.java
similarity index 88%
rename from src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineTableEdgeCasesTest.java
rename to src/browserTest/java/com/example/AviaryService/browser/StatusSheetTableEdgeCasesTest.java
index 08cd669..bfb84b4 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/ServiceTimelineTableEdgeCasesTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/StatusSheetTableEdgeCasesTest.java
@@ -1,8 +1,8 @@
package com.example.AviaryService.browser;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.example.AviaryService.repositories.UserRepository;
import com.microsoft.playwright.options.LoadState;
import org.junit.jupiter.api.Test;
@@ -14,22 +14,22 @@
import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
/**
- * Edge-case rendering tests for the Service Timeline table.
+ * Edge-case rendering tests for the Status Sheet table.
*
- * The timeline tbody contains both title rows (.title-row) and regular
+ * The Status Sheet item tbody contains both title rows (.title-row) and regular
* item rows (.auto-save-row). Each row carries data-id; cells have
* data-label="..." so we can locate by column without relying on
* positional indexing that breaks when the schema shifts.
*
- * Add a test here every time the timeline table is fixed or extended.
+ * Add a test here every time the Status Sheet table is fixed or extended.
*/
-class ServiceTimelineTableEdgeCasesTest extends BrowserTestBase {
+class StatusSheetTableEdgeCasesTest extends BrowserTestBase {
@Autowired
UserRepository users;
@Autowired
- ServiceTimelineRepository timelines;
+ StatusSheetItemRepository statusSheetItems;
private List attachConsoleErrorListener() {
List errors = new ArrayList<>();
@@ -43,24 +43,24 @@ private void assertNoConsoleErrors(List errors) {
if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
}
- /** Build + save a regular (non-title) timeline row. */
- private ServiceTimeline saveItem(User user, int order, String item, String description,
+ /** Build + save a regular (non-title) statusSheetItem row. */
+ private StatusSheetItem saveItem(User user, int order, String item, String description,
String lastDone, String dueDate, String timeLeft) {
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(user);
t.setAircraft(aircraftOf(user));
t.setItem(item);
t.setIsTitle(false);
- t.setTimelineOrder(order);
+ t.setStatusSheetOrder(order);
t.setDescription(description);
setLastDone(t, lastDone);
setDueDate(t, dueDate);
t.setTimeLeft(timeLeft);
- return timelines.save(t);
+ return statusSheetItems.save(t);
}
@Test
- void emptyTimelineRendersTableWithNoRows() {
+ void emptyStatusSheetRendersTableWithNoRows() {
String username = seedUser("password");
List errors = attachConsoleErrorListener();
@@ -80,13 +80,13 @@ void titleRowRendersWithItemTextInTitleCell() {
String username = seedUser("password");
User u = users.findByUsername(username);
- ServiceTimeline title = new ServiceTimeline();
+ StatusSheetItem title = new StatusSheetItem();
title.setUser(u);
title.setAircraft(aircraftOf(u));
title.setItem("100-Hour Inspections");
title.setIsTitle(true);
- title.setTimelineOrder(1);
- timelines.save(title);
+ title.setStatusSheetOrder(1);
+ statusSheetItems.save(title);
List errors = attachConsoleErrorListener();
loginAs(username, "password");
@@ -106,7 +106,7 @@ void titleRowRendersWithItemTextInTitleCell() {
void regularRowRendersItemAndDescriptionAndDateFields() {
String username = seedUser("password");
User u = users.findByUsername(username);
- ServiceTimeline t = saveItem(u, 1, "Oil change", "Inspect",
+ StatusSheetItem t = saveItem(u, 1, "Oil change", "Inspect",
"2025-10-01", "2025-12-01", "61 days");
List errors = attachConsoleErrorListener();
@@ -154,7 +154,7 @@ void regularRowRendersItemAndDescriptionAndDateFields() {
void emptyDescriptionRendersWithoutFallingBackToHtmlDefault() {
String username = seedUser("password");
User u = users.findByUsername(username);
- ServiceTimeline t = saveItem(u, 1, "Item with no description", "",
+ StatusSheetItem t = saveItem(u, 1, "Item with no description", "",
"2025-10-01", "2025-12-01", "");
List errors = attachConsoleErrorListener();
@@ -180,7 +180,7 @@ void veryLongItemTextRendersWithoutBreakingLayout() {
// If the column is ever widened, bump this; if it shrinks, this test
// will fail loudly which is the correct behaviour.
String longText = "X".repeat(240);
- ServiceTimeline t = saveItem(u, 1, longText, "Inspect",
+ StatusSheetItem t = saveItem(u, 1, longText, "Inspect",
"2025-10-01", "2025-12-01", "61 days");
List errors = attachConsoleErrorListener();
@@ -199,7 +199,7 @@ void specialCharsInItemAndDescriptionAreEscapedNotInterpreted() {
User u = users.findByUsername(username);
// If Thymeleaf forgets to escape, this string injects markup.
String injection = " & \"quote\" 'apos'";
- ServiceTimeline t = saveItem(u, 1, injection, injection,
+ StatusSheetItem t = saveItem(u, 1, injection, injection,
"2025-10-01", "2025-12-01", "61 days");
List errors = attachConsoleErrorListener();
@@ -222,7 +222,7 @@ void specialCharsInItemAndDescriptionAreEscapedNotInterpreted() {
}
@Test
- void multipleRowsRenderInTimelineOrder() {
+ void multipleRowsRenderInStatusSheetOrder() {
String username = seedUser("password");
User u = users.findByUsername(username);
// Insert out of order to make sure the sort actually fires.
@@ -236,7 +236,7 @@ void multipleRowsRenderInTimelineOrder() {
var itemTextareas = page.locator("tr.auto-save-row textarea[name='item']");
assertThat(itemTextareas).hasCount(3);
- // findByUserOrderByTimelineOrderAsc → First, Second, Third.
+ // findByUserOrderByStatusSheetOrderAsc → First, Second, Third.
assertThat(itemTextareas.nth(0)).hasValue("First");
assertThat(itemTextareas.nth(1)).hasValue("Second");
assertThat(itemTextareas.nth(2)).hasValue("Third");
diff --git a/src/browserTest/java/com/example/AviaryService/browser/TimeLeftPillsTest.java b/src/browserTest/java/com/example/AviaryService/browser/TimeLeftPillsTest.java
new file mode 100644
index 0000000..c1e60f2
--- /dev/null
+++ b/src/browserTest/java/com/example/AviaryService/browser/TimeLeftPillsTest.java
@@ -0,0 +1,159 @@
+package com.example.AviaryService.browser;
+
+import com.example.AviaryService.entity.Aircraft;
+import com.example.AviaryService.entity.StatusSheetItem;
+import com.example.AviaryService.entity.User;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
+import com.microsoft.playwright.Locator;
+import com.microsoft.playwright.Page;
+import com.microsoft.playwright.options.LoadState;
+import com.microsoft.playwright.options.Media;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Spec 011: Time Left as colored pills, no icons; "overdue" after an overdue
+ * pill, once if both are; N/A when nothing is set; plain words in print.
+ */
+class TimeLeftPillsTest extends BrowserTestBase {
+
+ @Autowired
+ StatusSheetItemRepository statusSheetItems;
+
+ private User user;
+ private int order;
+
+ private StatusSheetItem row(String name, String dueDate, String dueHours) {
+ StatusSheetItem t = new StatusSheetItem();
+ t.setUser(user);
+ t.setAircraft(aircraftOf(user));
+ t.setItem(name);
+ t.setIsTitle(false);
+ t.setStatusSheetOrder(order++);
+ t.setDueDateDate(dueDate);
+ t.setDueDateHours(dueHours);
+ return statusSheetItems.save(t);
+ }
+
+ private Locator cellOf(StatusSheetItem i) {
+ return page.locator("tr.auto-save-row[data-id='" + i.getId() + "'] .time-left");
+ }
+
+ private List classesOfPills(Locator cell) {
+ List out = new ArrayList<>();
+ for (Locator p : cell.locator(".tl-pill").all()) {
+ String c = p.getAttribute("class");
+ out.add(c.contains("tl-over") ? "over" : c.contains("tl-soon") ? "soon" : "ok");
+ }
+ return out;
+ }
+
+ private List openWith(int width) {
+ String username = seedUser("password");
+ user = userRepository.findByUsername(username);
+ Aircraft a = aircraftOf(user);
+ a.setTimeInServiceHours(1000.0);
+ aircraftRepository.save(a);
+ List errors = new ArrayList<>();
+ page.onConsoleMessage(m -> { if ("error".equals(m.type())) errors.add(m.text()); });
+ page.setViewportSize(width, 900);
+ return errors;
+ }
+
+ private void login() {
+ loginAs(user.getUsername(), "password");
+ page.waitForLoadState(LoadState.NETWORKIDLE);
+ }
+
+ @Test
+ void everyCaseRendersAsAgreed() {
+ List errors = openWith(1400);
+ LocalDate today = LocalDate.now();
+ StatusSheetItem bothFine = row("both fine", today.plusDays(45).toString(), "1035.5");
+ StatusSheetItem hoursOver = row("hours over", today.plusDays(45).toString(), "520");
+ StatusSheetItem dateOver = row("date over", today.minusDays(12).toString(), "1035.5");
+ StatusSheetItem bothOver = row("both over", today.minusDays(12).toString(), "520");
+ StatusSheetItem dateOnly = row("date only", today.plusDays(45).toString(), null);
+ StatusSheetItem hoursOnly = row("hours only", null, "520");
+ StatusSheetItem soon = row("soon", today.plusDays(5).toString(), "1004");
+ StatusSheetItem nothing = row("nothing", null, null);
+ login();
+
+ Locator c = cellOf(bothFine);
+ assertThat(c.locator(".tl-pill")).hasText(new String[] {"45 d", "35.5 h"});
+ assertEquals(List.of("ok", "ok"), classesOfPills(c));
+ assertThat(c.locator(".tl-overdue")).hasCount(0);
+
+ c = cellOf(hoursOver);
+ assertThat(c.locator(".tl-pill")).hasText(new String[] {"45 d", "480 h"});
+ assertEquals(List.of("ok", "over"), classesOfPills(c));
+ assertThat(c.locator(".tl-overdue")).hasCount(1);
+ assertThat(c.locator(".tl-pills")).hasText("45 d480 hoverdue"); // word right after the hours pill
+
+ c = cellOf(dateOver);
+ assertEquals(List.of("over", "ok"), classesOfPills(c));
+ assertThat(c.locator(".tl-pills")).hasText("12 doverdue35.5 h"); // word right after the date pill
+
+ c = cellOf(bothOver);
+ assertEquals(List.of("over", "over"), classesOfPills(c));
+ assertThat(c.locator(".tl-overdue")).hasCount(1); // once, after both
+ assertThat(c.locator(".tl-pills")).hasText("12 d480 hoverdue");
+
+ c = cellOf(dateOnly);
+ assertThat(c.locator(".tl-pill")).hasText(new String[] {"45 d"});
+
+ c = cellOf(hoursOnly);
+ assertThat(c.locator(".tl-pill")).hasText(new String[] {"480 h"});
+ assertThat(c.locator(".tl-overdue")).hasCount(1);
+
+ assertEquals(List.of("soon", "soon"), classesOfPills(cellOf(soon)));
+
+ assertThat(cellOf(nothing)).hasText("N/A");
+ assertThat(cellOf(nothing).locator(".tl-pill")).hasCount(0);
+
+ page.locator("#sortable-info-table").screenshot(new Locator.ScreenshotOptions()
+ .setPath(java.nio.file.Paths.get("build/screenshots/time-left-pills.png")));
+
+ // No icons anywhere in Time Left.
+ assertEquals(0, page.locator(".time-left i, .time-left svg").count());
+
+ // Print: plain words, no pills.
+ page.emulateMedia(new Page.EmulateMediaOptions().setMedia(Media.PRINT));
+ assertThat(cellOf(hoursOver).locator(".tl-pills")).isHidden();
+ assertThat(cellOf(hoursOver).locator(".tl-plain")).isVisible();
+ assertThat(cellOf(hoursOver).locator(".tl-plain")).hasText("45 days left · 480 hrs overdue");
+ assertThat(cellOf(bothOver).locator(".tl-plain")).hasText("12 days overdue · 480 hrs overdue");
+ page.emulateMedia(new Page.EmulateMediaOptions().setMedia(Media.SCREEN));
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+
+ @Test
+ void pillsFitAPhoneAndUpdateLive() {
+ List errors = openWith(360);
+ LocalDate today = LocalDate.now();
+ StatusSheetItem r = row("phone", today.plusDays(400).toString(), "520");
+ login();
+
+ Locator c = cellOf(r);
+ assertThat(c.locator(".tl-pill")).hasCount(2);
+ Object overflow = c.evaluate("el => el.scrollWidth > el.clientWidth + 1");
+ assertEquals(false, overflow, "pills must not overflow the cell at 360px");
+ Object pageOverflow = page.evaluate("() => document.documentElement.scrollWidth > document.documentElement.clientWidth");
+ assertEquals(false, pageOverflow, "no sideways scroll at 360px");
+
+ // Live: change the Due Date hours; the pill updates without reload.
+ Locator dueHours = page.locator("tr.auto-save-row[data-id='" + r.getId() + "'] td:nth-child(6) input.extra-input[type='text']");
+ dueHours.fill("1100");
+ assertThat(c.locator(".tl-pill").nth(1)).hasText("100 h");
+ assertTrue(c.locator(".tl-pill").nth(1).getAttribute("class").contains("tl-ok"));
+ if (!errors.isEmpty()) throw new AssertionError("Console errors: " + errors);
+ }
+}
diff --git a/src/browserTest/java/com/example/AviaryService/browser/TitleDragTest.java b/src/browserTest/java/com/example/AviaryService/browser/TitleDragTest.java
index 368eea1..a6c7c17 100644
--- a/src/browserTest/java/com/example/AviaryService/browser/TitleDragTest.java
+++ b/src/browserTest/java/com/example/AviaryService/browser/TitleDragTest.java
@@ -9,9 +9,9 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Mouse;
import com.microsoft.playwright.options.BoundingBox;
@@ -25,7 +25,7 @@
class TitleDragTest extends BrowserTestBase {
@Autowired
- ServiceTimelineRepository timelines;
+ StatusSheetItemRepository statusSheetItems;
private User seed() {
String username = seedUser("password");
@@ -37,13 +37,13 @@ private User seed() {
}
private void save(User u, String item, boolean isTitle, int order) {
- ServiceTimeline t = new ServiceTimeline();
+ StatusSheetItem t = new StatusSheetItem();
t.setUser(u);
t.setAircraft(aircraftOf(u));
t.setItem(item);
t.setIsTitle(isTitle);
- t.setTimelineOrder(order);
- timelines.save(t);
+ t.setStatusSheetOrder(order);
+ statusSheetItems.save(t);
}
private List domOrder() {
@@ -75,7 +75,7 @@ private void dragSectionBAboveSectionA() {
private void assertSectionBFirstAndSaved(User u) {
assertEquals("Section B", domOrder().get(0), "Section B should be first after the drag, order was " + domOrder());
- List saved = timelines.findByUserOrderByTimelineOrderAsc(u);
+ List saved = statusSheetItems.findByUserOrderByStatusSheetOrderAsc(u);
assertEquals("Section B", saved.get(0).getItem(), "New order should be saved to the server");
}
@@ -91,7 +91,7 @@ void titleCanBeDraggedOnDesktop() {
}
// Clicking a title shows only that section; the back bar must appear right
- // above the timeline (it used to land above the aircraft-info table).
+ // above the Status Sheet (it used to land above the aircraft-info table).
@Test
void clickingTitleFiltersAndBackButtonRestoresFullList() {
User u = seed();
@@ -105,7 +105,7 @@ void clickingTitleFiltersAndBackButtonRestoresFullList() {
assertTrue(bar.innerText().contains("Section B"), "Bar should name the section");
assertTrue((Boolean) page.evaluate(
"() => document.querySelector('.section-filter-bar').nextElementSibling.id === 'sortable-info-table'"),
- "Back bar should sit directly above the Service Timeline table");
+ "Back bar should sit directly above the Status Sheet table");
assertTrue(!page.locator("tr.title-row").nth(0).isVisible(), "Other sections should be hidden");
page.locator(".back-to-full-list-button").click();
diff --git a/src/browserTest/java/com/example/AviaryService/browser/TitleRowHoverTest.java b/src/browserTest/java/com/example/AviaryService/browser/TitleRowHoverTest.java
new file mode 100644
index 0000000..056ddfa
--- /dev/null
+++ b/src/browserTest/java/com/example/AviaryService/browser/TitleRowHoverTest.java
@@ -0,0 +1,73 @@
+package com.example.AviaryService.browser;
+
+import com.example.AviaryService.entity.StatusSheetItem;
+import com.example.AviaryService.entity.User;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
+import com.microsoft.playwright.Locator;
+import com.microsoft.playwright.options.LoadState;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/**
+ * Spec 009: hovering any part of a title row darkens the whole bar (grip,
+ * title, empty cell and trash can) together, and only that row.
+ */
+class TitleRowHoverTest extends BrowserTestBase {
+
+ @Autowired
+ StatusSheetItemRepository statusSheetItems;
+
+ private StatusSheetItem save(User user, String text, boolean title, int order) {
+ StatusSheetItem t = new StatusSheetItem();
+ t.setUser(user);
+ t.setAircraft(aircraftOf(user));
+ t.setItem(text);
+ t.setIsTitle(title);
+ t.setStatusSheetOrder(order);
+ return statusSheetItems.save(t);
+ }
+
+ @SuppressWarnings("unchecked")
+ private List cellColors(Locator row) {
+ return (List) row.evaluate("r => [...r.querySelectorAll('td')]"
+ + ".filter(td => getComputedStyle(td).display !== 'none')"
+ + ".map(td => getComputedStyle(td).backgroundColor)");
+ }
+
+ @Test
+ void wholeTitleRowDarkensTogetherAndOnlyThatRow() {
+ String username = seedUser("password");
+ User user = userRepository.findByUsername(username);
+ StatusSheetItem engine = save(user, "Engine", true, 0);
+ save(user, "Oil change", false, 1);
+ StatusSheetItem airframe = save(user, "Airframe", true, 2);
+
+ page.setViewportSize(1400, 900);
+ loginAs(username, "password");
+ page.waitForLoadState(LoadState.NETWORKIDLE);
+
+ Locator row = page.locator("tr.title-row[data-id='" + engine.getId() + "']");
+ Locator other = page.locator("tr.title-row[data-id='" + airframe.getId() + "']");
+ page.mouse().move(0, 0);
+ List normal = cellColors(row);
+ assertEquals(1, normal.stream().distinct().count(), "title bar is one color at rest: " + normal);
+
+ for (String part : new String[] {".title-cell", ".grip-cell", ".delete-cell"}) {
+ row.locator(part).hover();
+ page.waitForTimeout(100);
+ List hovered = cellColors(row);
+ assertEquals(1, hovered.stream().distinct().count(), "hovering " + part + ": " + hovered);
+ assertNotEquals(normal.get(0), hovered.get(0), "hovering " + part + " darkens the bar");
+ assertEquals(normal, cellColors(other), "the other title row stays normal");
+ }
+
+ page.mouse().move(0, 0);
+ page.waitForTimeout(100);
+ assertEquals(normal, cellColors(row), "back to normal after the mouse leaves");
+ }
+}
diff --git a/src/main/java/com/example/AviaryService/config/AircraftBackfill.java b/src/main/java/com/example/AviaryService/config/AircraftBackfill.java
index 9f3de5d..cd9b1c1 100644
--- a/src/main/java/com/example/AviaryService/config/AircraftBackfill.java
+++ b/src/main/java/com/example/AviaryService/config/AircraftBackfill.java
@@ -32,7 +32,7 @@
// aircraft's subscription.
// 2. For each user with no aircraft: creates one from the legacy users
// columns (info card, both hours, both baselines, updated-at/source),
-// then attaches that user's timeline rows, flights, suggestions,
+// then attaches that user's Status Sheet item rows, flights, suggestions,
// subscription and import proposals, and sets last_viewed_aircraft_id.
//
// Idempotent: users who already have an aircraft are skipped and only NULL
diff --git a/src/main/java/com/example/AviaryService/config/DataSeeder.java b/src/main/java/com/example/AviaryService/config/DataSeeder.java
index 6c7b21a..7e76508 100644
--- a/src/main/java/com/example/AviaryService/config/DataSeeder.java
+++ b/src/main/java/com/example/AviaryService/config/DataSeeder.java
@@ -5,10 +5,10 @@
import org.springframework.stereotype.Component;
import com.example.AviaryService.entity.Aircraft;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
import com.example.AviaryService.repositories.AircraftRepository;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.example.AviaryService.repositories.UserRepository;
import java.util.List;
@@ -17,14 +17,14 @@
public class DataSeeder implements CommandLineRunner {
private final UserRepository userRepository;
- private final ServiceTimelineRepository serviceTimelineRepository;
+ private final StatusSheetItemRepository statusSheetItemRepository;
private final PasswordEncoder passwordEncoder;
private final AircraftRepository aircraftRepository;
- public DataSeeder(UserRepository userRepository, ServiceTimelineRepository serviceTimelineRepository,
+ public DataSeeder(UserRepository userRepository, StatusSheetItemRepository statusSheetItemRepository,
PasswordEncoder passwordEncoder, AircraftRepository aircraftRepository) {
this.userRepository = userRepository;
- this.serviceTimelineRepository = serviceTimelineRepository;
+ this.statusSheetItemRepository = statusSheetItemRepository;
this.passwordEncoder = passwordEncoder;
this.aircraftRepository = aircraftRepository;
}
@@ -45,47 +45,47 @@ public void run(String... args) throws Exception {
userRepository.save(Daniel);
userRepository.save(Tomas);
- // One aircraft each, which every timeline row below belongs to.
+ // One aircraft each, which every Status Sheet item row below belongs to.
Aircraft danielPlane = firstAircraft(Daniel, 3000, 2500);
Aircraft tomasPlane = firstAircraft(Tomas, 3000, 2500);
// Tomas — aircraft at ~2480 total hours, ~25 hr/month
// constructor: (item, isTitle, description, cycleCalendarUnit, cycleCalendarValue, cycleHours, lastDoneDate, lastDoneHours, dueDateDate, dueDateHours, timeLeft, user)
- ServiceTimeline t1 = new ServiceTimeline("Annual Inspection", false, "Inspect aircraft systems per FAR 91.409", "MONTHS", 12, null, "2026-01-15", "2380", "2027-01-15", "2680", "7 months", Tomas);
- ServiceTimeline t2 = new ServiceTimeline("100-Hour Inspection", false, "Inspect per FAR 91.409(b)", null, null, 100.0, "2026-04-10", "2400", "2026-08-15", "2500", "20 hours", Tomas);
- ServiceTimeline t3 = new ServiceTimeline("Oil Change", false, "Replace engine oil and filter", null, null, 50.0, "2026-05-20", "2455", "2026-07-10", "2505", "25 hours", Tomas);
- ServiceTimeline t4 = new ServiceTimeline("Spark Plug Inspection", false, "Clean, gap, and rotate spark plugs", null, null, 100.0, "2026-04-10", "2400", "2026-08-15", "2500", "20 hours", Tomas);
- ServiceTimeline t5 = new ServiceTimeline("ELT Battery Replacement", false, "Replace ELT battery per TSO-C91a", "MONTHS", 24, null, "2024-06-10", "2100", "2026-06-10", "2490", "Overdue", Tomas);
- ServiceTimeline t6 = new ServiceTimeline("Transponder Test", false, "Test per FAR 91.413", "MONTHS", 24, null, "2025-03-10", "2250", "2027-03-10", "2850", "9 months", Tomas);
- ServiceTimeline t7 = new ServiceTimeline("Magneto Inspection", false, "Inspect and time magnetos", null, null, 500.0, "2025-01-15", "2000", "2027-01-01", "2500", "20 hours", Tomas);
- ServiceTimeline t8 = new ServiceTimeline("Pitot-Static System Test", false, "Test per FAR 91.411", "MONTHS", 24, null, "2025-03-10", "2250", "2027-03-10", "2850", "9 months", Tomas);
-
- t1.setTimelineOrder(1); t2.setTimelineOrder(2); t3.setTimelineOrder(3); t4.setTimelineOrder(4);
- t5.setTimelineOrder(5); t6.setTimelineOrder(6); t7.setTimelineOrder(7); t8.setTimelineOrder(8);
+ StatusSheetItem t1 = new StatusSheetItem("Annual Inspection", false, "Inspect aircraft systems per FAR 91.409", "MONTHS", 12, null, "2026-01-15", "2380", "2027-01-15", "2680", "7 months", Tomas);
+ StatusSheetItem t2 = new StatusSheetItem("100-Hour Inspection", false, "Inspect per FAR 91.409(b)", null, null, 100.0, "2026-04-10", "2400", "2026-08-15", "2500", "20 hours", Tomas);
+ StatusSheetItem t3 = new StatusSheetItem("Oil Change", false, "Replace engine oil and filter", null, null, 50.0, "2026-05-20", "2455", "2026-07-10", "2505", "25 hours", Tomas);
+ StatusSheetItem t4 = new StatusSheetItem("Spark Plug Inspection", false, "Clean, gap, and rotate spark plugs", null, null, 100.0, "2026-04-10", "2400", "2026-08-15", "2500", "20 hours", Tomas);
+ StatusSheetItem t5 = new StatusSheetItem("ELT Battery Replacement", false, "Replace ELT battery per TSO-C91a", "MONTHS", 24, null, "2024-06-10", "2100", "2026-06-10", "2490", "Overdue", Tomas);
+ StatusSheetItem t6 = new StatusSheetItem("Transponder Test", false, "Test per FAR 91.413", "MONTHS", 24, null, "2025-03-10", "2250", "2027-03-10", "2850", "9 months", Tomas);
+ StatusSheetItem t7 = new StatusSheetItem("Magneto Inspection", false, "Inspect and time magnetos", null, null, 500.0, "2025-01-15", "2000", "2027-01-01", "2500", "20 hours", Tomas);
+ StatusSheetItem t8 = new StatusSheetItem("Pitot-Static System Test", false, "Test per FAR 91.411", "MONTHS", 24, null, "2025-03-10", "2250", "2027-03-10", "2850", "9 months", Tomas);
+
+ t1.setStatusSheetOrder(1); t2.setStatusSheetOrder(2); t3.setStatusSheetOrder(3); t4.setStatusSheetOrder(4);
+ t5.setStatusSheetOrder(5); t6.setStatusSheetOrder(6); t7.setStatusSheetOrder(7); t8.setStatusSheetOrder(8);
// Daniel — aircraft at ~1850 total hours, ~20 hr/month
- ServiceTimeline d1 = new ServiceTimeline("Annual Inspection", false, "Inspect aircraft systems per FAR 91.409", "MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
- ServiceTimeline d2 = new ServiceTimeline("Oil Filter Replacement", false, "Replace oil filter", null, null, 50.0, "2026-05-15", "1820", "2026-08-01", "1870", "20 hours", Daniel);
- ServiceTimeline d3 = new ServiceTimeline("Landing Gear Inspection", false, "Inspect gear, doors, and actuators", "MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
- ServiceTimeline d4 = new ServiceTimeline("VOR Check", false, "VOR accuracy check per FAR 91.171", "DAYS", 30, null, "2026-05-25", "1838", "2026-06-24", "1854", "12 days", Daniel);
- ServiceTimeline d5 = new ServiceTimeline("Brake Lining Inspection", false, "Inspect brake pads and discs", null, null, 100.0, "2026-03-10", "1770", "2026-09-15", "1870", "20 hours", Daniel);
- ServiceTimeline d6 = new ServiceTimeline("Propeller Inspection", false, "Inspect blades, hub, and spinner", "MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
- ServiceTimeline d7 = new ServiceTimeline("Fuel System Inspection", false, "Inspect tanks, lines, and fuel caps", "MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
- ServiceTimeline d8 = new ServiceTimeline("Control Cable Inspection", false, "Inspect cables for wear, routing, tension","MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
-
- d1.setTimelineOrder(1); d2.setTimelineOrder(2); d3.setTimelineOrder(3); d4.setTimelineOrder(4);
- d5.setTimelineOrder(5); d6.setTimelineOrder(6); d7.setTimelineOrder(7); d8.setTimelineOrder(8);
-
- for (ServiceTimeline t : List.of(t1, t2, t3, t4, t5, t6, t7, t8)) t.setAircraft(tomasPlane);
- for (ServiceTimeline d : List.of(d1, d2, d3, d4, d5, d6, d7, d8)) d.setAircraft(danielPlane);
-
- serviceTimelineRepository.saveAll(List.of(t1, t2, t3, t4, t5, t6, t7, t8, d1, d2, d3, d4, d5, d6, d7, d8));
+ StatusSheetItem d1 = new StatusSheetItem("Annual Inspection", false, "Inspect aircraft systems per FAR 91.409", "MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
+ StatusSheetItem d2 = new StatusSheetItem("Oil Filter Replacement", false, "Replace oil filter", null, null, 50.0, "2026-05-15", "1820", "2026-08-01", "1870", "20 hours", Daniel);
+ StatusSheetItem d3 = new StatusSheetItem("Landing Gear Inspection", false, "Inspect gear, doors, and actuators", "MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
+ StatusSheetItem d4 = new StatusSheetItem("VOR Check", false, "VOR accuracy check per FAR 91.171", "DAYS", 30, null, "2026-05-25", "1838", "2026-06-24", "1854", "12 days", Daniel);
+ StatusSheetItem d5 = new StatusSheetItem("Brake Lining Inspection", false, "Inspect brake pads and discs", null, null, 100.0, "2026-03-10", "1770", "2026-09-15", "1870", "20 hours", Daniel);
+ StatusSheetItem d6 = new StatusSheetItem("Propeller Inspection", false, "Inspect blades, hub, and spinner", "MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
+ StatusSheetItem d7 = new StatusSheetItem("Fuel System Inspection", false, "Inspect tanks, lines, and fuel caps", "MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
+ StatusSheetItem d8 = new StatusSheetItem("Control Cable Inspection", false, "Inspect cables for wear, routing, tension","MONTHS", 12, null, "2026-02-01", "1780", "2027-02-01", "2020", "8 months", Daniel);
+
+ d1.setStatusSheetOrder(1); d2.setStatusSheetOrder(2); d3.setStatusSheetOrder(3); d4.setStatusSheetOrder(4);
+ d5.setStatusSheetOrder(5); d6.setStatusSheetOrder(6); d7.setStatusSheetOrder(7); d8.setStatusSheetOrder(8);
+
+ for (StatusSheetItem t : List.of(t1, t2, t3, t4, t5, t6, t7, t8)) t.setAircraft(tomasPlane);
+ for (StatusSheetItem d : List.of(d1, d2, d3, d4, d5, d6, d7, d8)) d.setAircraft(danielPlane);
+
+ statusSheetItemRepository.saveAll(List.of(t1, t2, t3, t4, t5, t6, t7, t8, d1, d2, d3, d4, d5, d6, d7, d8));
}
- private Aircraft firstAircraft(User user, double blockTime, double timeInService) {
+ private Aircraft firstAircraft(User user, double hobbsTime, double timeInService) {
Aircraft a = new Aircraft(user);
- a.setBlockTimeHours(blockTime);
+ a.setHobbsTimeHours(hobbsTime);
a.setTimeInServiceHours(timeInService);
a = aircraftRepository.save(a);
user.setLastViewedAircraft(a);
diff --git a/src/main/java/com/example/AviaryService/config/DemoDataSeeder.java b/src/main/java/com/example/AviaryService/config/DemoDataSeeder.java
index acca437..db7d45d 100644
--- a/src/main/java/com/example/AviaryService/config/DemoDataSeeder.java
+++ b/src/main/java/com/example/AviaryService/config/DemoDataSeeder.java
@@ -15,12 +15,12 @@
import com.example.AviaryService.entity.Aircraft;
import com.example.AviaryService.entity.FlightLog;
import com.example.AviaryService.entity.FlightSuggestion;
-import com.example.AviaryService.entity.ServiceTimeline;
+import com.example.AviaryService.entity.StatusSheetItem;
import com.example.AviaryService.entity.User;
import com.example.AviaryService.repositories.AircraftRepository;
import com.example.AviaryService.repositories.FlightLogRepository;
import com.example.AviaryService.repositories.FlightSuggestionRepository;
-import com.example.AviaryService.repositories.ServiceTimelineRepository;
+import com.example.AviaryService.repositories.StatusSheetItemRepository;
import com.example.AviaryService.repositories.UserRepository;
// Local-only demo account for eyeballing the dashboard: log in as
@@ -37,17 +37,17 @@ public class DemoDataSeeder implements CommandLineRunner {
static final String PASSWORD = "Demo-pass-123";
private final UserRepository userRepository;
- private final ServiceTimelineRepository timelineRepository;
+ private final StatusSheetItemRepository statusSheetItemRepository;
private final FlightLogRepository flightLogRepository;
private final FlightSuggestionRepository suggestionRepository;
private final PasswordEncoder passwordEncoder;
private final AircraftRepository aircraftRepository;
- public DemoDataSeeder(UserRepository userRepository, ServiceTimelineRepository timelineRepository,
+ public DemoDataSeeder(UserRepository userRepository, StatusSheetItemRepository statusSheetItemRepository,
FlightLogRepository flightLogRepository, FlightSuggestionRepository suggestionRepository,
PasswordEncoder passwordEncoder, AircraftRepository aircraftRepository) {
this.userRepository = userRepository;
- this.timelineRepository = timelineRepository;
+ this.statusSheetItemRepository = statusSheetItemRepository;
this.flightLogRepository = flightLogRepository;
this.suggestionRepository = suggestionRepository;
this.passwordEncoder = passwordEncoder;
@@ -70,7 +70,7 @@ public void run(String... args) {
demo.setLastViewedAircraft(sr22);
userRepository.save(demo);
- List rows = new ArrayList<>();
+ List rows = new ArrayList<>();
rows.add(title("Engine", demo));
rows.add(item("Oil Change", "Replace", null, null, 50.0,
today.minusMonths(1), "1383.9", null, "1433.9", demo)); // 15.2 hours left
@@ -91,10 +91,10 @@ public void run(String... args) {
rows.add(item("Pitot-Static Check", "Test", "MONTHS", 24, null,
today.minusMonths(20), null, today.plusMonths(4), null, demo)); // 4 mo
for (int i = 0; i < rows.size(); i++) {
- rows.get(i).setTimelineOrder(i);
+ rows.get(i).setStatusSheetOrder(i);
rows.get(i).setAircraft(sr22);
}
- timelineRepository.saveAll(rows);
+ statusSheetItemRepository.saveAll(rows);
// Log book: a chain of recent flights, oldest first, each picking up
// where the last left off so the meters are consistent.
@@ -103,22 +103,22 @@ public void run(String... args) {
{"KTMB", "KAPF", "1.8", "1.6"}, {"KAPF", "KTMB", "1.7", "1.5"},
{"KTMB", "KEYW", "2.1", "1.9"}, {"KEYW", "KTMB", "2.0", "1.8"},
};
- double block = 1532.4 - sum(legs, 2);
+ double hobbs = 1532.4 - sum(legs, 2);
double service = 1418.7 - sum(legs, 3);
Instant start = today.minusDays(20).atTime(14, 0).toInstant(ZoneOffset.UTC);
for (String[] leg : legs) {
- double blockLen = Double.parseDouble(leg[2]);
+ double hobbsLen = Double.parseDouble(leg[2]);
double serviceLen = Double.parseDouble(leg[3]);
- FlightLog log = new FlightLog(leg[0], leg[1], round(block + blockLen), round(block),
+ FlightLog log = new FlightLog(leg[0], leg[1], round(hobbs + hobbsLen), round(hobbs),
round(service + serviceLen), round(service), demo);
log.setSource("manual");
log.setAircraft(sr22);
- log.setBlockTimeStart(start);
- log.setBlockTimeEnd(start.plus(minutes(blockLen)));
+ log.setHobbsTimeStart(start);
+ log.setHobbsTimeEnd(start.plus(minutes(hobbsLen)));
log.setTimeInServiceStart(start.plus(Duration.ofMinutes(6)));
log.setTimeInServiceEnd(start.plus(Duration.ofMinutes(6)).plus(minutes(serviceLen)));
flightLogRepository.save(log);
- block += blockLen;
+ hobbs += hobbsLen;
service += serviceLen;
start = start.plus(Duration.ofDays(3));
}
@@ -140,9 +140,9 @@ public void run(String... args) {
seedSecondAircraft(demo, pa28, today);
}
- // N731KR: a smaller timeline with one overdue item, and a few flights.
+ // N731KR: a smaller Status Sheet item with one overdue item, and a few flights.
private void seedSecondAircraft(User demo, Aircraft pa28, LocalDate today) {
- List rows = new ArrayList<>();
+ List rows = new ArrayList<>();
rows.add(item("Annual Inspection", "Inspect", "MONTHS", 12, null,
today.minusMonths(11).minusDays(20), null, today.plusDays(10), null, demo)); // due soon
rows.add(item("Oil Change", "Replace", null, null, 50.0,
@@ -154,41 +154,41 @@ private void seedSecondAircraft(User demo, Aircraft pa28, LocalDate today) {
rows.add(item("ELT Battery", "Replace", "MONTHS", 24, null,
today.minusMonths(6), null, today.plusMonths(18), null, demo));
for (int i = 0; i < rows.size(); i++) {
- rows.get(i).setTimelineOrder(i);
+ rows.get(i).setStatusSheetOrder(i);
rows.get(i).setAircraft(pa28);
}
- timelineRepository.saveAll(rows);
+ statusSheetItemRepository.saveAll(rows);
String[][] legs = { {"KFXE", "KBCT", "0.8", "0.6"}, {"KBCT", "KFXE", "0.9", "0.7"}, {"KFXE", "KVRB", "1.5", "1.3"} };
- double block = 4210.6 - sum(legs, 2);
+ double hobbs = 4210.6 - sum(legs, 2);
double service = 4105.2 - sum(legs, 3);
Instant start = today.minusDays(12).atTime(13, 0).toInstant(ZoneOffset.UTC);
for (String[] leg : legs) {
- double blockLen = Double.parseDouble(leg[2]);
+ double hobbsLen = Double.parseDouble(leg[2]);
double serviceLen = Double.parseDouble(leg[3]);
- FlightLog log = new FlightLog(leg[0], leg[1], round(block + blockLen), round(block),
+ FlightLog log = new FlightLog(leg[0], leg[1], round(hobbs + hobbsLen), round(hobbs),
round(service + serviceLen), round(service), demo);
log.setSource("manual");
log.setAircraft(pa28);
- log.setBlockTimeStart(start);
- log.setBlockTimeEnd(start.plus(minutes(blockLen)));
+ log.setHobbsTimeStart(start);
+ log.setHobbsTimeEnd(start.plus(minutes(hobbsLen)));
log.setTimeInServiceStart(start.plus(Duration.ofMinutes(5)));
log.setTimeInServiceEnd(start.plus(Duration.ofMinutes(5)).plus(minutes(serviceLen)));
flightLogRepository.save(log);
- block += blockLen;
+ hobbs += hobbsLen;
service += serviceLen;
start = start.plus(Duration.ofDays(4));
}
}
private Aircraft aircraft(User owner, String tail, String makeModel, String serial,
- double blockTime, double timeInService) {
+ double hobbsTime, double timeInService) {
Aircraft a = new Aircraft(owner);
a.setTailNumber(tail);
a.setMakeModel(makeModel);
- a.setOwnerName("Demo Pilot");
+ a.setOperatorName("Demo Pilot");
a.setMakeModelSN(serial);
- a.setBlockTimeHours(blockTime);
+ a.setHobbsTimeHours(hobbsTime);
a.setTimeInServiceHours(timeInService);
return aircraftRepository.save(a);
}
@@ -198,13 +198,13 @@ private static FlightSuggestion suggestion(Aircraft aircraft, FlightSuggestion s
return s;
}
- private static ServiceTimeline title(String name, User user) {
- return new ServiceTimeline(name, true, null, null, null, null, null, null, null, null, null, user);
+ private static StatusSheetItem title(String name, User user) {
+ return new StatusSheetItem(name, true, null, null, null, null, null, null, null, null, null, user);
}
- private static ServiceTimeline item(String name, String description, String calUnit, Integer calValue,
+ private static StatusSheetItem item(String name, String description, String calUnit, Integer calValue,
Double cycleHours, LocalDate lastDone, String lastDoneHours, LocalDate due, String dueHours, User user) {
- return new ServiceTimeline(name, false, description, calUnit, calValue, cycleHours,
+ return new StatusSheetItem(name, false, description, calUnit, calValue, cycleHours,
calUnit == null ? null : lastDone.toString(), lastDoneHours,
due == null ? null : due.toString(), dueHours, null, user);
}
diff --git a/src/main/java/com/example/AviaryService/controllers/AircraftController.java b/src/main/java/com/example/AviaryService/controllers/AircraftController.java
index 4ab5225..cd4fdba 100644
--- a/src/main/java/com/example/AviaryService/controllers/AircraftController.java
+++ b/src/main/java/com/example/AviaryService/controllers/AircraftController.java
@@ -54,7 +54,10 @@ public ResponseEntity