"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RopidGTFSRunNumbers = void 0;
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
const datasourceJsonSchema = {
    type: "array",
    items: {
        $ref: "#/$defs/item",
    },
    $defs: {
        item: {
            type: "object",
            properties: {
                route_id: {
                    type: "string",
                },
                run_number: {
                    type: "string",
                },
                service_id: {
                    type: "string",
                },
                trip_id: {
                    type: "string",
                },
                vehicle_type: {
                    type: "string",
                },
                trip_number: {
                    type: "string",
                },
                route_licence_number: {
                    type: "string",
                },
            },
            required: ["route_id", "run_number", "service_id", "trip_id", "vehicle_type"],
        },
    },
};
// Output schema for the validator
const outputJsonSchema = {
    ...datasourceJsonSchema,
    $defs: {
        item: {
            type: "object",
            properties: {
                route_id: {
                    type: "string",
                },
                run_number: {
                    type: "number",
                },
                service_id: {
                    type: "string",
                },
                trip_id: {
                    type: "string",
                },
                vehicle_type: {
                    type: "number",
                },
                trip_number: {
                    type: "number",
                },
                route_licence_number: {
                    type: "number",
                },
            },
            required: datasourceJsonSchema.$defs.item.required,
        },
    },
};
// Output Sequelize attributes
const outputSequelizeAttributes = {
    route_id: {
        type: sequelize_1.DataTypes.STRING(50),
        allowNull: false,
    },
    run_number: {
        primaryKey: true,
        type: sequelize_1.DataTypes.INTEGER,
    },
    service_id: {
        primaryKey: true,
        type: sequelize_1.DataTypes.STRING(50),
    },
    trip_id: {
        primaryKey: true,
        type: sequelize_1.DataTypes.STRING(50),
    },
    vehicle_type: {
        type: sequelize_1.DataTypes.INTEGER,
        allowNull: false,
    },
    trip_number: {
        type: sequelize_1.DataTypes.SMALLINT,
        allowNull: true,
    },
    route_licence_number: {
        type: sequelize_1.DataTypes.INTEGER,
        allowNull: true,
    },
};
exports.RopidGTFSRunNumbers = {
    name: "RopidGTFSRunNumbers",
    datasourceJsonSchema,
    outputJsonSchema,
    outputSequelizeAttributes,
    pgTableName: "ropidgtfs_run_numbers",
};
//# sourceMappingURL=RopidGTFSRunNumbers.js.map