"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PublicGtfsTripInfoTransformation = void 0;
const RouteTypeEnums_1 = require("../../../../../helpers/RouteTypeEnums");
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
let PublicGtfsTripInfoTransformation = class PublicGtfsTripInfoTransformation extends AbstractTransformation_1.AbstractTransformation {
    constructor() {
        super(...arguments);
        this.name = "GtfsTripInfoTransformation";
        this.transformInternal = (gtfsTrip) => {
            const routeType = gtfsTrip.route.route_type;
            return {
                gtfs_trip_id: gtfsTrip.trip_id,
                route_type: (RouteTypeEnums_1.GTFSRouteTypeEnum[routeType ?? 1700] ?? RouteTypeEnums_1.GTFSRouteTypeEnum[1700]).toLowerCase(),
                route_short_name: gtfsTrip.route.route_short_name,
                shape_id: gtfsTrip.shape_id,
                origin_route_name: gtfsTrip.route.route_id.substring(1), // L991 -> 991
                run_number: gtfsTrip.schedule?.run_number ?? null,
                trip_headsign: gtfsTrip.trip_headsign,
            };
        };
    }
};
exports.PublicGtfsTripInfoTransformation = PublicGtfsTripInfoTransformation;
exports.PublicGtfsTripInfoTransformation = PublicGtfsTripInfoTransformation = __decorate([
    (0, tsyringe_1.injectable)()
], PublicGtfsTripInfoTransformation);
//# sourceMappingURL=PublicGtfsTripInfoTransformation.js.map