Ejemplo n.º 1
0
        public List <ReportDetailedResponseDTO> GetDetailedReports(ReportDetailedRequestDTO requestDto)
        {
            var reports  = _planRepository.GetDetailedReports(requestDto.CompanyId, requestDto.FromDate, requestDto.ToDate, requestDto.Shift, requestDto.Delivered);
            var response = new List <ReportDetailedResponseDTO>();

            foreach (var report in reports)
            {
                response.Add(new ReportDetailedResponseDTO
                {
                    Date        = report.Date,
                    MealName    = report.MealName,
                    Shift       = PlanHelper.GetShiftName(report.Shift),
                    IsDelivered = report.IsDelivered
                });
            }

            return(response);
        }
Ejemplo n.º 2
0
        public List <ReportResponseDTO> GetReports(ReportRequestDTO requestDto)
        {
            var reports  = _planRepository.GetReports(requestDto.CompanyId, requestDto.FromDate, requestDto.ToDate);
            var response = new List <ReportResponseDTO>();

            foreach (var report in reports)
            {
                response.Add(new ReportResponseDTO
                {
                    Date        = report.Date,
                    MealName    = report.MealName,
                    Shift       = PlanHelper.GetShiftName(report.Shift),
                    TotalOrders = report.TotalOrders
                });
            }

            return(response);
        }
Ejemplo n.º 3
0
        public List <OrderFilteredResponseDTO> GetFiltered(OrderFilteredRequestDTO request)
        {
            var orders   = _orderRepository.GetFiltered(request.EmployeeIds, request.FromDate, request.ToDate);
            var response = new List <OrderFilteredResponseDTO>();

            foreach (var item in orders)
            {
                response.Add(new OrderFilteredResponseDTO
                {
                    Employee    = item.Employee.User.UserName,
                    Date        = item.Plan.Date,
                    Meal        = item.Plan.Meal.Name,
                    OrderId     = item.Id,
                    Shift       = PlanHelper.GetShiftName(item.Shift),
                    IsDelivered = item.IsDelivered
                });
            }

            return(response);
        }