@golemio/pid
Version:
Golemio PID Module
73 lines • 3.56 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DescriptorModel = void 0;
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
const VehicleDescriptorEnums_1 = require("../../../helpers/VehicleDescriptorEnums");
class DescriptorModel extends sequelize_1.Model {
}
exports.DescriptorModel = DescriptorModel;
DescriptorModel.tableName = "vehiclepositions_vehicle_descriptors";
DescriptorModel.attributeModel = {
id: { type: sequelize_1.DataTypes.INTEGER, primaryKey: true },
state: { type: sequelize_1.DataTypes.STRING, allowNull: false },
registration_number: { type: sequelize_1.DataTypes.INTEGER, allowNull: false },
registration_number_index: { type: sequelize_1.DataTypes.SMALLINT, allowNull: false },
license_plate: { type: sequelize_1.DataTypes.STRING, allowNull: true },
operator: { type: sequelize_1.DataTypes.STRING, allowNull: false },
manufacturer: { type: sequelize_1.DataTypes.STRING, allowNull: false },
type: { type: sequelize_1.DataTypes.STRING, allowNull: false },
traction: { type: sequelize_1.DataTypes.STRING, allowNull: false },
gtfs_route_type: { type: sequelize_1.DataTypes.SMALLINT, allowNull: false },
is_wheelchair_accessible: { type: sequelize_1.DataTypes.BOOLEAN, allowNull: true },
is_air_conditioned: { type: sequelize_1.DataTypes.BOOLEAN, allowNull: false },
has_usb_chargers: { type: sequelize_1.DataTypes.BOOLEAN, allowNull: false },
paint: { type: sequelize_1.DataTypes.STRING, allowNull: true },
thumbnail_url: { type: sequelize_1.DataTypes.STRING, allowNull: true },
photo_url: { type: sequelize_1.DataTypes.STRING, allowNull: true },
};
DescriptorModel.updateAttributes = Object.keys(DescriptorModel.attributeModel)
.filter((attribute) => attribute !== "id")
.concat("updated_at");
DescriptorModel.arrayJsonSchema = {
type: "array",
items: {
type: "object",
properties: {
id: { type: "integer" },
state: { type: "string", enum: Object.values(VehicleDescriptorEnums_1.VehicleDescriptorStateEnum) },
registration_number: { type: "integer" },
registration_number_index: { type: "integer" },
license_plate: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
operator: { type: "string" },
manufacturer: { type: "string" },
type: { type: "string" },
traction: { type: "string" },
gtfs_route_type: { type: "integer" },
is_wheelchair_accessible: { oneOf: [{ type: "boolean" }, { type: "null", nullable: true }] },
is_air_conditioned: { type: "boolean" },
has_usb_chargers: { type: "boolean" },
paint: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
thumbnail_url: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
photo_url: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
},
required: [
"id",
"state",
"registration_number",
"registration_number_index",
"license_plate",
"operator",
"manufacturer",
"type",
"traction",
"gtfs_route_type",
"is_wheelchair_accessible",
"is_air_conditioned",
"has_usb_chargers",
"paint",
"thumbnail_url",
"photo_url",
],
},
};
//# sourceMappingURL=DescriptorModel.js.map