"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeparturesModel = void 0;
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
const RouteTypeEnums_1 = require("../../../../helpers/RouteTypeEnums");
class DeparturesModel extends sequelize_1.Model {
}
exports.DeparturesModel = DeparturesModel;
DeparturesModel.TABLE_NAME = "ropidgtfs_precomputed_departures";
DeparturesModel.attributeModel = {
    stop_sequence: {
        type: sequelize_1.DataTypes.SMALLINT,
        allowNull: false,
    },
    stop_headsign: sequelize_1.DataTypes.STRING(70),
    pickup_type: sequelize_1.DataTypes.CHAR(1),
    drop_off_type: sequelize_1.DataTypes.CHAR(1),
    arrival_time: sequelize_1.DataTypes.STRING(20),
    arrival_datetime: sequelize_1.DataTypes.DATE,
    departure_time: sequelize_1.DataTypes.STRING(20),
    departure_datetime: sequelize_1.DataTypes.DATE,
    stop_id: {
        type: sequelize_1.DataTypes.STRING(25),
        allowNull: false,
    },
    stop_name: sequelize_1.DataTypes.STRING(100),
    platform_code: sequelize_1.DataTypes.STRING(10),
    wheelchair_boarding: sequelize_1.DataTypes.SMALLINT,
    min_stop_sequence: sequelize_1.DataTypes.SMALLINT,
    max_stop_sequence: sequelize_1.DataTypes.SMALLINT,
    trip_id: {
        type: sequelize_1.DataTypes.STRING(50),
        allowNull: false,
    },
    trip_headsign: {
        type: sequelize_1.DataTypes.STRING(100),
        allowNull: false,
    },
    trip_short_name: sequelize_1.DataTypes.STRING(50),
    wheelchair_accessible: sequelize_1.DataTypes.SMALLINT,
    direction_id: sequelize_1.DataTypes.SMALLINT,
    service_id: sequelize_1.DataTypes.STRING(30),
    date: sequelize_1.DataTypes.DATE,
    route_short_name: sequelize_1.DataTypes.STRING(50),
    route_type: {
        type: sequelize_1.DataTypes.SMALLINT,
        allowNull: false,
        defaultValue: RouteTypeEnums_1.GTFSRouteTypeEnum.EXT_MISCELLANEOUS,
    },
    route_id: sequelize_1.DataTypes.STRING(20),
    is_night: sequelize_1.DataTypes.CHAR(1),
    is_regional: sequelize_1.DataTypes.CHAR(1),
    is_substitute_transport: sequelize_1.DataTypes.CHAR(1),
    next_stop_sequence: sequelize_1.DataTypes.SMALLINT,
    next_stop_id: sequelize_1.DataTypes.STRING(30),
    last_stop_sequence: sequelize_1.DataTypes.SMALLINT,
    last_stop_id: sequelize_1.DataTypes.STRING(30),
    cis_stop_group_id: sequelize_1.DataTypes.INTEGER,
    trip_headsign_icons: sequelize_1.DataTypes.TEXT,
    trip_connections: sequelize_1.DataTypes.JSONB,
    next_route_short_name: sequelize_1.DataTypes.TEXT,
    next_trip_headsign: sequelize_1.DataTypes.TEXT,
    max_stop_sequence_with_stop_headsign: sequelize_1.DataTypes.SMALLINT,
};
DeparturesModel.jsonSchema = {
    type: "object",
    properties: {
        stop_sequence: {
            type: "number",
        },
        stop_headsign: {
            type: "string",
        },
        pickup_type: {
            type: "string",
        },
        drop_off_type: {
            type: "string",
        },
        arrival_time: {
            type: "string",
        },
        arrival_datetime: {
            type: "object",
            required: ["toISOString"],
        },
        departure_time: {
            type: "string",
        },
        departure_datetime: {
            type: "object",
            required: ["toISOString"],
        },
        stop_id: {
            type: "string",
        },
        stop_name: {
            type: "string",
        },
        platform_code: {
            type: "string",
        },
        wheelchair_boarding: {
            type: "number",
        },
        direction_id: {
            type: "number",
        },
        min_stop_sequence: {
            type: "number",
        },
        max_stop_sequence: {
            type: "number",
        },
        trip_id: {
            type: "string",
        },
        trip_headsign: {
            type: "string",
        },
        trip_short_name: {
            type: "string",
        },
        wheelchair_accessible: {
            type: "number",
        },
        service_id: {
            type: "string",
        },
        date: {
            type: "string",
        },
        route_short_name: {
            type: "string",
        },
        route_type: {
            type: "number",
        },
        route_id: {
            type: "string",
        },
        is_night: {
            type: "string",
        },
        is_regional: {
            type: "string",
        },
        is_substitute_transport: {
            type: "string",
        },
        next_stop_sequence: {
            type: "number",
        },
        next_stop_id: {
            type: "string",
        },
        last_stop_sequence: {
            type: "number",
        },
        last_stop_id: {
            type: "string",
        },
        cis_stop_group_id: {
            type: "number",
        },
        trip_headsign_icons: {
            type: "string",
        },
        trip_connections: {
            type: "array",
            items: {
                type: "object",
                properties: {
                    from_trip_id: { type: "string" },
                    max_wait_sec: { type: "number" },
                },
                additionalProperties: false,
                required: ["from_trip_id", "max_wait_sec"],
            },
        },
        next_route_short_name: {
            type: "string",
        },
        next_trip_headsign: {
            type: "string",
        },
        max_stop_sequence_with_stop_headsign: {
            type: "number",
        },
    },
    required: ["stop_sequence", "stop_id", "trip_id", "trip_headsign"],
};
//# sourceMappingURL=DeparturesModel.js.map