Project

General

Profile

Bug #2527

Implement New Summary API Endpoint for Station-wise Performance Report

Added by Prashant Jain about 2 months ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Start date:
04/27/2026
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

Develop a new backend summary endpoint to provide aggregated station-wise performance data for reporting and dashboard purposes in EVVMS.

This endpoint should return summarized metrics per station within a selected date range, enabling business users to monitor station performance and revenue efficiently.

Objectives

Create a scalable API that provides:

Station-wise total sessions
Total energy consumed (kWh)
Total revenue
Average revenue per session
Optional comparison with previous period
API Requirements

Endpoint Example:
GET /api/reports/station-summary

Query Parameters
startDate
endDate
tenantId
stationId (optional)
groupBy (daily / weekly / monthly)
Response Structure {
"success": true,
"data": [ {
"stationId": 101,
"stationName": "Jaipur EV Hub",
"totalSessions": 120,
"totalEnergyKwh": 1800,
"totalRevenue": 36000,
"avgRevenuePerSession": 300
}
]
}

#1

Updated by Shreya Agarwal about 2 months ago

  • Assignee changed from Shubham Sharma to Shreya Agarwal
#2

Updated by Shreya Agarwal about 2 months ago

Station Comparison Summary API for station-wise performance reporting.
Implemented aggregation logic for total sessions, energy consumed, revenue, and average revenue per session.
Added date-based filters (this month, last month, week, custom range) and integrated tenant-based schema handling.
Identified issue in revenue calculation (final amount not populated for all records)
Currently facing issue with data not reflecting for current month in API response despite data availability in DB; further debugging will continue..

#3

Updated by Shreya Agarwal about 1 month ago

Worked on refining the Station Comparison Summary API as per latest requirements.
Fixed date filtering using IST to UTC conversion to ensure accurate data retrieval.
Validated and corrected revenue calculation using actual logic (energy × rate/markup).
Tested API with different filters like this month and last month for correctness.

#4

Updated by Shreya Agarwal about 1 month ago

Today I worked on improving the Station Comparison API by fixing the SQL logic for the summary data and integrating the initial structure for energy calculations. I implemented a combined query approach for station-level summary and attempted to include bucket-level breakdown within the same flow. During testing, I identified duplication issues caused by grouping on rate values, which led to multiple rows per station. I analyzed the root cause and corrected the grouping logic to ensure clean station-wise aggregation. The API is now returning accurate current and previous period data without duplication in the summary section. Bucket-level optimization is pending and will be refined tomorrow for proper rate-wise segregation and performance improvement.

#5

Updated by Shreya Agarwal about 1 month ago

Today I worked on testing the Station Setup APIs via Swagger. Verified initialization and setup retrieval APIs . Tested step update and master APIs. Identified multiple issues during testing, including duplicate key constraint errors and incorrect insert/update logic. Some APIS not working properly. Additionally , Worked on station comparison summary and energy bucket implementation. Fixed revenue calculation using correct formula (energy × rate) as per requirement. Removed dependency on final amount and aligned logic with expected calculation. Corrected SQL query issues (COALESCE placement, syntax errors, date filters). Ensured Swagger response matches database values accurately. Validated bucket-wise data (rate, energy, revenue, session count) with DB. Current API is stable and producing correct results; ready for further enhancements if needed.

#6

Updated by Shreya Agarwal about 1 month ago

Worked on station-comparison summary API and improved overall logic. Validated API response with database to ensure accurate results .Reviewed energy rate & OCPI logic across related APIs and made necessary adjustments. Reviewed multiple APIs to verify implementation of energy rate and OCPI logic as instructed.. Cross-checked calculation patterns used in revenue and energy computations across services. Additionally, try to understand the heartbeat data service to understand how machine connection status is tracked . and Analyzed machine online status flow in the project to understand how updates are handled.

Also available in: Atom PDF