public async Task Consume(ConsumeContext <EntscheidFreigabeHinterlegenRequest> 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.EntscheidFreigabeHinterlegen(
                    context.Message.UserId,
                    context.Message.OrderItemIds,
                    context.Message.Entscheid,
                    context.Message.DatumBewilligung,
                    context.Message.InterneBemerkung);

                await context.RespondAsync(new EntscheidFreigabeHinterlegenResponse());
            }
        }
        public async Task <IHttpActionResult> AuftraegeEntscheidFreigabeHinterlegen([FromBody] EntscheidFreigabeHinterlegenParams p)
        {
            var access = ManagementControllerHelper.GetUserAccess();

            if (!access.HasFeature(ApplicationFeature.AuftragsuebersichtAuftraegeKannEntscheidFreigabeHinterlegen))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            await orderManagerClient.EntscheidFreigabeHinterlegen(ControllerHelper.GetCurrentUserId(), p.OrderItemIds, p.Entscheid,
                                                                  p.DatumBewilligung, p.InterneBemerkung);

            return(Content <object>(HttpStatusCode.NoContent, null));
        }