public async Task <GetAwaitingOrdersQuery.Response> Handle(GetAwaitingOrdersQuery query)
        {
            var response = await _domainActorSystem.Query <RespondAwaitingOrders>(new GetAwaitingOrders());

            return(new GetAwaitingOrdersQuery.Response
            {
                Orders = response.Orders.Select(x => new GetAwaitingOrdersQuery.Order
                {
                    Id = x.Id
                }).ToList()
            });
        }
Ejemplo n.º 2
0
        public async Task <GetAllEventSeatReservationsQuery.Response> Handle(GetAllEventSeatReservationsQuery query)
        {
            var response = await _domainActorSystem.Query <RespondAllEventSeatReservations>(new GetAllEventSeatReservations(query.EventId));

            return(new GetAllEventSeatReservationsQuery.Response
            {
                Reservations = response.Reservations.Select(x => new GetAllEventSeatReservationsQuery.SeatReservation
                {
                    Id = x.Id,
                    SceneSeatId = x.SceneSeatId
                }).ToList()
            });
        }
        public async Task <GetSelectedPaymentQuery.Response> Handle(GetSelectedPaymentQuery query)
        {
            var response = await _domainActorSystem.Query <RespondSelectedPayment>(new GetSelectedPayment(query.ClientId, query.OrderId));

            var value = response == null ? null : new GetSelectedPaymentQuery.PaymentDto
            {
                OrderId   = response.Id,
                PaymentId = response.PaymentId
            };

            return(new GetSelectedPaymentQuery.Response
            {
                Value = value
            });
        }
        public async Task <GetClientOrdersByStateQuery.Response> Handle(GetClientOrdersByStateQuery query)
        {
            OrderStateReadModel stateReadModel;

            switch (query.State)
            {
            case GetClientOrdersByStateQuery.OrderState.Active:
                stateReadModel = OrderStateReadModel.Active;
                break;

            case GetClientOrdersByStateQuery.OrderState.Expired:
                stateReadModel = OrderStateReadModel.Expired;
                break;

            case GetClientOrdersByStateQuery.OrderState.Commited:
                stateReadModel = OrderStateReadModel.Commited;
                break;

            case GetClientOrdersByStateQuery.OrderState.Finalized:
                stateReadModel = OrderStateReadModel.Finalized;
                break;

            case GetClientOrdersByStateQuery.OrderState.Canceled:
                stateReadModel = OrderStateReadModel.Canceled;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            var response = await _domainActorSystem.Query <RespondCustomerOrdersByState>(new GetCustomerOrdersByState(stateReadModel, query.ClientId));

            return(new GetClientOrdersByStateQuery.Response
            {
                ClientOrders = response.Orders.Select(x => new GetClientOrdersByStateQuery.ClientOrder
                {
                    Id = x.Id,
                    ClientId = x.ClientId,
                    CreateDateTime = x.CreateDateTime,
                    ExpirationTimeout = x.ExpirationTimeout,
                    UpdateDateTime = x.UpdateDateTime,
                }).ToList()
            });
        }
Ejemplo n.º 5
0
        public async Task <GetClientTicketsForEventQuery.Response> Handle(GetClientTicketsForEventQuery query)
        {
            var response = await _domainActorSystem.Query <RespondCustomerTicketsForEvent>(new GetCustomerTicketsForEvent(query.ClientId, query.OrderId, query.EventId));

            return(new GetClientTicketsForEventQuery.Response
            {
                Tickets = response.Tickets.Select(x => new GetClientTicketsForEventQuery.ClientTicketsForOrder
                {
                    Id = x.Id,
                    OrderId = x.OrderId,
                    ClientId = x.ClientId,
                    EventId = x.EventId,
                    PriceOptionId = x.PriceOptionId,
                    SceneSeatIds = x.SceneSeatIds.ToList(),
                    GrossAmount = x.GrossAmount,
                    PriceOptionName = x.PriceOptionName,
                    PriceZoneName = x.PriceZoneName
                }).ToList()
            });
        }