]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(ocpp): dissolve OCPPServiceUtils class and eliminate dynamic imports
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 30 Mar 2026 21:45:32 +0000 (23:45 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 30 Mar 2026 21:45:32 +0000 (23:45 +0200)
commit91f9621473de2f50db59e35beea2e169acfa511c
tree508c4e6d11d17504ffaa9eb90700c95476b0371c
parentc8d9ecb59e3d3188a665080ea413249f2d1665a5
refactor(ocpp): dissolve OCPPServiceUtils class and eliminate dynamic imports

Dissolve the OCPPServiceUtils class into standalone exported functions,
removing the class hierarchy (extends) from OCPP16/20ServiceUtils.

Extract 6 version-dispatching operations into OCPPServiceOperations.ts
with static top-level imports, eliminating all 11 dynamic await import()
calls that were used to work around circular dependencies.

The dependency graph is now a clean DAG:
  OCPPServiceUtils.ts (pure utilities, no version knowledge of subclasses)
  OCPP16/20ServiceUtils.ts (version-specific, import utils directly)
  OCPPServiceOperations.ts (dispatchers, static imports of both)

Cross-component imports now go through barrel files per project conventions.
JSDoc harmonized across all modified files.
22 files changed:
src/charging-station/AutomaticTransactionGenerator.ts
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/charging-station/ocpp/1.6/OCPP16RequestService.ts
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
src/charging-station/ocpp/2.0/OCPP20RequestService.ts
src/charging-station/ocpp/2.0/OCPP20ResponseService.ts
src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts
src/charging-station/ocpp/OCPPServiceOperations.ts [new file with mode: 0644]
src/charging-station/ocpp/OCPPServiceUtils.ts
src/charging-station/ocpp/auth/cache/index.ts [deleted file]
src/charging-station/ocpp/auth/factories/index.ts [deleted file]
src/charging-station/ocpp/auth/index.ts
src/charging-station/ocpp/auth/utils/index.ts [deleted file]
src/charging-station/ocpp/index.ts
tests/charging-station/ocpp/1.6/OCPP16ServiceUtils.test.ts
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent.test.ts
tests/charging-station/ocpp/OCPPServiceUtils-StopTransaction.test.ts
tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts
tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts