Trek_CN/server/tests/unit
jubnl a438652a50
fix(trips): preserve day content when trip date range changes
Rewrites generateDays to remap days positionally by day_number instead
of matching by date identity. Previously any date range shift with no
overlap would cascade-delete all day_assignments, day_notes, and
day_accommodations.

New behaviour:
- Shift/partial overlap: existing days remapped to new dates in order
- Shrink: overflow days become dateless (date=NULL) instead of deleted,
  preserving all child data for manual reassignment
- Grow: existing days kept, new empty days appended
- Clear dates: all days nullified, content intact

Also fixes a UNIQUE(trip_id, day_number) collision that would occur when
spare dateless days remained after growing into a partially-dateless trip
(maxAssigned base was wrong).

Closes #646
2026-04-15 01:28:53 +02:00
..
mcp test: add comprehensive coverage for OAuth scopes, MCP, and core services 2026-04-11 14:08:09 +02:00
middleware feat(pwa): implement real offline mode with IndexedDB sync 2026-04-14 23:04:25 +02:00
services fix(trips): preserve day content when trip date range changes 2026-04-15 01:28:53 +02:00
utils test: expand test suite to 87.3% backend coverage 2026-04-06 20:08:30 +02:00
scheduler.test.ts Add comprehensive backend test suite (#339) 2026-04-03 13:17:53 +02:00