class Environment {
  int? id;
  int? activityId;
  int? cropId;
  String? executeDate;
  String? media;
  String? description;
  String? executeBy;
  String? pH;
  String? ec;
  String? ocdd;
  String? temperature;
  String? dodo;
  String? lln;
  List<EnvironmentUpdates>? environmentUpdates;

  Environment(
      {this.id,
      this.activityId,
      this.cropId,
      this.executeDate,
      this.media,
      this.description,
      this.executeBy,
      this.pH,
      this.ec,
      this.ocdd,
      this.temperature,
      this.dodo,
      this.lln,
      this.environmentUpdates});

  Environment.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    activityId = json['activityId'];
    cropId = json['cropId'];
    executeDate = json['executeDate'];
    media = json['media'];
    description = json['description'];
    executeBy = json['executeBy'];
    pH = json['pH'];
    ec = json['ec'];
    ocdd = json['ocdd'];
    temperature = json['temperature'];
    dodo = json['dodo'];
    lln = json['lln'];
    if (json['environmentUpdates'] != null) {
      environmentUpdates = <EnvironmentUpdates>[];
      json['environmentUpdates'].forEach((v) {
        environmentUpdates?.add(EnvironmentUpdates.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['id'] = id;
    data['activityId'] = activityId;
    data['cropId'] = cropId;
    data['executeDate'] = executeDate;
    data['media'] = media;
    data['description'] = description;
    data['executeBy'] = executeBy;
    data['pH'] = pH;
    data['ec'] = ec;
    data['ocdd'] = ocdd;
    data['temperature'] = temperature;
    data['dodo'] = dodo;
    data['lln'] = lln;
    if (environmentUpdates != null) {
      data['environmentUpdates'] = environmentUpdates?.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class EnvironmentUpdates {
  int? id;
  num? index;
  num? times;
  int? tbEnvironmentalId;
  String? tbEnvironmentalName;
  String? tbEnvironmentalUnit;
  String? tbEnvironmentalDescription;
  int? tbActivityId;
  num? tbEquipmentOfCustomerId;

  EnvironmentUpdates(
      {this.id,
      this.index,
      this.times,
      this.tbEnvironmentalId,
      this.tbEnvironmentalName,
      this.tbEnvironmentalUnit,
      this.tbEnvironmentalDescription,
      this.tbActivityId,
      this.tbEquipmentOfCustomerId});

  EnvironmentUpdates.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    index = json['index'];
    times = json['times'];
    tbEnvironmentalId = json['tbEnvironmentalId'];
    tbEnvironmentalName = json['tbEnvironmentalName'];
    tbEnvironmentalUnit = json['tbEnvironmentalUnit'];
    tbEnvironmentalDescription = json['tbEnvironmentalDescription'];
    tbActivityId = json['tbActivityId'];
    tbEquipmentOfCustomerId = json['tbEquipmentOfCustomerId'];
  }

  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['id'] = id;
    data['index'] = index;
    data['times'] = times;
    data['tbEnvironmentalId'] = tbEnvironmentalId;
    data['tbEnvironmentalName'] = tbEnvironmentalName;
    data['tbEnvironmentalUnit'] = tbEnvironmentalUnit;
    data['tbEnvironmentalDescription'] = tbEnvironmentalDescription;
    data['tbActivityId'] = tbActivityId;
    data['tbEquipmentOfCustomerId'] = tbEquipmentOfCustomerId;
    return data;
  }
}
