public Task <ApiResponse> Delete(string eventId, string clientId, string orderId, string id)
 {
     return(Respond.AsyncWith(async(response, fail) =>
     {
         await _ticketsService.RemoveTicketAsync(eventId, clientId, orderId, id);
     }));
 }
Ejemplo n.º 2
0
 public Task <ApiResponse> Pay()
 {
     return(Respond.AsyncWith(async(response, fail) =>
     {
         await _service.PayOrdersAsync();
     }));
 }
 public Task <ApiResponse> Deliver()
 {
     return(Respond.AsyncWith(async(response, fail) =>
     {
         await _service.DeliverOrderAsync();
     }));
 }
Ejemplo n.º 4
0
 public Task <ApiResponse <IList <PaymentTypeDto> > > Get()
 {
     return(Respond
            .AsyncWith <IList <PaymentTypeDto> >(async(response, fail) =>
     {
         response.Result = await _payments.GetPaymentTypes();
     }));
 }
 public Task <ApiResponse <TicketOrderDto> > Post(string eventId, string clientId, string orderId, [FromBody] SeatPriceOptionDto option)
 {
     return(Respond
            .AsyncWith <TicketOrderDto>(async(response, fail) =>
     {
         response.Result = await _ticketsService.ReserveTicketAsync(eventId, clientId, orderId, option);
     }));
 }
Ejemplo n.º 6
0
 public Task <ApiResponse> Delete(string eventId, string clientId, string orderId, string seatId, string reseravationId)
 {
     return(Respond
            .AsyncWith(async(response, fail) =>
     {
         await _reservationsService.DiscardReservationAsync(eventId, clientId, orderId, seatId, reseravationId);
     }));
 }
 public Task <ApiResponse <UserClientDto> > Post(string identityId, [FromBody] UserDto user)
 {
     return(Respond
            .AsyncWith <UserClientDto>(async(response, fail) =>
     {
         response.Result = await _clientCrud.CreateUserClientAsync(user);
     }));
 }
 public Task <ApiResponse <ClientOrderDto> > Post(string clientId)
 {
     return(Respond
            .AsyncWith <ClientOrderDto>(async(response, fail) =>
     {
         response.Result = await _ordersService.CreateOrderForClientAsync(clientId);
     }));
 }
 public Task <ApiResponse> Post(string clientId, string orderId, [FromBody] string optionId)
 {
     return(Respond
            .AsyncWith(async(response, fail) =>
     {
         await _deliveriesService.SelectDeliveryAsync(clientId, orderId, optionId);
     }));
 }
Ejemplo n.º 10
0
 public Task <ApiResponse <EventListItemDto> > Get(int id)
 {
     return(Respond
            .AsyncWith <EventListItemDto>(async(response, fail) =>
     {
         response.Result = await _listProvider.GetEventAsync(id);
     }));
 }
 public Task <ApiResponse <IList <PriceZoneListItemDto> > > Get(int eventId)
 {
     return(Respond
            .AsyncWith <IList <PriceZoneListItemDto> >(async(response, fail) =>
     {
         response.Result = await _eventDefinitionsClient.EventDefinitionsClient.ApiEventsPricezonesGetAsync(eventId);
     }));
 }
Ejemplo n.º 12
0
 public Task <ApiResponse <IEnumerable <PaymentTypeDto> > > Get()
 {
     return(Respond
            .AsyncWith <IEnumerable <PaymentTypeDto> >(async(response, fail) =>
     {
         response.Result = await _provider.GetPaymentTypesAsync();
     }));
 }
Ejemplo n.º 13
0
 public Task <ApiResponse> Delete(int eventId, int clientId, int orderId, int id)
 {
     return(Respond
            .AsyncWith(async(response, fail) =>
     {
         await _reservationService.DiscardReservationAsync(eventId, clientId, orderId, id);
     }));
 }
Ejemplo n.º 14
0
 public Task <ApiResponse <IList <DeliveryTypeDto> > > Get()
 {
     return(Respond
            .AsyncWith <IList <DeliveryTypeDto> >(async(response, fail) =>
     {
         response.Result = await _provider.GetDeliveryTypesAsync();
     }));
 }
Ejemplo n.º 15
0
 public Task <ApiResponse <IList <PriceZoneListItemDto> > > Get(int eventId)
 {
     return(Respond
            .AsyncWith <IList <PriceZoneListItemDto> >(async(response, fail) =>
     {
         response.Result = await _priceZones.GetEventPriceZonesAsync(eventId);
     }));
 }
Ejemplo n.º 16
0
 public Task <ApiResponse <SeatReservationDto> > Post(int eventId, int clientId, int orderId, [FromBody] int sceneSeatId)
 {
     return(Respond
            .AsyncWith <SeatReservationDto>(async(response, fail) =>
     {
         response.Result = await _reservationService.ReserveSeatAsync(eventId, clientId, orderId, sceneSeatId);
     }));
 }
Ejemplo n.º 17
0
 public Task <ApiResponse> Post(int clientId, int orderId, [FromBody] int optionId)
 {
     return(Respond
            .AsyncWith(async(response, fail) =>
     {
         await _paymentService.SelectPaymentAsync(clientId, orderId, optionId);
     }));
 }
 public Task <ApiResponse> Commit(string clientId, string id)
 {
     return(Respond
            .AsyncWith(async(response, fail) =>
     {
         await _ordersService.CommitOrderAsync(clientId, id);
     }));
 }
Ejemplo n.º 19
0
 public Task <ApiResponse <EventListItemDto> > Get(int id)
 {
     return(Respond
            .AsyncWith <EventListItemDto>(async(response, fail) =>
     {
         response.Result = await _eventDefinitionsClient.EventDefinitionsClient.ApiEventsGetAsync(id);
     }));
 }
Ejemplo n.º 20
0
        public Task <ApiResponse> Deliver()
        {
            return(Respond.AsyncWith(async(response, fail) =>
            {
                var result = await _service.GetWaitingDeliveriesAsync();
                var awaiting = result.FirstOrDefault();

                if (awaiting != null)
                {
                    await _service.RegisterDeliverySuccessAsync(awaiting);
                }
            }));
        }
Ejemplo n.º 21
0
        public Task <ApiResponse> Pay()
        {
            return(Respond.AsyncWith(async(response, fail) =>
            {
                var unpaidPayments = await _paymentService.GetWaitingPaymentsAsync();
                if (unpaidPayments.Any())
                {
                    var payment = unpaidPayments.First();

                    await _paymentService.RegisterPaymentSuccessAsync(payment);
                }
            }));
        }