Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
dstenroejl committed Nov 20, 2024
1 parent da9b154 commit 22336f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ internal class NotifyAggregatedMeasureDataHandler(
private readonly IStartOrchestrationInstanceCommands _manager = manager;

public async Task<OrchestrationInstanceId> ScheduleNewCalculationAsync(
ScheduleOrchestrationInstanceCommand<NotifyAggregatedMeasureDataInputV1> dto)
ScheduleOrchestrationInstanceCommand<NotifyAggregatedMeasureDataInputV1> command)
{
// TODO:
// Server-side validation => Validate "period" is midnight values when given "timezone" etc.
// See class Calculation and method IsValid in Wholesale.

// Here we show how its possible, based on input, to decide certain steps should be skipped by the orchestration.
IReadOnlyCollection<int> skipStepsBySequence = dto.InputParameter.IsInternalCalculation
IReadOnlyCollection<int> skipStepsBySequence = command.InputParameter.IsInternalCalculation
? [NotifyAggregatedMeasureDataOrchestrationV1.EnqueueMessagesStepSequence]
: [];

var orchestrationInstanceId = await _manager
.ScheduleNewOrchestrationInstanceAsync(
identity: new UserIdentity(new UserId(dto.UserIdentity.UserId), new ActorId(dto.UserIdentity.ActorId)),
identity: new UserIdentity(new UserId(command.UserIdentity.UserId), new ActorId(command.UserIdentity.ActorId)),
name: "BRS_023_027",
version: 1,
inputParameter: dto.InputParameter,
runAt: dto.RunAt.ToInstant(),
inputParameter: command.InputParameter,
runAt: command.RunAt.ToInstant(),
skipStepsBySequence: skipStepsBySequence)
.ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public async Task<IActionResult> Run(
Route = "processmanager/orchestrationinstance/brs_023_027/1")]
HttpRequest httpRequest,
[FromBody]
ScheduleOrchestrationInstanceCommand<NotifyAggregatedMeasureDataInputV1> dto,
ScheduleOrchestrationInstanceCommand<NotifyAggregatedMeasureDataInputV1> command,
FunctionContext executionContext)
{
var orchestrationInstanceId = await _handler.ScheduleNewCalculationAsync(dto).ConfigureAwait(false);
var orchestrationInstanceId = await _handler.ScheduleNewCalculationAsync(command).ConfigureAwait(false);
return new OkObjectResult(orchestrationInstanceId.Value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public async Task<IActionResult> Run(
Route = "processmanager/orchestrationinstance/cancel")]
HttpRequest httpRequest,
[FromBody]
CancelScheduledOrchestrationInstanceCommand dto,
CancelScheduledOrchestrationInstanceCommand command,
FunctionContext executionContext)
{
await _command
.CancelScheduledOrchestrationInstanceAsync(
new UserIdentity(new UserId(dto.UserIdentity.UserId), new ActorId(dto.UserIdentity.ActorId)),
new OrchestrationInstanceId(dto.Id))
new UserIdentity(new UserId(command.UserIdentity.UserId), new ActorId(command.UserIdentity.ActorId)),
new OrchestrationInstanceId(command.Id))
.ConfigureAwait(false);

return new OkResult();
Expand Down

0 comments on commit 22336f5

Please sign in to comment.