public async Task <IActionResult> GetStatus(
            [FromQuery] StockOverviewResouceParameter resourceParameter
            )
        {
            if (resourceParameter == null)
            {
                return(BadRequest());
            }

            var inventoryStatus = await _logisticsLibRepo
                                  .GetStockStatus(resourceParameter.Start, resourceParameter.End)
                                  .ConfigureAwait(false);

            return(Ok(inventoryStatus));
        }
        public IActionResult GetStockOverview(
            [FromQuery] StockOverviewResouceParameter resourceParameter
            )
        {
            if (resourceParameter == null)
            {
                return(BadRequest());
            }

            var stockOverviewFromRepo = _logisticsLibRepo.GetStockOverview(resourceParameter.Date);
            var targets = _logisticsLibRepo.GetProgramTargets();

            var result = new { targets, data = stockOverviewFromRepo };

            return(Ok(result));
        }
        public IActionResult GetStockOverviewBySloc(
            [FromQuery] StockOverviewResouceParameter resourceParameter
            )
        {
            if (resourceParameter == null)
            {
                return(BadRequest());
            }

            var stockOverviewBySlocFromRepo = _logisticsLibRepo
                                              .GetStockOverviewBySloc(resourceParameter.Date)
                                              .OrderBy(x => x.SlocOrder);

            var categories = stockOverviewBySlocFromRepo
                             .Select(
                x =>
                new
            {
                x.SlocOrder,
                x.SlocName,
                x.Sloc,
                category = $"{x.SlocName} ({x.Sloc})"
            }
                )
                             .OrderBy(x => x.SlocOrder)
                             .Distinct();

            var series = stockOverviewBySlocFromRepo.Select(x => x.Program).Distinct();

            var resourceToReturn = new
            {
                resourceParameter.Date,
                categories,
                data = stockOverviewBySlocFromRepo
            };

            return(Ok(resourceToReturn));
        }