public async Task <string> Overall(OverallReportRequest data)
        {
            var payload = new AggregateOverallReportDataEvent
            {
                Granularity   = data.Granularity,
                TimestampFrom = data.TimestampFrom,
                TimestampTo   = data.TimestampTo,
                Aggregations  = data.Aggregations,
                Subject       = data.Subject,
            };
            var flowId   = HttpContext.Items["flowId"].ToString();
            var response = await eventsAwaiter.AwaitResponse <AggregatedOverallReportEvent>(flowId, () => publishingRouter.Publish(Queues.Transactions, payload, flowId, Queues.APIGateway));

            return(ReportCsvSerializer.SerializerOverallReport(data.Subject, data.TimestampFrom, data.TimestampTo, data.Granularity, response.Portions));
        }
        public async Task <string> Overall(OverallReportRequest data)
        {
            var request = new AggregateOverallRequest
            {
                Granularity   = mapper.Map <Granularity>(data.Granularity),
                TimestampFrom = data.TimestampFrom.ToNullableTimestamp(),
                TimestampTo   = data.TimestampTo.ToNullableTimestamp(),
                Aggregations  = { data.Aggregations.Select(a => mapper.Map <Aggregation>(a)) },
                Subject       = mapper.Map <ReportSubject>(data.Subject),
            };

            var response = await reportsBranchClient.AggregateOverallAsync(request, HttpContext.CreateHeadersWithFlowId());

            return(response.Report);
        }
コード例 #3
0
        public async Task <string> Overall(OverallReportRequest request)
        {
            var flowId      = HttpContext.Items["flowId"].ToString();
            var cqrsRequest = new AggregateOverallRequest
            {
                FlowId        = flowId,
                Granularity   = mapper.Map <Granularity>(request.Granularity),
                TimestampFrom = request.TimestampFrom.ToNullableTimestamp(),
                TimestampTo   = request.TimestampTo.ToNullableTimestamp(),
                Aggregations  = { request.Aggregations.Select(a => mapper.Map <Aggregation>(a)) }
            };
            var data = await reportDataFetcher.GetOverallReportPortions(cqrsRequest, HttpContext.CreateHeadersWithFlowId(), request.Subject);

            var csv = ReportCsvSerializer.SerializerOverallReport(request.Subject,
                                                                  request.TimestampFrom,
                                                                  request.TimestampTo,
                                                                  request.Granularity,
                                                                  data);

            return(csv);
        }