import 'SuppliesUsing.dart';

class Dung {
  int? id;
  int? activityId;
  int? cropId;
  String? executeDate;
  String? description;
  String? media;
  num? quarantinePeriod;
  String? weatherConditions;
  String? purpose;
  String? executeBy;
  List<String>? mediaDel;
  List<SuppliesUsing>? suppliesUsing;

  Dung(
      {this.id,
      this.activityId,
      this.cropId,
      this.executeDate,
      this.description,
      this.media,
      this.quarantinePeriod,
      this.weatherConditions,
      this.purpose,
      this.executeBy,
      this.mediaDel,
      this.suppliesUsing});

  Dung.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    cropId = json['cropId'];
    activityId = json['activityId'];
    executeDate = json['executeDate'];
    description = json['description'];
    media = json['media'];
    quarantinePeriod = json['quarantinePeriod'];
    weatherConditions = json['weatherConditions'];
    purpose = json['purpose'];
    executeBy = json['executeBy'];
    if (json['suppliesUsing'] != null) {
      suppliesUsing = <SuppliesUsing>[];
      json['suppliesUsing'].forEach((v) {
        suppliesUsing?.add(new SuppliesUsing.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['cropId'] = this.cropId;
    data['activityId'] = this.activityId;
    data['executeDate'] = this.executeDate;
    data['description'] = this.description;
    data['media'] = this.media;
    data['quarantinePeriod'] = this.quarantinePeriod;
    data['weatherConditions'] = this.weatherConditions;
    data['purpose'] = this.purpose;
    data['executeBy'] = this.executeBy;
    data['media_del'] = this.mediaDel;
    if (this.suppliesUsing != null) {
      data['suppliesUsing'] = this.suppliesUsing?.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
