class Hospital{
  int id;
  int customerCode;
  String name;
  List buildings;

  Hospital({
    this.id,
    this.customerCode,
    this.name,
    this.buildings,
  });


  factory Hospital.fromJson(Map<String,dynamic> parsedJson){
    return Hospital(
      id: parsedJson["id"],
      name: parsedJson["custName"],
      customerCode: parsedJson["customerCode"],
      buildings: parsedJson["buildings"]
    );
  }

  factory Hospital.fromHospital(Hospital hospital){
    return Hospital(
      id: hospital?.id,
      name: hospital?.name,
      customerCode: hospital?.customerCode,
      buildings:hospital?.buildings
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'customerCode': customerCode,
      'custName': name,
      "buildings":buildings
    };
  }
}