Exemplo n.º 1
0
        public DataResponse GetAllOrdersSummary(PosPageRequest posRequest)
        {
            var allOrders = _blackstonePosService.GetAllValidOrders(posRequest.MerchantId, posRequest.StartDate, posRequest.EndDate).ToList();

            var result = GetOrdersSummary(allOrders);

            var status = result != null ? 200 : 201;

            var message = result != null ? string.Empty : "Orders could not be retrieved.";

            return new DataResponse
            {
                Data = result,
                Status = status,
                ErrorMessage = message
            };
        }
Exemplo n.º 2
0
        public DataResponse GetAllOrdersToExport(PosPageRequest posRequest)
        {
            var allOrders = _blackstonePosService.GetAllValidOrders(posRequest.MerchantId, posRequest.StartDate, posRequest.EndDate).ToList();

            var ordersResult = allOrders.UIMapTo<List<Order>, List<OrderViewModel>>();

            var ordersTotalsLine = GetOrderTotalsLine(allOrders);

            ordersResult.Add(ordersTotalsLine);

            var status = ordersResult != null ? 200 : 201;

            var message = ordersResult != null ? string.Empty : "Orders could not be retrieved.";

            return new DataResponse
            {
                Data = ordersResult,
                Status = status,
                ErrorMessage = message
            };
        }
Exemplo n.º 3
0
        public DataResponse GetAllOrders(PosPageRequest posRequest)
        {
            var allOrders = _blackstonePosService.GetAllValidOrders(posRequest.MerchantId, posRequest.StartDate, posRequest.EndDate).ToList();

            allOrders.ForEach(order =>
            {
                order.PhoneNumber = order.PhoneNumber.MaskPhoneNumber();
            });

            var status = allOrders != null ? 200 : 201;

            var message = allOrders != null ? string.Empty : "Orders could not be retrieved.";

            var data = allOrders;

            return new DataResponse
            {
                Data = data,
                Status = status,
                ErrorMessage = message
            };
        }