createScoreMSENode function

Future createScoreMSENode(
  1. dynamic type,
  2. dynamic path
)

Implementation

Future createScoreMSENode(var type, var path) async {
  await Storage.controller!
      .add(NodeImpl(Storage.geigerIndicatorUUID,'',':$type'));
  await Storage.controller!
      .add(NodeImpl('data','' ,':$type:' + Storage.geigerIndicatorUUID));

  Node scoreMSENode =NodeImpl(path,'',':$type:' + Storage.geigerIndicatorUUID + ':data');

  //create node keys: UserScore, ImplementRecommendations
  NodeValue geigerScore =
  NodeValueImpl('GEIGER_score', '0'); //add node name (name of threat)
  await scoreMSENode.addValue(geigerScore);

  NodeValue location = NodeValueImpl('location', '');
  await scoreMSENode.addValue(location);

  NodeValue sector = NodeValueImpl('sector', '0');
  await scoreMSENode.addValue(sector);

  NodeValue associatedProfiles = NodeValueImpl('associatedProfiles', '0');
  await scoreMSENode.addValue(associatedProfiles);

  geigerScore.setDescription('GEIGER user score');

  await Storage.controller!.add(scoreMSENode);
}