]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(auth): make updateCacheEntry API OCPP version-agnostic
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Mar 2026 20:06:21 +0000 (22:06 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Mar 2026 20:06:21 +0000 (22:06 +0200)
commit4b63c423b3eccef4d8ab1701e96581289c93fff2
tree6774d839359546bbf8ad9ef3e73d0a87ac76497a
parentca3eec7dc4656fb2bdd002c8c088aeb167caf2c4
refactor(auth): make updateCacheEntry API OCPP version-agnostic

Decouple updateCacheEntry from OCPP 2.0-specific types by accepting
AuthorizationStatus and optional expiryDate instead of pre-built
AuthorizationResult and TTL. This centralizes result construction,
date conversion, TTL computation, and expired-entry guards in the
auth service, eliminating duplicated logic across OCPP 1.6 and 2.0
callers. Also change OCPPAuthAdapter generic default from
OCPP20IdTokenType|string to unknown to remove the last OCPP
version-specific type from the auth service interface.
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts
src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts
src/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.ts
src/charging-station/ocpp/auth/interfaces/OCPPAuthService.ts
src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts
tests/charging-station/ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts