Skip to content

Server route data cleanup#148

Merged
ckulfan merged 5 commits intomainfrom
server-route-data-cleanup
Mar 30, 2026
Merged

Server route data cleanup#148
ckulfan merged 5 commits intomainfrom
server-route-data-cleanup

Conversation

@mattrix14
Copy link
Copy Markdown
Collaborator

Summary

This PR cleans up the FTServer route-data contract so the emitted JSON, schema, example payloads, and generated docs are aligned and easier to reason about.

What Changed

  • Reordered boatData fields into a more coherent, stable order.
  • Reordered portData fields into a more coherent, stable order.
  • Removed the legacy BoatDepartureDelay alias and standardized on DepartureDelay.
  • Updated the JSON Schema to match the actual runtime payload more closely.
  • Updated example route payloads to match the current contract and ordering.
  • Regenerated schema docs from the updated schema.
  • Removed stale generated doc entries for deprecated fields.
  • Added/updated schema coverage for current runtime fields including:
    • MMSI
    • PositionUpdated
    • TerminalID
    • PortETA
    • PortStopTimer
    • PortArrivalTimeMinus

Why

The route payload had drifted over time:

  • field ordering was inconsistent and harder to scan
  • the schema no longer fully matched the live runtime payload
  • generated docs were stale
  • both BoatDepartureDelay and DepartureDelay existed for the same concept

This PR makes the contract cleaner and more consistent without changing the meaning of the data, aside from the intentional removal of the old BoatDepartureDelay alias.

Notes

  • boatData is not just reordered: BoatDepartureDelay is removed in favor of DepartureDelay.
  • portData keeps the same runtime fields, but they are now emitted in a more coherent order.
  • The schema and docs now reflect the current FTServer payload rather than older historical variants.

Testing

  • Verified the schema JSON parses successfully.
  • Regenerated docs with npm run docs.
  • Ran targeted tests:
npm test -- --runTestsByPath test/FerryTempo.test.js test/Utils.test.js

emit DepartureDelay alongside legacy BoatDepartureDelay
ignore the new alias in boat comparison logic
update example route data and test fixtures
reorder portData to list portWN before portES
replace accidental shallow-copy persistence with explicit per-port departure-delay caching

keep PortDepartureDelay live while a boat is docked and late

freeze the value after departure until the next boat at that port takes over

add a regression test for opposite-port persistence on ed-king-style traffic
update better-sqlite3 to a Node 24 compatible release

refresh lockfile

verify the targeted FerryTempo regression test still passes
replace fixed -8 sun-time formatting with America/Los_Angeles

update getTimeFromEpochSeconds to support IANA timezones while preserving numeric-offset callers

add regression coverage for Pacific daylight saving time
Also rename BoatDepartureDelay to DepartureDelay for consistency.
Comment thread schemas/FerryTempo.schema.json
Comment thread data/ExampleRouteData.json
@mattrix14
Copy link
Copy Markdown
Collaborator Author

mattrix14 commented Mar 25, 2026 via email

@ckulfan ckulfan merged commit 2c4d292 into main Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants