mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 18:55:42 +00:00
refactor( iam ): migrate guest booking to IAM; make Passenger.userId nullable
This commit is contained in:
@@ -71,12 +71,12 @@ export class PassengersService {
|
||||
return {
|
||||
items: items.map(passenger => ({
|
||||
id: passenger.id,
|
||||
fullName: passenger.user.fullName,
|
||||
email: passenger.user.email,
|
||||
phone: passenger.user.phone,
|
||||
nationalId: passenger.user.nationalId,
|
||||
nationality: passenger.user.nationality,
|
||||
verified: !!passenger.user.nationalId,
|
||||
fullName: passenger.user?.fullName ?? null,
|
||||
email: passenger.user?.email ?? null,
|
||||
phone: passenger.user?.phone ?? null,
|
||||
nationalId: passenger.user?.nationalId ?? null,
|
||||
nationality: passenger.user?.nationality ?? null,
|
||||
verified: !!passenger.user?.nationalId,
|
||||
loyaltyTier: passenger.loyalty?.tier || 'BRONZE',
|
||||
loyaltyPoints: passenger.loyalty?.pointsBalance || 0,
|
||||
totalBookings: passenger._count.bookings,
|
||||
@@ -103,9 +103,9 @@ export class PassengersService {
|
||||
if (!p) throw new NotFoundException('Passenger not found');
|
||||
return {
|
||||
id: p.id,
|
||||
fullName: p.user.fullName,
|
||||
email: p.user.email,
|
||||
phone: p.user.phone,
|
||||
fullName: p.user?.fullName ?? null,
|
||||
email: p.user?.email ?? null,
|
||||
phone: p.user?.phone ?? null,
|
||||
createdAt: p.createdAt,
|
||||
bookings: p.bookings.map((b) => ({
|
||||
id: b.id, bookingRef: b.bookingRef, status: b.status, totalFare: b.totalMinor / 100, createdAt: b.createdAt,
|
||||
|
||||
Reference in New Issue
Block a user