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
+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)