Class: EventSequenceAnalysisService
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:15
Service for Event Sequence Analysis nested models. Supports listing and single-item retrieval.
Constructors
Constructor
new EventSequenceAnalysisService(
eventSequenceAnalysisModel,nestedModelService,nestedModelHelperService):EventSequenceAnalysisService
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:22
Construct the service with persistence and helper dependencies.
Parameters
eventSequenceAnalysisModel
Model<EventSequenceAnalysisDocument>
Mongoose model for EventSequenceAnalysis collection
nestedModelService
Service to allocate IDs and shared nested model ops
nestedModelHelperService
Helper to link/unlink nested models to typed models
Returns
EventSequenceAnalysisService
Methods
createEventSequenceAnalysis()
createEventSequenceAnalysis(
body,typedModel):Promise<NestedModel>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:72
creates the type of nested model defined in the function name
Parameters
body
Partial<NestedModel>
a nested model, that needs to contain its parent id (easier to grab on frontend with getCurrentModel) and a label object with a name string and optional description string
typedModel
is the typed model to be updated
Returns
Promise<NestedModel>
a promise with a nested model in it, which contains the basic data all the nested models have
deleteEventSequenceAnalysis()
deleteEventSequenceAnalysis(
modelId,typedModel):Promise<void>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:104
finds and deletes the nested model in this collection with the give model id
Parameters
modelId
string
the id of the model we want to delete
typedModel
is the typed model that this nested model belongs to
Returns
Promise<void>
a promise with the deleted model
getEventSequenceAnalysis()
getEventSequenceAnalysis(
parentId):Promise<EventSequenceAnalysis[]>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:34
gets the collection of the nested model as defined by the function name (bayesian estimations, etc.)
Parameters
parentId
number
id of the parent model the nested model is number
Returns
Promise<EventSequenceAnalysis[]>
a promise with an array of the nested model of the type in the function name
getEventSequenceAnalysisString()
getEventSequenceAnalysisString(
parentId):Promise<EventSequenceAnalysis[]>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:43
Retrieves Event Sequence Analysis items by parent id (string form).
Parameters
parentId
string
Parent identifier as a string (ObjectId)
Returns
Promise<EventSequenceAnalysis[]>
Array of Event Sequence Analysis documents for the given parent
getSingleEventSequenceAnalysis()
getSingleEventSequenceAnalysis(
modelId):Promise<EventSequenceAnalysis>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:52
gets a single model from the collection based on the id
Parameters
modelId
number
the id of the model to be retrieved
Returns
Promise<EventSequenceAnalysis>
the model which has the associated id
getSingleEventSequenceAnalysisString()
getSingleEventSequenceAnalysisString(
modelId):Promise<EventSequenceAnalysis>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:61
Retrieves a single Event Sequence Analysis by string id.
Parameters
modelId
string
Document _id as a string (ObjectId)
Returns
Promise<EventSequenceAnalysis>
The matching Event Sequence Analysis document
updateEventSequenceAnalysisLabel()
updateEventSequenceAnalysisLabel(
id,body):Promise<NestedModel>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-analysis.service.ts:94
updates the label in the nested model
Parameters
id
string
the id of the nested model to be updated
body
a label with a name and description
Returns
Promise<NestedModel>
a promise with the updated model with an updated label
