"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RopidDeparturesPresetsTransformation = void 0;
const ropid_departures_presets_1 = require("../../../schema-definitions/ropid-departures-presets");
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
class RopidDeparturesPresetsTransformation extends transformations_1.BaseTransformation {
    constructor() {
        super();
        /**
         * Overrides BaseTransformation::transform
         */
        this.transform = (data) => {
            return Promise.resolve(data.map((element) => this.transformElement(element)));
        };
        this.transformElement = (element) => {
            return {
                route_name: element.routeName,
                api_version: element.apiVersion,
                route: element.route,
                url_query_params: new URLSearchParams(element.query).toString(),
                note: element.note,
                is_testing: element.isTesting ?? element.note.endsWith("(testovací)"),
            };
        };
        this.name = ropid_departures_presets_1.RopidDeparturesPresets.name;
    }
}
exports.RopidDeparturesPresetsTransformation = RopidDeparturesPresetsTransformation;
//# sourceMappingURL=RopidDeparturesPresetsTransformation.js.map