import 'package:cheminova/models/rejected_applicaton_response.dart';
import 'package:cheminova/provider/pd_rd_provider.dart';

class DailyTasksResponse {
  bool? success;
  List<Tasks>? tasks;

  DailyTasksResponse({this.success, this.tasks});

  DailyTasksResponse.fromJson(Map<String, dynamic> json) {
    success = json['success'];
    if (json['tasks'] != null) {
      tasks = <Tasks>[];
      json['tasks'].forEach((v) {
        tasks!.add(new Tasks.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['success'] = this.success;
    if (this.tasks != null) {
      data['tasks'] = this.tasks!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Tasks {
  String? tradeName;
  String? sId;
  String? taskId;
  String? task;
  String? taskStatus;
  String? taskPriority;
  String? taskDueDate;
  String? taskAssignedTo;
  String? taskAssignedBy;
  String? addedFor;
  String? addedForId;
  String? createdAt;
  String? updatedAt;
  int? iV;
  String? note;

  Tasks(
      {this.sId,
        this.taskId,
        this.tradeName,
        this.task,
        this.taskStatus,
        this.taskPriority,
        this.taskDueDate,
        this.taskAssignedTo,
        this.taskAssignedBy,
        this.addedFor,
        this.addedForId,
        this.createdAt,
        this.updatedAt,
        this.iV,
        this.note});

  Tasks.fromJson(Map<String, dynamic> json) {
    sId = json['_id'];
    tradeName = json['tradename'];
    taskId = json['taskId'];
    task = json['task'];
    taskStatus = json['taskStatus'];
    taskPriority = json['taskPriority'];
    taskDueDate = json['taskDueDate'];
    taskAssignedTo = json['taskAssignedTo'];
    taskAssignedBy = json['taskAssignedBy'];
    addedFor = json['addedFor'];
    addedForId = json['addedForId'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    iV = json['__v'];
    note = json['note'];
  }


  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['_id'] = this.sId;
    data['tradename'] = this.tradeName;
    data['taskId'] = this.taskId;
    data['task'] = this.task;
    data['taskStatus'] = this.taskStatus;
    data['taskPriority'] = this.taskPriority;
    data['taskDueDate'] = this.taskDueDate;
    data['taskAssignedTo'] = this.taskAssignedTo;
    data['taskAssignedBy'] = this.taskAssignedBy;
    data['addedFor'] = this.addedFor;
    data['addedForId'] = this.addedForId;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['__v'] = this.iV;
    data['note'] = this.note;
    data['Distributor'] = this.taskAssignedTo;
    return data;
  }
}
