]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(ocpp): consolidate MeterValues validators and helpers
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 2 Apr 2026 13:05:46 +0000 (15:05 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 2 Apr 2026 13:06:23 +0000 (15:06 +0200)
commit4712a5e12aaee41eb28aac38b2a6d3a311eeddc3
tree4d45564d6c90b2f19de0d9b05358ac4b0d06941c
parent803a118fb119964ad39b0e059f66aae613478873
refactor(ocpp): consolidate MeterValues validators and helpers

Replace 5 near-identical validators with 1 generic
validateMeasurandValue using options pattern for phase
and interval. Merge addLineToLineVoltageToMeterValue into
addPhaseVoltageToMeterValue with nominalVoltage and optional
noTemplateFallback params preserving voltage simulation
semantics. Inline dead getMeasurandDefaultContext and
getMeasurandDefault. Extract magic numbers as constants.
src/charging-station/ocpp/OCPPServiceUtils.ts