UNPKG

@citrineos/data

Version:

The OCPP data module which includes all persistence layer implementation.

33 lines 1.11 kB
"use strict"; // Copyright Contributors to the CitrineOS Project // // SPDX-License-Identifier: Apache 2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.BootMapper = void 0; const base_1 = require("@citrineos/base"); class BootMapper { static toRegistrationStatusEnumType(status) { switch (status) { case 'Accepted': return base_1.OCPP2_0_1.RegistrationStatusEnumType.Accepted; case 'Pending': return base_1.OCPP2_0_1.RegistrationStatusEnumType.Pending; case 'Rejected': return base_1.OCPP2_0_1.RegistrationStatusEnumType.Rejected; default: throw new Error(`Invalid status: ${status}`); } } static toStatusInfo(statusInfo) { if (!statusInfo) { return statusInfo; } return { customData: statusInfo.customData, reasonCode: statusInfo.reasonCode, additionalInfo: statusInfo.additionalInfo, }; } } exports.BootMapper = BootMapper; //# sourceMappingURL=BootMapper.js.map