class DoctorsConsultation {
  List<ConsultationCenter>? consultationCenter;
  DoctorsConsultation({
    this.consultationCenter,
  });
  Map<String, dynamic> toJson() => {
        'consultationCenter': consultationCenter
            ?.map((consultationCenter) => consultationCenter.toJson())
            .toList(),
      };
  static DoctorsConsultation fromJson(Map<String, dynamic> json) =>
      DoctorsConsultation(
        consultationCenter: (json['consultationCenter'] as List<dynamic>?)
            ?.map((schedule) => ConsultationCenter.fromJson(schedule))
            .toList(),
      );
}

class ConsultationCenter {
  String? floorBuilding;
  String? street;
  String? city;
  String? state;
  String? country;
  String? postalCode;
  String? documentId;
  String? addressType;
  String? consultationFee;
  String? averageDurationMinutes;
  List<AvailabilitySchedule>? weeklySchedule;

  ConsultationCenter({
    this.addressType,
    this.documentId,
    this.floorBuilding,
    this.street,
    this.city,
    this.state,
    this.country,
    this.postalCode,
    this.consultationFee,
    this.averageDurationMinutes,
    this.weeklySchedule,
  });

  Map<String, dynamic> toJson() => {
        'floorBuilding': floorBuilding,
        'documentId': documentId,
        'street': street,
        'city': city,
        'state': state,
        'country': country,
        'postalCode': postalCode,
        'addressType': addressType,
        'consultationFee': consultationFee,
        'averageDurationMinutes': averageDurationMinutes,
        'weeklySchedule':
            weeklySchedule?.map((schedule) => schedule.toJson()).toList(),
      };

  static ConsultationCenter fromJson(Map<String, dynamic> json) =>
      ConsultationCenter(
        // id:json['id']
        floorBuilding: json['floorBuilding'],
        documentId: json['documentId'],
        street: json['street'],
        city: json['city'],
        state: json['state'],
        country: json['country'],
        postalCode: json['postalCode'],
        addressType: json['addressType'],
        consultationFee: json['consultationFee'],
        averageDurationMinutes: json['averageDurationMinutes'],
        weeklySchedule: (json['weeklySchedule'] as List<dynamic>?)
            ?.map((schedule) => AvailabilitySchedule.fromJson(schedule))
            .toList(),
      );
}

class AvailabilitySchedule {
  String? day;
  List<TimeSlot>? timeSlots;

  AvailabilitySchedule({
    this.day,
    this.timeSlots,
  });

  Map<String, dynamic> toJson() => {
        'day': day,
        'timeSlots': timeSlots?.map((slot) => slot.toJson()).toList(),
      };

  static AvailabilitySchedule fromJson(Map<String, dynamic> json) =>
      AvailabilitySchedule(
        day: json['day'],
        timeSlots: (json['timeSlots'] as List<dynamic>?)
            ?.map((slot) => TimeSlot.fromJson(slot))
            .toList(),
      );
}

class TimeSlot {
  String? startTime;
  String? endTime;

  TimeSlot({
    this.startTime,
    this.endTime,
  });

  Map<String, dynamic> toJson() => {
        'startTime': startTime,
        'endTime': endTime,
      };

  static TimeSlot fromJson(Map<String, dynamic> json) => TimeSlot(
        startTime: json['startTime'],
        endTime: json['endTime'],
      );
}
