Bug #2791
Root Admin Dashboard API and UI Changes
Added by Piyush Vijay 9 days ago. Updated 1 day ago.
Description
Root Admin Dashboard API and UI Changes
Updated by Shreya Agarwal 9 days ago
I worked on fixing the time range filter issues across all platform dashboard APIs. The main problem was that the backend was not properly handling custom date ranges for filters like "Yesterday", "Last Week", "Last Month", and "Last Year" - it was only working for "Today". I added a new BuildDateFilter method that now properly handles both predefined time filters and custom date ranges. I updated the GetPlatformDashboardMetricsAsync method to use this new filter, and the GetCompanyPerformanceAsync, GetCountryAnalyticsAsync, GetTopPerformingCountriesAsync, and GetCompanyPerformanceWithMetricSortingAsync methods are partially updated. some changes still pending and in progress
Updated by Shreya Agarwal 8 days ago
Today I fixed the time range filter issues across all Platform Dashboard APIs by making changes on both the backend and frontend sides.
On the backend: I updated the validTimeFilters array in all 5 controller methods to accept all time range options (today, yesterday, thisweek, lastweek, thismonth, lastmonth, thisyear, lastyear, alltime, and custom) that the frontend sends.
I also added a new BuildDateFilter method in the repository to properly handle both predefined time filters and custom date ranges, and updated all SQL queries to use this method instead of the older filter methods. The service layer was already correctly passing startDate and endDate parameters, so no changes were needed there.
On the frontend : I updated the vendorApiParams and dashboardTimeParams to include startDate and endDate when timeRange is custom, ensuring the API receives the required parameters to avoid validation errors.
I also updated the dashboardAnalyticsService methods to include startDate and endDate in API requests for all platform dashboard endpoints. The UI already had all 9 time range options (Today, Yesterday, This Week, Last Week, This Month, Last Month, This Year, Last Year, and Custom Range) so no changes were needed there. All 5 Platform Dashboard APIs now work correctly for all time ranges
Updated all API calls including getPlatformDashboard, getCompanyPerformance, getCountryAnalytics, getTopPerformingCountries, getEnergyConsumptionTrend, and getElectricitySales to pass startDate and endDate when timeRange='custom'.
Updated by Shreya Agarwal 7 days ago
worked on both the frontend and backend of the Platform Dashboard to resolve data-related issues. I fixed several APIs where the data was not being returned correctly, while a few remaining APIs are still under working and require further updates. I also analyzed the issues affecting both the frontend and backend to identify the root causes and ensure proper integration. Additionally, I spent time learning React concepts and understanding the project's code structure to improve my implementation and debugging process.
Updated by Yashaditya Singh 7 days ago
Today, I worked on the Super Admin Dashboard UI. I refined the layout and spacing of the Company Performance, Country Analytics, and Electricity Unit Sales widgets by adjusting card heights, grid alignment, padding, typography, and metric row spacing to achieve a consistent and responsive design. I also reviewed and corrected the dashboard layout to ensure proper alignment and visual consistency across all dashboard sections.
Updated by Yashaditya Singh 4 days ago
I enhanced the Platform Dashboard UI by redesigning the Company Details dialog and improving the layout, spacing, and styling of the Company Performance, Country Analytics, and Electricity Unit Sales cards. I also implemented country flag support for the Top Performing Countries widget and investigated the API response, identifying that the flagUrl field is currently empty. Additionally, I tested the implemented changes and resolved related frontend UI issues.
Updated by Shreya Agarwal 4 days ago
worked on fixing the time range filter issues across all platform dashboard APIs. The main issue was that lastmonth, lastyear, and other time ranges were not returning data I fixed the BuildDateFilter method to handle all time ranges including today, yesterday, thisweek, lastweek, thismonth, lastmonth, thisyear, lastyear, and alltime. The GetCompanyPerformanceAsync and GetCompanyPerformanceWithMetricSortingAsync methods were updated to use the new filter logic.
worked on fixing the platform admin dashboard's company performance API issue where companies were not displaying when using the "lastmonth" time filter. The root cause was that the date filter was incorrectly applied to the platform.companies table, which filtered out companies created before the last month. I resolved this by removing the BuildDateFilter from the companies' queries in both GetCompanyPerformanceAsync and GetCompanyPerformanceWithMetricSortingAsync methods. However, the date filter continues to be applied to all tenant data queries. some issue is still pending and in progress .
Updated by Shreya Agarwal 3 days ago
fixed all five platform dashboard APIs (Country Analytics, Top Performing Countries, Electricity Unit Sales, Energy Consumption Trend, and Platform Dashboard Metrics)
fixed the Country Analytics API - removing date filters from static metrics (company count, stations, locations) while implementing the new BuildIstEndTimeFilter for revenue, energy, and session calculations using IST timezone.
Corrected the Top Performing Countries API using the same approach, which now shows accurate revenue (23,717.61) and session counts (52) matching the company performance data.
Fixed the Electricity Unit Sales API by replacing wallet_transactions with charging_sessions.net_amount for revenue calculation and using the new timezone-aware filtering.
Updated the Energy Consumption Trend API with new queries using end_time IST filtering and proper date range handling for time filters like lastmonth, thisweek, etc.
Removed all unnecessary wallet_transactions table checks across APIs since revenue now comes directly from charging_sessions.
Current Status: All five platform dashboard APIs are now aligned with the same data logic, ensuring consistent IST timezone handling and accurate revenue calculation. The data matches across Company Performance, Country Analytics, and Top Performing Countries endpoints.
Updated by Yashaditya Singh 3 days ago
I worked on enhancing the Master Data modules by updating the filtering functionality in the Connector Type Management page to match the behavior implemented in other modules. I modified the search and filter logic so that API calls are triggered only when the Apply button is clicked instead of on every filter change, added applied filter state management, updated the reset functionality, and ensured consistent filtering behavior across the application. I also tested the changes to verify that search, status, power type, and region filters work correctly with the new Apply/Reset flow.
Updated by Yashaditya Singh 1 day ago
I worked on the Electricity Unit Sales widget in the dashboard. I investigated and fixed the issue where the API was returning the correct data for different time ranges, but the UI was still displaying zero values. I updated the time range mapping logic to correctly bind the daily, weekly, and monthly data based on the selected filter, validated the API responses against the UI, and tested the widget to ensure the displayed metrics now match the selected time range.