UNPKG

@golemio/parkings

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