
import 'package:test_sa/models/engineer.dart';
import 'package:test_sa/models/visits/visit.dart';

class VisitsGroup{
  // String userId;
  // String workingHours;
  // String travelingHours;
  // String jobSheetNumber;
  // String image;
  // Lookup status;
  // Lookup taskStatus;
  // DateTime date;
  Engineer engineer;
  List<Visit> visits;

  VisitsGroup({
    // this.userId,
    // this.status,
    // this.date,
    // this.jobSheetNumber,
    // this.travelingHours,
    // this.workingHours,
     this.visits,
     this.engineer,
    // this.image,
    // this.taskStatus,
  });

  Map<String,dynamic> toJson(){
    Map<String,dynamic> jsonObject = {};
    jsonObject["ids"] = visits.map((e) => e.id).toList();
    jsonObject["assignedEmployeeId"] = engineer?.id;
    // if(status != null) jsonObject["taskStatusId"] = status.id.toString();
    // if(date != null) jsonObject["actualDate"] = date.toIso8601String();
    // if(jobSheetNumber != null && jobSheetNumber.isNotEmpty)
    //   jsonObject["jobSheetNo"] = jobSheetNumber;
    // if(travelingHours != null && travelingHours.isNotEmpty)
    //   jsonObject["travelingHours"] = travelingHours;
    // if(workingHours != null && workingHours.isNotEmpty)
    //   jsonObject["workingHours"] = workingHours;
    // if(image != null) jsonObject["image"] = image;
    // if(taskStatus != null) jsonObject["task_status"] = taskStatus.id.toString();
    return jsonObject;
  }


}