]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor: enforce utility usage and centralize constants across all components
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 3 Apr 2026 20:56:28 +0000 (22:56 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 3 Apr 2026 20:56:28 +0000 (22:56 +0200)
commit5d68d55e6b18849f73e40bb25def43631ac7631c
treeda849e0ccb3a502a277f93024bd7061cb242d6de
parentcd63f57ee11cdc6ffb32a8672c536fb9ae4f8509
refactor: enforce utility usage and centralize constants across all components

- Replace .length/.size checks with isEmpty/isNotEmptyArray in 7 src/ files
- Replace Number.parseInt/parseFloat with convertToInt in OCPPServiceUtils
  (intentional fail-fast: malformed templates now throw instead of silent NaN)
- Keep Number.parseFloat in getLimitFromSampledValueTemplateCustomValue
  (NaN fallback contract requires it)
- Centralize route names (ROUTE_NAMES), placeholder (EMPTY_VALUE_PLACEHOLDER),
  and localStorage key in Vue UI (11 files)
- Extract 13 magic values to constants in Python ocpp-server
- Rename constants: WORKER_SET_VERSION, DEFAULT_RATE_WINDOW_MS, MS_PER_HOUR,
  DEFAULT_*_SECONDS in Python, DEFAULT_*_BYTES in UIServerSecurity
30 files changed:
src/charging-station/AutomaticTransactionGenerator.ts
src/charging-station/ChargingStation.ts
src/charging-station/Helpers.ts
src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts
src/charging-station/ocpp/OCPPServiceUtils.ts
src/charging-station/ocpp/auth/cache/InMemoryAuthCache.ts
src/charging-station/ui-server/AbstractUIServer.ts
src/charging-station/ui-server/UIHttpServer.ts
src/charging-station/ui-server/UIMCPServer.ts
src/charging-station/ui-server/UIServerSecurity.ts
src/charging-station/ui-server/UIWebSocketServer.ts
src/worker/WorkerConstants.ts
src/worker/WorkerSet.ts
tests/charging-station/ChargingStationTestConstants.ts
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-ReconnectDelay.test.ts
tests/charging-station/ui-server/UIHttpServer.test.ts
tests/charging-station/ui-server/UIMCPServer.test.ts
tests/ocpp-server/server.py
tests/ocpp-server/test_server.py
ui/web/src/App.vue
ui/web/src/components/actions/AddChargingStations.vue
ui/web/src/components/actions/SetSupervisionUrl.vue
ui/web/src/components/actions/StartTransaction.vue
ui/web/src/components/charging-stations/CSConnector.vue
ui/web/src/components/charging-stations/CSData.vue
ui/web/src/composables/Constants.ts
ui/web/src/composables/index.ts
ui/web/src/main.ts
ui/web/src/router/index.ts
ui/web/src/views/ChargingStationsView.vue