Example #1
0
        public async Task <IActionResult> Get([FromRoute] Guid organizationId, [FromQuery] TimeMatrixFilters filters)
        {
            var result = await _matrixService
                         .GetComposedOutput(_am, filters);

            return(Ok(result));
        }
Example #2
0
        public async Task <MarketerChartOutput> GetProviderChartData(IOrganizationMarketer marketer, TimeMatrixFilters filters, ChartParams chartParams)
        {
            var result = await _matrixService.GetComposedOutput(marketer, filters);

            var co = result.Matrix.ToCoData <MarketerTimeMatrixOutput, MarketerOrganizationContractorOutput, MarketerChartDataItem>(result.Contractors).
                     FillMissingDays(chartParams.DateBreakdown, filters).
                     TopLevelGrouping(chartParams.DateBreakdown).
                     SecondLevelGrouping(chartParams.DateBreakdown);

            return(new MarketerChartOutput
            {
                Co = co,
                CurrentBreakdown = "co",
                CurrentDateRange = chartParams.DateBreakdown == DateBreakdown.ByMonth ? "m0" : "w0",
                DateRanges = GetDateRange(chartParams.DateBreakdown, co),
                Breakdowns = new Dictionary <string, string> {
                    { "co", "By Contractor" }
                }
            });
        }