entityFrame function
Map<String, dynamic>
entityFrame(
- List<MapEntry<String, dynamic>> fields,
- HypiMeta hypi,
- String entityType,
- String entitySubType,
- String entityGroupId,
- String appInstanceId, {
- Map<String, dynamic>? target,
})
Implementation
Map<String, dynamic> entityFrame(
List<MapEntry<String, dynamic>> fields,
HypiMeta hypi,
String entityType,
String entitySubType,
String entityGroupId,
String appInstanceId,
{Map<String, dynamic>? target}) {
target = target ?? {};
target.addAll({
'fields': fields
.map((e) => {
'name': e.key,
//The value is a Hypi JSON type so must be written as such in all cases
'value': json.encode(e.value),
'hypi': {'id': 'fld.${e.key}.${hypi.id}'}
})
.toList(),
'hypi': hypi.toJSON,
'rootEntityID': appInstanceId,
'entityType': entityType,
'entitySubType': entitySubType,
'entityGroupId': entityGroupId,
});
return target;
}