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(new EnvironmentUpdates.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['activityId'] = this.activityId;
    data['cropId'] = this.cropId;
    data['executeDate'] = this.executeDate;
    data['media'] = this.media;
    data['description'] = this.description;
    data['executeBy'] = this.executeBy;
    data['pH'] = this.pH;
    data['ec'] = this.ec;
    data['ocdd'] = this.ocdd;
    data['temperature'] = this.temperature;
    data['dodo'] = this.dodo;
    data['lln'] = this.lln;
    if (this.environmentUpdates != null) {
      data['environmentUpdates'] = this.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 Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['index'] = this.index;
    data['times'] = this.times;
    data['tbEnvironmentalId'] = this.tbEnvironmentalId;
    data['tbEnvironmentalName'] = this.tbEnvironmentalName;
    data['tbEnvironmentalUnit'] = this.tbEnvironmentalUnit;
    data['tbEnvironmentalDescription'] = this.tbEnvironmentalDescription;
    data['tbActivityId'] = this.tbActivityId;
    data['tbEquipmentOfCustomerId'] = this.tbEquipmentOfCustomerId;
    return data;
  }
}
