"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RopidGTFSPrecomputed = void 0;
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
const outputServicesCalendarSDMA = {
    date: sequelize_1.DataTypes.DATE,
    day_diff: sequelize_1.DataTypes.INTEGER,
    service_id: sequelize_1.DataTypes.STRING(255),
};
const outputServicesCalendarJsonSchema = {
    type: "object",
    properties: {
        date: {
            type: "string",
        },
        day_diff: {
            type: "integer",
        },
        service_id: {
            type: "string",
        },
    },
    required: ["date", "day_diff", "service_id"],
};
const outputMinMaxStopSequencesSDMA = {
    trip_id: sequelize_1.DataTypes.STRING,
    max_stop_sequence: sequelize_1.DataTypes.INTEGER, // 9
    min_stop_sequence: sequelize_1.DataTypes.INTEGER, // 1
    max_stop_time: sequelize_1.DataTypes.STRING, // "11:58:00"
    min_stop_time: sequelize_1.DataTypes.STRING, // "11:58:00"
};
const outputMinMaxStopSequencesJsonSchema = {
    type: "object",
    properties: {
        trip_id: {
            type: "string",
        },
        max_stop_sequence: {
            type: "integer",
        },
        min_stop_sequence: {
            type: "integer",
        },
        max_stop_time: {
            type: "string",
        },
        min_stop_time: {
            type: "string",
        },
    },
    required: ["trip_id", "max_stop_sequence", "min_stop_sequence", "max_stop_time", "min_stop_time"],
};
const outputTripScheduleSDMA = {
    origin_route_id: sequelize_1.DataTypes.STRING,
    trip_id: {
        type: sequelize_1.DataTypes.STRING,
        primaryKey: true,
    },
    service_id: sequelize_1.DataTypes.STRING,
    direction_id: sequelize_1.DataTypes.SMALLINT,
    shape_id: sequelize_1.DataTypes.STRING(15),
    run_number: sequelize_1.DataTypes.INTEGER,
    date: {
        type: sequelize_1.DataTypes.STRING,
        primaryKey: true,
    },
    route_id: sequelize_1.DataTypes.STRING,
    route_type: {
        type: sequelize_1.DataTypes.SMALLINT,
        allowNull: false,
    },
    route_short_name: sequelize_1.DataTypes.STRING,
    is_regional: sequelize_1.DataTypes.STRING,
    is_substitute_transport: sequelize_1.DataTypes.STRING,
    is_night: sequelize_1.DataTypes.STRING,
    trip_headsign: sequelize_1.DataTypes.STRING,
    trip_short_name: sequelize_1.DataTypes.STRING,
    block_id: sequelize_1.DataTypes.STRING,
    exceptional: sequelize_1.DataTypes.NUMBER,
    min_stop_time: sequelize_1.DataTypes.STRING,
    max_stop_time: sequelize_1.DataTypes.STRING,
    start_timestamp: sequelize_1.DataTypes.STRING,
    end_timestamp: sequelize_1.DataTypes.STRING,
    first_stop_id: sequelize_1.DataTypes.STRING,
    last_stop_id: sequelize_1.DataTypes.STRING,
    origin_route_name: sequelize_1.DataTypes.STRING(50),
    trip_number: sequelize_1.DataTypes.SMALLINT,
    route_licence_number: sequelize_1.DataTypes.INTEGER,
};
const outputTripScheduleJsonSchema = {
    type: "object",
    properties: {
        origin_route_id: {
            type: "string",
        },
        trip_id: {
            type: "string",
        },
        service_id: {
            type: "string",
        },
        direction_id: {
            type: "integer",
        },
        shape_id: {
            type: "string",
        },
        run_number: {
            type: "string",
        },
        date: {
            type: "string",
        },
        route_id: {
            type: "string",
        },
        route_type: {
            type: "integer",
        },
        route_short_name: {
            type: "string",
        },
        is_regional: {
            type: "string",
        },
        is_substitute_transport: {
            type: "string",
        },
        is_night: {
            type: "string",
        },
        trip_headsign: {
            type: "string",
        },
        trip_short_name: {
            type: "string",
        },
        block_id: {
            type: "string",
        },
        exceptional: {
            type: "integer",
        },
        min_stop_time: {
            type: "string",
        },
        max_stop_time: {
            type: "string",
        },
        start_timestamp: {
            type: "string",
        },
        end_timestamp: {
            type: "string",
        },
        first_stop_id: {
            type: "string",
        },
        last_stop_id: {
            type: "string",
        },
        origin_route_name: {
            type: "string",
        },
        trip_number: {
            type: "integer",
        },
        route_licence_number: {
            type: "integer",
        },
    },
    required: ["route_type"],
};
exports.RopidGTFSPrecomputed = {
    servicesCalendar: {
        outputJsonSchema: outputServicesCalendarJsonSchema,
        outputSequelizeAttributes: outputServicesCalendarSDMA,
        pgTableName: "ropidgtfs_precomputed_services_calendar",
    },
    minMaxStopSequences: {
        outputJsonSchema: outputMinMaxStopSequencesJsonSchema,
        outputSequelizeAttributes: outputMinMaxStopSequencesSDMA,
        pgTableName: "ropidgtfs_precomputed_minmax_stop_sequences",
    },
    tripSchedule: {
        outputJsonSchema: outputTripScheduleJsonSchema,
        outputSequelizeAttributes: outputTripScheduleSDMA,
        pgTableName: "ropidgtfs_precomputed_trip_schedule",
    },
};
//# sourceMappingURL=RopidGTFSPrecomputed.js.map