use of io.spine.server.command.Assign in project core-java by SpineEventEngine.
the class AmishAggregate method handle.
@Assign
List<Message> handle(AggCancelProject cmd, CommandContext ctx) {
final AggProjectPaused firstPaused = projectPaused(cmd.getProjectId());
final AggProjectCancelled thenCancelled = projectCancelled(cmd.getProjectId());
return Lists.<Message>newArrayList(firstPaused, thenCancelled);
}
use of io.spine.server.command.Assign in project core-java by SpineEventEngine.
the class TaskAggregate method handle.
@Assign
AggTaskAssigned handle(AggAssignTask command) {
final AggTaskId id = command.getTaskId();
final UserId newAssignee = command.getAssignee();
final UserId previousAssignee = getState().getAssignee();
final AggTaskAssigned event = taskAssigned(id, previousAssignee, newAssignee);
return event;
}
use of io.spine.server.command.Assign in project core-java by SpineEventEngine.
the class TestAggregate method handle.
@Assign
AggProjectCreated handle(AggCreateProject cmd, CommandContext ctx) {
isCreateProjectCommandHandled = true;
final AggProjectCreated event = projectCreated(cmd.getProjectId(), cmd.getName());
return event;
}
use of io.spine.server.command.Assign in project core-java by SpineEventEngine.
the class TestAggregate method handle.
@Assign
List<AggProjectStarted> handle(AggStartProject cmd, CommandContext ctx) {
isStartProjectCommandHandled = true;
final AggProjectStarted message = projectStarted(cmd.getProjectId());
return newArrayList(message);
}
use of io.spine.server.command.Assign in project core-java by SpineEventEngine.
the class TaskAggregate method handle.
@Assign
AggTaskAssigned handle(AggReassignTask command) throws AggCannotReassignUnassignedTask {
final AggTaskId id = command.getTaskId();
final UserId newAssignee = command.getAssignee();
final UserId previousAssignee = getState().getAssignee();
if (previousAssignee.equals(EMPTY_USER_ID)) {
throw new AggCannotReassignUnassignedTask(id, previousAssignee);
}
final AggTaskAssigned event = taskAssigned(id, previousAssignee, newAssignee);
return event;
}
Aggregations