class SearchItemModel {
  String? assetType;
  String? assetId;
  String? assetName;

  SearchItemModel({
    this.assetType,
    this.assetId,
    this.assetName,
  });

  SearchItemModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    assetType = map['assetType'];
    assetId = map['assetId'];
    assetName = map['assetName'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['assetType'] = this.assetType;
    json['assetId'] = this.assetId;
    json['assetName'] = this.assetName;

    return json;
  }
}

class ResidentItemModel {
  String? id;
  String? name;
  String? mobile;
  String? buildName;
  String? unitName;
  String? roomNo;
  String? assetId;
  String? assetName;
  String? assetType;

  ResidentItemModel({
    this.id,
    this.name,
    this.mobile,
    this.buildName,
    this.unitName,
    this.roomNo,
    this.assetId,
    this.assetName,
    this.assetType,
  });

  ResidentItemModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    name = map['name'];
    mobile = map['mobile'];
    buildName = map['buildName'];
    unitName = map['unitName'];
    roomNo = map['roomNo'];
    assetId = map['id'];
    assetName = map['assetName'];
    assetType = map['assetType'] ?? 'owner';
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['name'] = this.name;
    json['mobile'] = this.mobile;
    json['buildName'] = this.buildName;
    json['unitName'] = this.unitName;
    json['roomNo'] = this.roomNo;
    json['assetId'] = this.id;
    json['assetName'] = this.assetName;
    json['assetType'] = this.assetType;

    return json;
  }
}
