Exemplo n.º 1
0
        private async Task <PromoOfferBasicInformation> GetPromoOffer()
        {
            var promo = await _promoBusiness.GetPromoOfferForUser();

            if (promo == null)
            {
                return(null);
            }
            return(new PromoOfferBasicInformation
            {
                PromoText = promo.Text,
                Amount = promo.Amount
            });
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> GetOrderHomePageInformation()
        {
            var zones = await _locationService.GetAvailableActiveZones();

            if (zones == null)
            {
                return(Ok(new ResponseModel <string>(ResponseStatus.NotFound, null, "No zone available.")));
            }
            var promoOffer = await _promoOfferBusiness.GetPromoOfferForUser();

            var promo = promoOffer == null ? null : new PromoOfferResponse
            {
                PromoText = promoOffer.Text,
                Amount    = promoOffer.Amount
            };
            var response = new OrderHomePageResponse
            {
                Zones = zones,
                Promo = promo
            };

            return(Ok(new ResponseModel <OrderHomePageResponse>(ResponseStatus.Ok, response, "")));
        }