Rework entry types: merge hotel into stay, transport with modes, auto-transport

- Type set is now activity/stay/transport/flight/rental/note; hotel, travel
  and immigration are removed with idempotent startup data migrations
  (hotel->stay, travel->transport, immigration->activity with flag prefix)
- Transport entries carry an optional mode (train/bus/ferry/taxi/drive/other)
  that drives the chip/map icon; route stops expose transport_mode
- Creating a stay auto-creates a bridging transport to its neighbouring
  stays unless a transport/flight already covers the gap (one-shot)
- Summary: transports count replaces hotels/travelLegs
This commit is contained in:
2026-07-19 17:47:21 +07:00
parent b066e7b885
commit d393e16ae1
17 changed files with 469 additions and 62 deletions
+2 -2
View File
@@ -148,7 +148,7 @@ test('route: mixed ground transfers + air segments split kmAir / kmDriven', asyn
// Hotel near CNX (ground), then the CNX-BKK-DXB flight, then a hotel near DXB.
await agent.post(`/api/trips/${trip.id}/entries`).send({
date: '2026-08-01', type: 'hotel', title: 'CNX Hotel', sort_order: 0,
date: '2026-08-01', type: 'stay', title: 'CNX Hotel', sort_order: 0,
location_name: 'Chiang Mai', lat: 18.79, lng: 98.99,
});
await agent.post(`/api/trips/${trip.id}/entries`).send({
@@ -159,7 +159,7 @@ test('route: mixed ground transfers + air segments split kmAir / kmDriven', asyn
],
});
await agent.post(`/api/trips/${trip.id}/entries`).send({
date: '2026-08-02', type: 'hotel', title: 'DXB Hotel', sort_order: 2,
date: '2026-08-02', type: 'stay', title: 'DXB Hotel', sort_order: 2,
location_name: 'Dubai', lat: 25.2, lng: 55.27,
});