import 'package:test_sa/models/generic_attachment_model.dart';
import 'package:test_sa/modules/incident_module/incident_attachment_model.dart';

class IncidentDataModel {
  int? id;
  int? reqNo;
  String? reqCode;
  int? incidentStatusId;
  String? incidentStatusName;
  int? incidentStatusValue;
  int? incidentClassificationId;
  String? incidentClassificationName;
  int? incidentClassificationValue;
  int? existingOvrTicketId;
  String? existingOvrTicketName;
  int? existingOvrTicketValue;
  String? ovrTicketNumber;
  String? incidentTitle;
  String? incidentDescription;
  int? assetId;
  String? assetNumber;
  String? oracleCode;
  String? model;
  String? manufacturer;
  String? assetOrigin;
  int? siteId;
  String? siteName;
  int? buildingId;
  String? buildingName;
  int? departmentId;
  String? departmentName;
  int? floorId;
  String? floorName;
  int? rootCauseId;
  String? rootCauseName;
  int? rootCauseValue;
  String? otherRootCause;
  String? comments;
  int? personInvolvedId;
  String? personInvolvedName;
  int? personInvolvedValue;
  int? genderId;
  String? genderName;
  int? personInvolvedEmployeeId;
  String? personInvolvedEmployeeName;
  String? assignedQAId;
  String? assignedQAName;
  String? assignedSecondaryQAId;
  String? assignedSecondaryQAName;
  String? qaLeaderId;
  String? qaLeaderName;
  String? correctiveAction;
  int? escalateToOvrId;
  String? escalateToOvrName;
  int? immediateActionId;
  String? immediateActionName;
  int? clinicalOrNonClinicalId;
  String? clinicalOrNonClinicalName;
  String? recommendation;
  String? requestorUserId;
  String? requesterEmployeeId;
  String? requesterEmployeeName;
  String? requesterEmployeeEmail;
  String? requesterPosition;
  String? requesterContactNo;
  String? requesterExtensionNo;
  int? requestorSiteId;
  String? requestorSiteName;
  int? requestorDepartmentId;
  String? requestorDepartmentName;
  int? requestorFlowDepartmentId;
  String? requestorFlowDepartmentName;
  String? requestorFlowDepartmentShortCode;
  String? approvalSignature;
  String? occurrenceDate;
  String? createdDate;
  List<GenericAttachmentModel>? incidentAttachments;
  int? workOrderId;
  String? workOrderNo;

  IncidentDataModel(
      {this.id,
      this.reqNo,
      this.reqCode,
      this.incidentStatusId,
      this.incidentStatusName,
      this.incidentStatusValue,
      this.incidentClassificationId,
      this.incidentClassificationName,
      this.incidentClassificationValue,
      this.existingOvrTicketId,
      this.existingOvrTicketName,
      this.existingOvrTicketValue,
      this.ovrTicketNumber,
      this.incidentTitle,
      this.incidentDescription,
      this.assetId,
      this.assetNumber,
      this.oracleCode,
      this.model,
      this.manufacturer,
      this.assetOrigin,
      this.siteId,
      this.siteName,
      this.buildingId,
      this.buildingName,
      this.departmentId,
      this.departmentName,
      this.floorId,
      this.floorName,
      this.rootCauseId,
      this.rootCauseName,
      this.rootCauseValue,
      this.otherRootCause,
      this.comments,
      this.personInvolvedId,
      this.personInvolvedName,
      this.personInvolvedValue,
      this.genderId,
      this.genderName,
      this.personInvolvedEmployeeId,
      this.personInvolvedEmployeeName,
      this.assignedQAId,
      this.assignedQAName,
      this.assignedSecondaryQAId,
      this.assignedSecondaryQAName,
      this.qaLeaderId,
      this.qaLeaderName,
      this.correctiveAction,
      this.escalateToOvrId,
      this.escalateToOvrName,
      this.immediateActionId,
      this.immediateActionName,
      this.clinicalOrNonClinicalId,
      this.clinicalOrNonClinicalName,
      this.recommendation,
      this.requestorUserId,
      this.requesterEmployeeId,
      this.requesterEmployeeName,
      this.requesterEmployeeEmail,
      this.requesterPosition,
      this.requesterContactNo,
      this.requesterExtensionNo,
      this.requestorSiteId,
      this.requestorSiteName,
      this.requestorDepartmentId,
      this.requestorDepartmentName,
      this.requestorFlowDepartmentId,
      this.requestorFlowDepartmentName,
      this.requestorFlowDepartmentShortCode,
      this.approvalSignature,
      this.occurrenceDate,
      this.createdDate,
      this.workOrderId,
      this.workOrderNo,
      this.incidentAttachments});

  IncidentDataModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    reqNo = json['reqNo'];
    reqCode = json['reqCode'];
    incidentStatusId = json['incidentStatusId'];
    incidentStatusName = json['incidentStatusName'];
    incidentStatusValue = json['incidentStatusValue'];
    incidentClassificationId = json['incidentClassificationId'];
    incidentClassificationName = json['incidentClassificationName'];
    incidentClassificationValue = json['incidentClassificationValue'];
    existingOvrTicketId = json['existingOvrTicketId'];
    existingOvrTicketName = json['existingOvrTicketName'];
    existingOvrTicketValue = json['existingOvrTicketValue'];
    ovrTicketNumber = json['ovrTicketNumber'];
    incidentTitle = json['incidentTitle'];
    incidentDescription = json['incidentDescription'];
    assetId = json['assetId'];
    assetNumber = json['assetNumber'];
    oracleCode = json['oracleCode'];
    model = json['model'];
    manufacturer = json['manufacturer'];
    assetOrigin = json['assetOrigin'];
    siteId = json['siteId'];
    siteName = json['siteName'];
    buildingId = json['buildingId'];
    buildingName = json['buildingName'];
    departmentId = json['departmentId'];
    departmentName = json['departmentName'];
    floorId = json['floorId'];
    floorName = json['floorName'];
    rootCauseId = json['rootCauseId'];
    rootCauseName = json['rootCauseName'];
    rootCauseValue = json['rootCauseValue'];
    otherRootCause = json['otherRootCause'];
    comments = json['comments'];
    personInvolvedId = json['personInvolvedId'];
    personInvolvedName = json['personInvolvedName'];
    personInvolvedValue = json['personInvolvedValue'];
    genderId = json['genderId'];
    genderName = json['genderName'];
    personInvolvedEmployeeId = json['personInvolvedEmployeeId'];
    personInvolvedEmployeeName = json['personInvolvedEmployeeName'];
    assignedQAId = json['assignedQAId'];
    assignedQAName = json['assignedQAName'];
    assignedSecondaryQAId = json['assignedSecondaryQAId'];
    assignedSecondaryQAName = json['assignedSecondaryQAName'];
    qaLeaderId = json['qaLeaderId'];
    qaLeaderName = json['qaLeaderName'];
    correctiveAction = json['correctiveAction'];
    escalateToOvrId = json['escalateToOvrId'];
    escalateToOvrName = json['escalateToOvrName'];
    immediateActionId = json['immediateActionId'];
    immediateActionName = json['immediateActionName'];
    clinicalOrNonClinicalId = json['clinicalOrNonClinicalId'];
    clinicalOrNonClinicalName = json['clinicalOrNonClinicalName'];
    recommendation = json['recommendation'];
    requestorUserId = json['requestorUserId'];
    requesterEmployeeId = json['requesterEmployeeId'];
    requesterEmployeeName = json['requesterEmployeeName'];
    requesterEmployeeEmail = json['requesterEmployeeEmail'];
    requesterPosition = json['requesterPosition'];
    requesterContactNo = json['requesterContactNo'];
    requesterExtensionNo = json['requesterExtensionNo'];
    requestorSiteId = json['requestorSiteId'];
    requestorSiteName = json['requestorSiteName'];
    requestorDepartmentId = json['requestorDepartmentId'];
    requestorDepartmentName = json['requestorDepartmentName'];
    requestorFlowDepartmentId = json['requestorFlowDepartmentId'];
    requestorFlowDepartmentName = json['requestorFlowDepartmentName'];
    requestorFlowDepartmentShortCode = json['requestorFlowDepartmentShortCode'];
    approvalSignature = json['approvalSignature'];
    occurrenceDate = json['occurrenceDate'];
    createdDate = json['createdDate'];
    workOrderId = json['workOrderId'];
    workOrderNo = json['workOrderNo'];
    if (json['incidentAttachments'] != null) {
      incidentAttachments = <GenericAttachmentModel>[];
      json['incidentAttachments'].forEach((v) {
        incidentAttachments!.add(GenericAttachmentModel.fromIncidentJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['reqNo'] = this.reqNo;
    data['reqCode'] = this.reqCode;
    data['incidentStatusId'] = this.incidentStatusId;
    data['incidentStatusName'] = this.incidentStatusName;
    data['incidentStatusValue'] = this.incidentStatusValue;
    data['incidentClassificationId'] = this.incidentClassificationId;
    data['incidentClassificationName'] = this.incidentClassificationName;
    data['incidentClassificationValue'] = this.incidentClassificationValue;
    data['existingOvrTicketId'] = this.existingOvrTicketId;
    data['existingOvrTicketName'] = this.existingOvrTicketName;
    data['existingOvrTicketValue'] = this.existingOvrTicketValue;
    data['ovrTicketNumber'] = this.ovrTicketNumber;
    data['incidentTitle'] = this.incidentTitle;
    data['incidentDescription'] = this.incidentDescription;
    data['assetId'] = this.assetId;
    data['assetNumber'] = this.assetNumber;
    data['oracleCode'] = this.oracleCode;
    data['model'] = this.model;
    data['manufacturer'] = this.manufacturer;
    data['assetOrigin'] = this.assetOrigin;
    data['siteId'] = this.siteId;
    data['siteName'] = this.siteName;
    data['buildingId'] = this.buildingId;
    data['buildingName'] = this.buildingName;
    data['departmentId'] = this.departmentId;
    data['departmentName'] = this.departmentName;
    data['floorId'] = this.floorId;
    data['floorName'] = this.floorName;
    data['rootCauseId'] = this.rootCauseId;
    data['rootCauseName'] = this.rootCauseName;
    data['rootCauseValue'] = this.rootCauseValue;
    data['otherRootCause'] = this.otherRootCause;
    data['comments'] = this.comments;
    data['personInvolvedId'] = this.personInvolvedId;
    data['personInvolvedName'] = this.personInvolvedName;
    data['personInvolvedValue'] = this.personInvolvedValue;
    data['genderId'] = this.genderId;
    data['genderName'] = this.genderName;
    data['personInvolvedEmployeeId'] = this.personInvolvedEmployeeId;
    data['personInvolvedEmployeeName'] = this.personInvolvedEmployeeName;
    data['assignedQAId'] = this.assignedQAId;
    data['assignedQAName'] = this.assignedQAName;
    data['assignedSecondaryQAId'] = this.assignedSecondaryQAId;
    data['assignedSecondaryQAName'] = this.assignedSecondaryQAName;
    data['qaLeaderId'] = this.qaLeaderId;
    data['qaLeaderName'] = this.qaLeaderName;
    data['correctiveAction'] = this.correctiveAction;
    data['escalateToOvrId'] = this.escalateToOvrId;
    data['escalateToOvrName'] = this.escalateToOvrName;
    data['immediateActionId'] = this.immediateActionId;
    data['immediateActionName'] = this.immediateActionName;
    data['clinicalOrNonClinicalId'] = this.clinicalOrNonClinicalId;
    data['clinicalOrNonClinicalName'] = this.clinicalOrNonClinicalName;
    data['recommendation'] = this.recommendation;
    data['requestorUserId'] = this.requestorUserId;
    data['requesterEmployeeId'] = this.requesterEmployeeId;
    data['requesterEmployeeName'] = this.requesterEmployeeName;
    data['requesterEmployeeEmail'] = this.requesterEmployeeEmail;
    data['requesterPosition'] = this.requesterPosition;
    data['requesterContactNo'] = this.requesterContactNo;
    data['requesterExtensionNo'] = this.requesterExtensionNo;
    data['requestorSiteId'] = this.requestorSiteId;
    data['requestorSiteName'] = this.requestorSiteName;
    data['requestorDepartmentId'] = this.requestorDepartmentId;
    data['requestorDepartmentName'] = this.requestorDepartmentName;
    data['requestorFlowDepartmentId'] = this.requestorFlowDepartmentId;
    data['requestorFlowDepartmentName'] = this.requestorFlowDepartmentName;
    data['requestorFlowDepartmentShortCode'] = this.requestorFlowDepartmentShortCode;
    data['approvalSignature'] = this.approvalSignature;
    data['occurrenceDate'] = this.occurrenceDate;
    data['createdDate'] = this.createdDate;
    data['workOrderId'] = this.workOrderId;
    data['workOrderNo'] = this.workOrderNo;
    if (this.incidentAttachments != null) {
      data['incidentAttachments'] = this.incidentAttachments!.map((v) => v.toIncidentJson()).toList();
    }
    return data;
  }
}
