"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RegionalBusRunsMessagesModel = void 0;
const schema_definitions_1 = require("@golemio/core/dist/schema-definitions");
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
class RegionalBusRunsMessagesModel extends sequelize_1.Model {
}
exports.RegionalBusRunsMessagesModel = RegionalBusRunsMessagesModel;
RegionalBusRunsMessagesModel.TABLE_NAME = "vehiclepositions_regional_bus_runs_messages";
RegionalBusRunsMessagesModel.attributeModel = {
    external_trip_id: {
        type: sequelize_1.DataTypes.STRING(100),
        primaryKey: true,
    },
    cis_line_id: {
        type: sequelize_1.DataTypes.STRING(10),
    },
    cis_trip_number: {
        type: sequelize_1.DataTypes.INTEGER,
    },
    events: {
        type: sequelize_1.DataTypes.STRING(10),
        allowNull: false,
    },
    coordinates: {
        type: sequelize_1.DataTypes.GEOMETRY,
        allowNull: false,
    },
    vehicle_timestamp: {
        type: sequelize_1.DataTypes.DATE,
        primaryKey: true,
    },
    registration_number: {
        type: sequelize_1.DataTypes.INTEGER,
    },
    speed_kmh: {
        type: sequelize_1.DataTypes.SMALLINT,
        allowNull: false,
    },
    bearing: {
        type: sequelize_1.DataTypes.SMALLINT,
        allowNull: false,
    },
    is_terminated: {
        type: sequelize_1.DataTypes.BOOLEAN,
        allowNull: false,
    },
};
RegionalBusRunsMessagesModel.arrayJsonSchema = {
    type: "array",
    items: {
        type: "object",
        properties: {
            external_trip_id: {
                type: "string",
            },
            cis_line_id: {
                type: ["null", "string"],
            },
            cis_trip_number: {
                type: ["null", "number"],
            },
            events: {
                type: "string",
            },
            coordinates: {
                $ref: "#/definitions/geometry",
            },
            vehicle_timestamp: {
                type: "object",
                required: ["toISOString"],
            },
            registration_number: {
                type: ["null", "integer"],
            },
            speed_kmh: {
                type: "integer",
            },
            bearing: {
                type: "integer",
            },
            is_terminated: {
                type: "boolean",
            },
        },
        required: ["external_trip_id", "events", "coordinates", "vehicle_timestamp", "speed_kmh", "bearing", "is_terminated"],
    },
    definitions: {
        // @ts-expect-error
        geometry: schema_definitions_1.SharedSchemaProvider.Geometry,
    },
};
//# sourceMappingURL=RegionalBusRunsMessagesModel.js.map