toDocument method

  1. @override
Map<String, Object?> toDocument()
override

Implementation

@override
Map<String, Object?> toDocument() {
  final Map<String, dynamic>? taskMap =
      task != null ? task!.toDocument() : null;
  final List<Map<String?, dynamic>>? resultsCurrentListMap =
      resultsCurrent != null
          ? resultsCurrent!.map((item) => item.toDocument()).toList()
          : null;
  final List<Map<String?, dynamic>>? resultsPreviousListMap =
      resultsPrevious != null
          ? resultsPrevious!.map((item) => item.toDocument()).toList()
          : null;
  final Map<String, dynamic>? confirmMessageMap =
      confirmMessage != null ? confirmMessage!.toDocument() : null;
  final Map<String, dynamic>? rejectMessageMap =
      rejectMessage != null ? rejectMessage!.toDocument() : null;

  Map<String, Object?> theDocument = HashMap();
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  if (reporterId != null) {
    theDocument["reporterId"] = reporterId;
  } else {
    theDocument["reporterId"] = null;
  }
  if (assigneeId != null) {
    theDocument["assigneeId"] = assigneeId;
  } else {
    theDocument["assigneeId"] = null;
  }
  if (task != null) {
    theDocument["task"] = taskMap;
  } else {
    theDocument["task"] = null;
  }
  if (workflowId != null) {
    theDocument["workflowId"] = workflowId;
  } else {
    theDocument["workflowId"] = null;
  }
  if (workflowTaskSeqNumber != null) {
    theDocument["workflowTaskSeqNumber"] = workflowTaskSeqNumber;
  } else {
    theDocument["workflowTaskSeqNumber"] = null;
  }
  theDocument["timestamp"] = timestamp;
  if (status != null) {
    theDocument["status"] = status;
  } else {
    theDocument["status"] = null;
  }
  if (resultsCurrent != null) {
    theDocument["resultsCurrent"] = resultsCurrentListMap;
  } else {
    theDocument["resultsCurrent"] = null;
  }
  if (resultsPrevious != null) {
    theDocument["resultsPrevious"] = resultsPreviousListMap;
  } else {
    theDocument["resultsPrevious"] = null;
  }
  if (triggeredById != null) {
    theDocument["triggeredById"] = triggeredById;
  } else {
    theDocument["triggeredById"] = null;
  }
  if (confirmMessage != null) {
    theDocument["confirmMessage"] = confirmMessageMap;
  } else {
    theDocument["confirmMessage"] = null;
  }
  if (rejectMessage != null) {
    theDocument["rejectMessage"] = rejectMessageMap;
  } else {
    theDocument["rejectMessage"] = null;
  }
  return theDocument;
}