public async Task <IHttpActionResult> EinsichtsgesucheEntscheidGesuchHinterlegen([FromBody] EntscheidGesuchHinterlegenParams p) { var access = ManagementControllerHelper.GetUserAccess(); if (!access.HasFeature(ApplicationFeature.AuftragsuebersichtEinsichtsgesucheKannEntscheidGesuchHinterlegen)) { return(StatusCode(HttpStatusCode.Forbidden)); } await orderManagerClient.EntscheidGesuchHinterlegen(ControllerHelper.GetCurrentUserId(), p.OrderItemIds, p.Entscheid, p.DatumEntscheid, p.InterneBemerkung); return(Content <object>(HttpStatusCode.NoContent, null)); }
public async Task Consume(ConsumeContext <EntscheidGesuchHinterlegenRequest> context) { using (LogContext.PushProperty(nameof(context.ConversationId), context.ConversationId)) { Log.Information("Received {CommandName} command with conversationId {ConversationId} from the bus", context.Message.GetType().Name, context.ConversationId); foreach (var id in context.Message.OrderItemIds) { var item = await orderDataAccess.GetOrderItem(id); if (item == null) { throw new Exception("Invalid OrderItem: " + id); } } await manager.EntscheidGesuchHinterlegen(context.Message.UserId, context.Message.OrderItemIds, context.Message.Entscheid, context.Message.DatumEntscheid, context.Message.InterneBemerkung); await context.RespondAsync(new EntscheidGesuchHinterlegenResponse()); } }