fix(mail-ingest): announce a place a mail created with its whole row

The open planners of the trip received only the new place's id and kept a nameless place without coordinates until a reload. The broadcast now carries the row the place routes send.
This commit is contained in:
Maurice
2026-11-23 14:56:18 +01:00
parent 403b7d2f93
commit 91edf0c565
2 changed files with 59 additions and 2 deletions
@@ -43,6 +43,7 @@ const FINGERPRINT_KEYS = [
'metadata',
] as const;
type Written = Awaited<ReturnType<ReservationsService['createWithCostInTx']>>;
type CreatedPlace = Awaited<ReturnType<PlacesService['create']>>;
/** A booking ready to write: everything that needs the network (geocoding, the frozen rate) is done. */
export interface PreparedBooking {
@@ -59,7 +60,8 @@ export interface PreparedBooking {
export interface WrittenBooking {
tripId: number;
reservation: Written['reservation'];
place: { id: number } | null;
/** The place the write created, as the place routes announce it. */
place: CreatedPlace | null;
accommodationCreated: boolean;
costEvents: CostEvent[];
stayMirror: Written['stayMirror'];
@@ -137,7 +139,7 @@ export class MailIngestApplyService {
return {
tripId: prepared.tripId,
reservation: written.reservation,
place: place ? { id: place.id } : null,
place,
accommodationCreated: written.accommodationCreated,
costEvents: written.costEvents,
stayMirror: written.stayMirror,