Example #1
0
        private async Task RejectAsync(IRejectedEvent @event)
        {
            await _operationService.RejectAsync(@event.RequestId);

            await _bus.PublishAsync(new OperationUpdated(@event.RequestId,
                                                         @event.UserId, States.Rejected, DateTime.UtcNow, @event.Reason));
        }
Example #2
0
        private async Task RejectAsync(IRejectedEvent @event)
        {
            Logger.Debug($"Reject operation after receiving {@event.GetType().Name} event");
            await _operationService.RejectAsync(@event.RequestId, @event.Code, @event.Reason);

            await _bus.PublishAsync(new OperationUpdated(@event.RequestId, @event.UserId,
                                                         @event.GetType().Name.Humanize(LetterCasing.LowerCase).Underscore(),
                                                         States.Rejected, @event.Code, @event.Reason, DateTime.UtcNow));
        }
Example #3
0
        private async Task PublishRejectedEventAndLog(CorrelationContext context, string messageName, ISpan span, IRejectedEvent rejectedEvent)
        {
            await _busClient.PublishAsync(rejectedEvent, ctx => ctx.UseMessageContext(context));

            _logger.LogInformation($"Published rejected event: '{rejectedEvent.GetType().Name}' for message: '{messageName}' " +
                                   $"with correlationId: '{context.Id}'");

            span.SetTag("error-type", "domain");
        }