A mechanical prettier --write over server/src, server/tests, server/scripts
and shared/src with the workspaces' .prettierrc; nothing but layout and
import order changes, and every file keeps the same set of imports. shared
is formatted throughout and its format baseline is empty. The server
baseline keeps the 35 files that Prettier would grow past their lint:size
limit (they need a split first, which is not a formatting change), and the
generated entity files stay as their generator writes them.
That branch numbered its own steps after the upstream step it was cut
from, so a database at schema_version 243 to 246 (or 216 to 218) with the
Tours tables had four upstream migrations marked as run without ever
running them. The baseline now cuts such a version back to the last
upstream step, and the Tours migration adds the difficulty cap to a tours
table an earlier branch stage created without it.
dev now runs on MikroORM, so the positional migrations, seeds.ts and
DatabaseService the Tours server side was built on are gone. Behaviour
is unchanged; persistence moves onto dev's architecture:
- one MikroORM migration for tour_types, tours and tour_waypoints,
idempotent so instances that ran the old positional steps keep
their data; the hike tour type is seeded inside it, the addon row
in the AddonSeeder
- entities and repositories for the three tables, tours domain on
repositories and UnitOfWork
- tour facet joins in places, assignments and days re-applied on the
repository code
Fixes found while porting:
- GPX import checks addon, trip access and permission in the handler
instead of guards, so a refused upload gets a 403/404 instead of a
connection reset
- copying a trip copies its tours and waypoints
- a tour cannot be moved onto a day that already has it
- updateTour checks existence inside its transaction
Adds tours e2e tests and rewrites the tours unit tests onto the
migrated test database.