class BookingModel {
  final String uuid, roomName, date, timeSlot;
  final int cost;
  BookingModel({
    required this.uuid,
    required this.roomName,
    required this.date,
    required this.timeSlot,
    required this.cost,
  });
  factory BookingModel.zero() => BookingModel(
        uuid: '',
        roomName: '',
        date: '',
        timeSlot: '',
        cost: -1,
      );
  factory BookingModel.fromJson(Map<String, dynamic> json) => BookingModel(
        uuid: json['uuid'] as String,
        roomName: json['roomName'] as String,
        date: json['date'] as String,
        timeSlot: json['timeSlot'] as String,
        cost: json['cost'] as int,
      );

  static List<BookingModel> fromJsonList(List<dynamic> jsonList) => jsonList
      .map(
        (bookModel) => BookingModel.fromJson(bookModel),
      )
      .toList();

  Map<String, dynamic> toJson() => {
        'uuid': uuid,
        'roomName': roomName,
        'date': date,
        'timeSlot': timeSlot,
        'cost': cost,
      };
}
