fix(atlas): count shared days for every member, keep routes and multi-day tours honest (STA-02)

A day of a tour that names nobody now counts for every member of the trip,
not only for its owner. In the planner an empty participant list means
everyone, and a full member list is stored back as empty, so members got
nothing for most shared tours. Only a day that names participants without
the user stays theirs. The tours of a shared trip on no day or only on
undated days are now named as not counting for members as well.

A whole route a multi-day tour's stages were planned from is no longer
dropped on the server as soon as any stage has a day. Each entry carries
derived_from_place_id and the shared summary leaves the route out only
while one of its stages is done, counted and in the period and type. A
route walked last year now still counts when a stage of it is planned for
next month or was left out because it fell through, in the Atlas and over
MCP alike.

A tour on several days is dated on the last of them, as is a recording on
no day, so it no longer counts while it is still under way.

The info text, the get_tour_activity_stats description and the wiki say so.
This commit is contained in:
Maurice
2026-10-20 13:51:46 +02:00
parent bde2ad2ca8
commit acc294dd8e
47 changed files with 233 additions and 123 deletions
@@ -28,6 +28,7 @@ function entry(overrides: Partial<TourActivityStatsEntry> = {}): TourActivitySta
name: 'Ridge',
tour_type: 'hike',
trip: { id: 5, title: 'Alps' },
derived_from_place_id: null,
date: '2026-07-02',
basis: 'plan',
track: null,
@@ -26,6 +26,7 @@ function entry(overrides: Partial<TourActivityStatsEntry> = {}): TourActivitySta
name: 'Ridge',
tour_type: 'hike',
trip: { id: 5, title: 'Alps' },
derived_from_place_id: null,
date: '2026-07-02',
basis: 'plan',
track: null,
@@ -20,6 +20,7 @@ function entry(overrides: Partial<TourActivityStatsEntry> = {}): TourActivitySta
name: 'Ridge',
tour_type: 'hike',
trip: { id: 5, title: 'Alps' },
derived_from_place_id: null,
date: '2026-07-02',
basis: 'plan',
track: null,
@@ -21,6 +21,7 @@ function entry(overrides: Partial<TourActivityStatsEntry> = {}): TourActivitySta
name: 'Ridge',
tour_type: 'hike',
trip: { id: 5, title: 'Alps' },
derived_from_place_id: null,
date: '2026-07-02',
basis: 'plan',
track: null,