UNPKG

@golemio/parkings

Version:
25 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PmdpMeasurementTransformation = void 0; const SourceEnum_1 = require("../../../helpers/constants/SourceEnum"); const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation"); class PmdpMeasurementTransformation extends AbstractTransformation_1.AbstractTransformation { constructor(transformationDate) { super(); this.transformationDate = transformationDate; this.name = "PmdpMeasurementTransformation"; this.transformInternal = (data) => { return { source: SourceEnum_1.SourceEnum.PMDP, source_id: data.source_id, parking_id: data.id, total_spot_number: data.total_spot_number, available_spot_number: Number(data.volno), occupied_spot_number: data.total_spot_number ? data.total_spot_number - Number(data.volno) : null, date_modified: this.transformationDate.toISOString(), }; }; } } exports.PmdpMeasurementTransformation = PmdpMeasurementTransformation; //# sourceMappingURL=PmdpMeasurementTransformation.js.map