import { ConflictException } from '@nestjs/common';
import { Booking } from './entities/booking.entity';

export function assertBookingStatus(booking: Booking, allowed: string[]): void {
  if (!allowed.includes(booking.status)) {
    throw new ConflictException(
      `Cannot perform this action on status "${booking.status}". Allowed: ${allowed.join(', ')}`,
    );
  }
}
