"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VehicleIdGenerator = void 0;
const ProviderSourceTypeEnum_1 = require("../../../../../schema-definitions/vehicle-positions/models/enums/ProviderSourceTypeEnum");
const RouteTypeEnums_1 = require("../../../../../helpers/RouteTypeEnums");
class VehicleIdGenerator {
    static getVehicleId(trip_id, gtfs_route_type, provider_source_type, gtfs_route_short_name, cis_trip_number, vehicle_registration_number, run_number, internal_run_number) {
        if (gtfs_route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.TRAIN) {
            return "train-" + cis_trip_number;
        }
        if (gtfs_route_type === RouteTypeEnums_1.GTFSRouteTypeEnum.METRO) {
            return `metro-${gtfs_route_short_name}-${internal_run_number}-${run_number}`;
        }
        if (provider_source_type === ProviderSourceTypeEnum_1.ProviderSourceTypeEnum.TcpRegionalBus) {
            const externalTripId = trip_id.split("_").at(-1);
            return `service-${gtfs_route_type}-${externalTripId}`;
        }
        return "service-" + gtfs_route_type + "-" + vehicle_registration_number;
    }
}
exports.VehicleIdGenerator = VehicleIdGenerator;
//# sourceMappingURL=VehicleIdGenerator.js.map