fix(ci): list the packing share pair, and read a stored costs mode through its enum

The whole-list sharing runs on usePackingCategorySharing in the packing panel
and the phone tab, its sheet is markup fed by the tab. The trips service reads
a stored costs_mode as one of TripsCostsMode, which the export check wants used.
This commit is contained in:
Maurice
2026-11-13 13:30:37 +01:00
parent d6799d1205
commit c2c0535d52
2 changed files with 11 additions and 4 deletions
+7
View File
@@ -578,6 +578,12 @@
"desktop": ["src/components/Packing/usePackingListPanel.ts"],
"mobile": ["src/mobile/screens/trip/tabs/MPackingListTab.tsx"]
},
{
"feature": "Packing list: sharing of a whole list",
"hooks": ["src/components/Packing/usePackingCategorySharing.ts"],
"desktop": ["src/components/Packing/usePackingListPanel.ts"],
"mobile": ["src/mobile/screens/trip/tabs/MPackingListTab.tsx"]
},
{
"feature": "Packing list: usePackingImport",
"hooks": ["src/components/Packing/usePackingImport.ts"],
@@ -1087,6 +1093,7 @@
"src/mobile/screens/trip/tabs/MCollabTab.tsx": "Phone collab sub tab router that reuses the desktop CollabLinks component.",
"src/mobile/screens/trip/tabs/MFilesBoard.tsx": "Markup only; the trip's files as tiles and the picked file's preview on a wide window, with the files and their actions handed in through props from MFilesTab.",
"src/mobile/screens/trip/tabs/MListsTab.tsx": "Phone router between the packing and to-do bodies, with no logic of its own.",
"src/mobile/screens/trip/tabs/MPackingCategorySharingSheet.tsx": "Markup only; the sheet that shares a whole list, with its state from usePackingCategorySharing handed in through props by MPackingListTab.",
"src/mobile/screens/trip/tabs/MReceiptScanButton.tsx": "Already shares useReceiptScan and ReceiptScanModal with the desktop CostsPanel.",
"src/mobile/screens/trip/tabs/MReservationCardParts.tsx": "Markup only: the title, actions, date, files and delete sheet parts both phone booking tabs draw.",
"src/mobile/screens/trip/tabs/MTodoSidebar.tsx": "Markup only; the to-do filters as a pane beside the tasks on a wide window, with the filter state and the counts handed in through props from useTodoView.",
+4 -4
View File
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { EntityManager } from '@mikro-orm/core';
import { Trips } from '../../db/entities/Trips.entity';
import { Trips, TripsCostsMode } from '../../db/entities/Trips.entity';
import { Days } from '../../db/entities/Days.entity';
import { JourneyEntries } from '../../db/entities/JourneyEntries.entity';
import { Users } from '../../db/entities/Users.entity';
@@ -34,7 +34,6 @@ import {
type DayGridRemoval,
type TrekWsPayload,
type TrekWsTripEventName,
type TripCostsMode,
type TripUpdateRequest,
} from '@trek/shared';
import { RealtimeService } from '../realtime/realtime.service';
@@ -474,8 +473,9 @@ export class TripsService {
const newCurrency = currency || trip.currency;
const newArchived = is_archived !== undefined ? (is_archived ? 1 : 0) : trip.is_archived;
const newCover = cover_image !== undefined ? cover_image : trip.cover_image;
// The column's CHECK holds a stored trip to the two modes.
const newCostsMode = costs_mode ?? (trip.costs_mode as TripCostsMode);
// A stored trip is read as one of the two modes the column allows.
const storedCostsMode = trip.costs_mode === TripsCostsMode.TOTALS ? TripsCostsMode.TOTALS : TripsCostsMode.SPLIT;
const newCostsMode = costs_mode ?? storedCostsMode;
const oldReminder = (trip as any).reminder_days ?? 3;
const newReminder = reminder_days !== undefined
? (Number(reminder_days) >= 0 && Number(reminder_days) <= 30 ? Number(reminder_days) : oldReminder)