Example #1
0
            public async Task <Unit> Handle(AcceptMontlyAggregatefForCarCommand request, CancellationToken cancellationToken)
            {
                var limit = await monthlyAggregateLimitsStore.GetLimitForCar(request.FleetId, request.CarId, cancellationToken);

                await monthlyAggregatesStore.AcceptMonthlyAggregate(request.FleetId, request.CarId, request.AggregateId, limit, cancellationToken);

                var @event = mapper.Map <MonthlyAggregateAcceptedEvent>(await monthlyAggregatesStore.GetMonthlyAggregateById(request.AggregateId, cancellationToken));
                await mediator.Publish(@event, cancellationToken : cancellationToken);

                return(Unit.Value);
            }