]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(broadcast-channel): extract passthrough() factory, remove 20 identical handlers
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 24 Mar 2026 00:39:40 +0000 (01:39 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 24 Mar 2026 00:39:40 +0000 (01:39 +0100)
commitaccb056172b75c281dc5bc6376f9e29762e98c50
tree9ee6e9c9aeb0754d981a40ef51b3d64ed65931d3
parente19ff6c4e109105f061f70525771015dc48fed5c
refactor(broadcast-channel): extract passthrough() factory, remove 20 identical handlers

Replace 20 identical BroadcastChannel handler methods (handleAuthorize,
handleDataTransfer, handleHeartbeat, handleStatusNotification, etc.)
with a single passthrough(RequestCommand) factory method that creates
a CommandHandler forwarding the request payload to requestHandler.

Retain only handlers with custom logic: handleBootNotification (merges
bootNotificationRequest), handleMeterValues (version-specific meter
value building), handleStopTransaction (adds meterStop).

Net reduction: -208 lines.
src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts