Class ProcessService
Provides process management operations for event workflows in the OEMS system.
Implements
Inherited Members
Namespace: OEMS.Core.Application.ApplicationServices
Assembly: OEMS.Core.dll
Syntax
public class ProcessService : IProcessService
Constructors
ProcessService(IEventProcessRepository, IEventProcessStepRepository, IEmailService, IEventRepository, IEventParticipationRepository, IProcessStepTemplateRepository, IMapper, ILogger<ProcessService>)
Initializes a new instance of the ProcessService class.
Declaration
public ProcessService(IEventProcessRepository processRepository, IEventProcessStepRepository stepRepository, IEmailService emailService, IEventRepository eventRepository, IEventParticipationRepository participationRepository, IProcessStepTemplateRepository stepTemplateRepository, IMapper mapper, ILogger<ProcessService> logger)
Parameters
Type | Name | Description |
---|---|---|
IEventProcessRepository | processRepository | The event process repository for data access operations. |
IEventProcessStepRepository | stepRepository | The event process step repository for step data access operations. |
IEmailService | emailService | The email service for sending notifications. |
IEventRepository | eventRepository | The event repository for event data access operations. |
IEventParticipationRepository | participationRepository | The event participation repository for participation data access operations. |
IProcessStepTemplateRepository | stepTemplateRepository | The process step template repository for template data access operations. |
IMapper | mapper | The AutoMapper instance for object mapping. |
ILogger<ProcessService> | logger |
Methods
AssignProcessToEventAsync(Guid, Guid)
Assigns a process to an event.
Declaration
public Task AssignProcessToEventAsync(Guid processId, Guid eventId)
Parameters
Type | Name | Description |
---|---|---|
Guid | processId | The unique identifier of the process to assign. |
Guid | eventId | The unique identifier of the event. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
CheckParticipantCountNotReachedByDateAsync(Guid)
Checks if an event hasn't reached its target participant count by the scheduled date and triggers appropriate process steps
Declaration
public Task CheckParticipantCountNotReachedByDateAsync(Guid eventId)
Parameters
Type | Name | Description |
---|---|---|
Guid | eventId |
Returns
Type | Description |
---|---|
Task |
CreateProcessStepAsync(CreateProcessStepDto)
Creates a new process step.
Declaration
public Task<Guid> CreateProcessStepAsync(CreateProcessStepDto dto)
Parameters
Type | Name | Description |
---|---|---|
CreateProcessStepDto | dto | The process step creation data transfer object. |
Returns
Type | Description |
---|---|
Task<Guid> | A task that represents the asynchronous operation. The task result contains the unique identifier of the created process step. |
DeleteProcessStepAsync(Guid)
Deletes a process step by its unique identifier.
Declaration
public Task DeleteProcessStepAsync(Guid id)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The unique identifier of the process step to delete. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
GetProcessStepsForEventAsync(Guid)
Retrieves all process steps associated with a specific event.
Declaration
public Task<IEnumerable<ProcessStepDto>> GetProcessStepsForEventAsync(Guid eventId)
Parameters
Type | Name | Description |
---|---|---|
Guid | eventId | The unique identifier of the event. |
Returns
Type | Description |
---|---|
Task<IEnumerable<ProcessStepDto>> | A task that represents the asynchronous operation. The task result contains a collection of process step data transfer objects. |
HandleEventTriggerAsync(Guid, ProzessstepTrigger, string)
Handles event-based triggers for a specific event
Declaration
public Task HandleEventTriggerAsync(Guid eventId, ProzessstepTrigger trigger, string reason)
Parameters
Type | Name | Description |
---|---|---|
Guid | eventId | |
ProzessstepTrigger | trigger | |
string | reason |
Returns
Type | Description |
---|---|
Task |
ProcessTimeBasedTriggersAsync()
Processes all time-based triggers that are duF
Declaration
public Task ProcessTimeBasedTriggersAsync()
Returns
Type | Description |
---|---|
Task |
TriggerProcessStepAsync(Guid, string)
Manually triggers execution of a process step.
Declaration
public Task TriggerProcessStepAsync(Guid stepId, string triggerReason)
Parameters
Type | Name | Description |
---|---|---|
Guid | stepId | The unique identifier of the process step to trigger. |
string | triggerReason | The reason for triggering the process step. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
UpdateEventStatusAsync()
Updates the status of events based on current conditions and time.
Declaration
public Task UpdateEventStatusAsync()
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
UpdateProcessStepAsync(UpdateProcessStepDto)
Updates an existing process step.
Declaration
public Task UpdateProcessStepAsync(UpdateProcessStepDto dto)
Parameters
Type | Name | Description |
---|---|---|
UpdateProcessStepDto | dto | The process step update data transfer object. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |