Project

General

Profile

Bug #2787

Add Station Live Toggle in Station Configuration

Added by Piyush Vijay 10 days ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Start date:
06/30/2026
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

Description:
Introduce a new "Station Live" toggle at the Station level to indicate whether a station is live and operational. This toggle will be used to identify stations that are still under site development or not yet ready for production.

Requirements:

Add a boolean toggle in the Station configuration:
Station Live: Yes / No
Default value should be No (False) for newly created stations.
Behavior:
Station Live = Yes
The station is considered live and available for normal operations.
Station Live = No
The station is considered under site development and should be treated as a non-live station.
Display an "Under Development" or "Coming Soon" indicator wherever applicable.
Any business logic that requires a live station should respect this flag.
Store the value in the database.
Expose the field in:
Station Create API
Station Update API
Station Details API
Station Listing API
Only authorized users (Admin/Manager as per permission matrix) can modify this toggle.

Acceptance Criteria:

A new "Station Live" toggle is available in the Station configuration.
Default value is No (False) for new stations.
When enabled, the station is treated as a live station.
When disabled, the station is treated as under development.
The toggle value is persisted in the database and returned by all relevant APIs.
Appropriate UI indicators are shown based on the station's live status.
Existing functionality remains unaffected for live stations.

#1

Updated by Piyush Vijay 10 days ago

  • Assignee set to Shreya Agarwal
#2

Updated by Shreya Agarwal 10 days ago

Today I implemented the live status toggle feature for charging stations. The implementation includes:
UI Enhancement: Added a new "Live" column in the charging stations table with a color-coded toggle switch (green for Live, orange for Under Construction), providing visual clarity for station status.
Confirmation Dialog: Implemented a confirmation dialog that appears when users click the toggle, preventing accidental status changes. The dialog displays station details and requires explicit user confirmation before applying the change.
API Integration: Bound the toggle to the backend endpoint PATCH /api/v1/station/charging-station/{id}/live for updating the live status. Added proper error handling, loading states, and success notifications.
UI Refinement: As per requirement, the Cancel button is now highlighted as the primary action with a contained style, while the Submit button appears as a secondary outlined button, making it safer for users to cancel accidental toggles.
The feature is now fully functional with a smooth user experience. When a user toggles the switch, a confirmation dialog appears showing the station name and code. Upon confirmation, the API updates the status, the table refreshes, and a success toast notification confirms the change.

#3

Updated by Shreya Agarwal 7 days ago

implemented the live status toggle feature for charging stations, moving the toggle from the table view to the Expenses tab as per requirements. The implementation includes:
UI Enhancement: Removed the "Live" column from the charging stations table and integrated the toggle switch directly into the Expenses tab header, positioned on the right side of the Expenses title. The toggle uses a color-coded switch with a clean minimalist design showing only the toggle button without extra labels.
Confirmation Dialog: Implemented a confirmation dialog that appears when users click the toggle, preventing accidental status changes. The dialog displays station details and requires explicit user confirmation before applying the change. The Cancel button is highlighted as the primary action while the Submit button appears as a secondary outlined button for safer user interaction.
Expense List Logic: The toggle now controls whether a station appears in the expense list. When toggled ON (Live/Show), the station is included in expense reports and financial dashboards. When toggled OFF (Under Construction/Hide), the station is excluded from expense reports while all data is preserved.
API Integration: Bound the toggle to the backend endpoint PATCH /api/v1/station/charging-station/{id}/live for updating the live status. Added proper error handling, loading states, and success notifications with expense-specific messages.
UI Refinement: The toggle is now only visible inside the Expenses tab when editing a station, keeping the table view clean

Also available in: Atom PDF