"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PresetLogModel = void 0;
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
class PresetLogModel extends sequelize_1.Model {
}
exports.PresetLogModel = PresetLogModel;
PresetLogModel.tableName = "ropid_departures_preset_logs";
PresetLogModel.attributeModel = {
    id: { type: sequelize_1.DataTypes.BIGINT, autoIncrement: true, primaryKey: true },
    device_alias: { type: sequelize_1.DataTypes.STRING },
    received_at: { type: sequelize_1.DataTypes.DATE },
    is_processed: { type: sequelize_1.DataTypes.BOOLEAN, allowNull: false },
    request_url: { type: sequelize_1.DataTypes.STRING, allowNull: false },
    request_method: { type: sequelize_1.DataTypes.STRING, allowNull: false },
    request_user_agent: { type: sequelize_1.DataTypes.STRING, allowNull: false },
    response_status: { type: sequelize_1.DataTypes.SMALLINT, allowNull: false },
    response_time_ms: { type: sequelize_1.DataTypes.INTEGER, allowNull: false },
};
PresetLogModel.indexes = [
    {
        unique: true,
        using: "BTREE",
        name: "ropid_departures_preset_logs_unique_idx",
        fields: ["device_alias", "received_at"],
    },
    {
        unique: false,
        using: "BTREE",
        name: "ropid_departures_preset_logs_is_processed_idx",
        fields: ["is_processed"],
    },
];
PresetLogModel.arrayJsonSchema = {
    type: "array",
    items: {
        type: "object",
        properties: {
            device_alias: { type: "string" },
            received_at: { type: "object", required: ["toISOString"] },
            is_processed: { type: "boolean" },
            request_url: { type: "string" },
            request_method: { type: "string" },
            request_user_agent: { type: "string" },
            response_status: { type: "number" },
            response_time_ms: { type: "number" },
        },
        required: [
            "device_alias",
            "received_at",
            "is_processed",
            "request_url",
            "request_method",
            "request_user_agent",
            "response_status",
            "response_time_ms",
        ],
    },
};
//# sourceMappingURL=PresetLogModel.js.map