src/helpers/flow/FlowDataGroup.js
import Helper from '../Helper';
import FlowDataGroupModel from '../../models/flow/FlowDataGroup';
import { aggregate } from '../../utilities/ClassUtility';
/**
* Helper class representing a Flow Data Group (Captured Value Group).
*
* @extends {FlowDataGroupModel}
* @extends {Helper}
*/
class FlowDataGroup extends aggregate(FlowDataGroupModel, Helper) {
/**
* Constructor for helper class representing a Flow Data Group (Captured Value Group)
*
* @param {Object} json - json api response from server
*/
constructor(json = {}) {
super(json);
this.deserializeRelationshipStubs(json);
this.syncRelationships(json);
if (json.meta) {
/** @type {Object} */
this._meta = json.meta;
}
}
/** @type {String} - The type */
get type() {
return 'data_collection__captured_value_groups';
}
/** @type {FlowData[]} */
get capturedValues() {
return this._relationships.captured_values;
}
/** @type {FlowData[]} */
set capturedValues(capturedValues) {
/** @type {FlowData[]} */
this._relationships.captured_values = capturedValues;
}
/** @type {Entry[]} */
get entry() {
return this._relationships.ediary_entry;
}
/** @type {Entry[]} */
set entry(entry) {
/** @type {Entry[]} */
this._relationships.ediary_entry = entry;
}
/** @type {FlowData[]} */
get flowData() {
return this._relationships.captured_values;
}
/** @type {FlowData[]} */
set flowData(flowData) {
/** @type {FlowData[]} */
this._relationships.captured_values = flowData;
}
/** @type {User} */
get creator() {
return this._relationships.creator;
}
/** @type {User} */
set creator(creator) {
/** @type {User} */
this._relationships.creator = creator;
}
/** @type {Flow} */
get flow() {
return this._relationships.flow_process;
}
/** @type {Flow} */
set flow(flow) {
/** @type {Flow} */
this._relationships.flow_process = flow;
}
/** @type {User} */
get owner() {
return this._relationships.owner;
}
/** @type {User} */
set owner(owner) {
/** @type {User} */
this._relationships.owner = owner;
}
/** @type {Status} */
get status() {
return this._relationships.status;
}
/** @type {Status} */
set status(status) {
/** @type {Status} */
this._relationships.status = status;
}
/** @type {Object} */
get meta() {
const meta = this._meta || {};
return meta;
}
}
export default FlowDataGroup;