Class: EventSequenceDiagramService
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:16
Service for Event Sequence Diagram nested models. Supports list, single-item retrieval, creation and label updates.
Constructors
Constructor
new EventSequenceDiagramService(
eventSequenceDiagramModel,nestedModelService,nestedModelHelperService,graphModelService):EventSequenceDiagramService
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:25
Construct the service with injected Event Sequence Diagram model and helpers.
Parameters
eventSequenceDiagramModel
Model<EventSequenceDiagramDocument>
Mongoose model for Event Sequence Diagram documents
nestedModelService
Core nested model service for counters and common creates
nestedModelHelperService
Helper service to link nested models to typed models
graphModelService
Service to create/update/read graph models for event sequences
Returns
EventSequenceDiagramService
Methods
createEventSequenceDiagram()
createEventSequenceDiagram(
body,typedModel):Promise<NestedModel>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:76
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
deleteEventSequenceDiagram()
deleteEventSequenceDiagram(
modelId,typedModel):Promise<void>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:112
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
getEventSequenceDiagrams()
getEventSequenceDiagrams(
parentId):Promise<EventSequenceDiagram[]>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:38
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<EventSequenceDiagram[]>
a promise with an array of the nested model of the type in the function name
getEventSequenceDiagramsString()
getEventSequenceDiagramsString(
parentId):Promise<EventSequenceDiagram[]>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:47
Retrieves Event Sequence Diagrams by parent id (string form).
Parameters
parentId
string
Parent identifier as a string (ObjectId)
Returns
Promise<EventSequenceDiagram[]>
Array of Event Sequence Diagram documents for the given parent
getSingleEventSequenceDiagram()
getSingleEventSequenceDiagram(
modelId):Promise<EventSequenceDiagram>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:56
gets a single model from the collection based on the id
Parameters
modelId
number
the id of the model to be retrieved
Returns
Promise<EventSequenceDiagram>
the model which has the associated id
getSingleEventSequenceDiagramString()
getSingleEventSequenceDiagramString(
modelId):Promise<EventSequenceDiagram>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:65
Retrieves a single Event Sequence Diagram by string id.
Parameters
modelId
string
Document _id as a string (ObjectId)
Returns
Promise<EventSequenceDiagram>
The matching Event Sequence Diagram document
updateEventSequenceDiagramLabel()
updateEventSequenceDiagramLabel(
id,body):Promise<NestedModel>
Defined in: packages/web-backend/src/nestedModels/NestedModelsHelpers/event-sequence-diagram.service.ts:102
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
