basic booking load behavior

This commit is contained in:
Roland Schneider
2025-12-19 22:40:32 +01:00
parent 4e77578abf
commit e9943dae76
7 changed files with 17 additions and 8 deletions

View File

@@ -22,6 +22,9 @@ export class BookingResponseDto {
@ApiProperty({ nullable: true })
canceledAt?: string;
@ApiProperty({ nullable: true })
createdAt?: string; // ISO String for the client
// Flattened User Info (Avoid sending the whole User object)
@ApiProperty({
nullable: true,
@@ -36,6 +39,7 @@ export class BookingResponseDto {
this.notes = booking.notes;
this.reservedSeatsCount = booking.reservedSeatsCount;
this.canceledAt = booking.canceledAt?.toISOString() || undefined;
this.createdAt = booking.createdAt?.toISOString() || undefined;
// Safety check: Only map user if relation is loaded
if (booking.user) {