refactor( iam ): migrate guest booking to IAM; make Passenger.userId nullable

This commit is contained in:
Abubeker Yasin
2026-06-08 15:27:32 +03:00
parent ac153fb0d0
commit c1dcfb04c3
11 changed files with 99 additions and 357 deletions

View File

@@ -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,