feat: Implement event dashboard with activation, cancellation, editing, and booking management functionalities.
This commit is contained in:
@@ -32,6 +32,9 @@ export class BookingResponseDto {
|
||||
})
|
||||
user?: UserResponseDto;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
status?: string;
|
||||
|
||||
constructor(booking: Booking) {
|
||||
this.id = Number(booking.id); // Handle BigInt conversion
|
||||
this.eventId = Number(booking.eventId);
|
||||
@@ -46,6 +49,14 @@ export class BookingResponseDto {
|
||||
// Assuming User entity has firstName/lastName
|
||||
this.user = new UserResponseDto(booking.user);
|
||||
}
|
||||
this.status = 'active';
|
||||
if (booking.canceledAt) {
|
||||
if (booking.canceledReason == 'customer_cancelled') {
|
||||
this.status = 'customer_cancelled';
|
||||
} else {
|
||||
this.status = 'cancelled';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user