private Task NotifyFailedRegistration(
            RegistrationStatus status,
            RegisterAutoCommand command)
        {
            if (!status.IsSuccess)
            {
                var failedEvent = new RegistrationFailedEvent(
                    status.ReferenceNumber,
                    command.Make, command.Model,
                    command.Year);

                return(_messaging.PublishAsync(failedEvent));
            }
            return(Task.CompletedTask);
        }
예제 #2
0
        public async Task CheckSimilarModel(
            RegistrationFailedEvent failedEvent)
        {
            if (failedEvent.Make == "Yugo")
            {
                // Exception used to show resulting log:
                throw new InvalidOperationException(
                          "Registration Failed.");
            }

            var models = await _adapter.GetValidModelsAsync(failedEvent.Year);

            var makeModels = models.Where(m => m.Make == failedEvent.Make)
                             .ToArray();

            // React to domain-event by calling repositories,
            // services and domain-entities.
            _logger.LogDebug(makeModels.ToIndentedJson());
        }
 public void UnlockScreenOnFail(RegistrationFailedEvent e, Node any, SingleNode <RegistrationScreenComponent> screen)
 {
     screen.component.LockScreen(false);
 }