@golemio/pid
Version:
Golemio PID Module
94 lines • 3.06 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JISInfotextsModel = void 0;
const InfotextSeverityLevelEnum_1 = require("../../../output-gateway/shared/constants/jis/InfotextSeverityLevelEnum");
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
class JISInfotextsModel extends sequelize_1.Model {
}
exports.JISInfotextsModel = JISInfotextsModel;
JISInfotextsModel.tableName = "jis_infotexts";
JISInfotextsModel.attributeModel = {
id: {
primaryKey: true,
allowNull: false,
type: sequelize_1.DataTypes.UUID,
},
severity_level: {
type: sequelize_1.DataTypes.ENUM(...Object.values(InfotextSeverityLevelEnum_1.InfotextSeverityLevel)),
allowNull: false,
},
display_type: {
type: sequelize_1.DataTypes.STRING(255),
allowNull: false,
},
active_period_start: {
type: sequelize_1.DataTypes.DATE,
allowNull: false,
},
active_period_end: {
type: sequelize_1.DataTypes.DATE,
},
description_text: {
type: sequelize_1.DataTypes.JSONB,
allowNull: false,
},
created_timestamp: {
type: sequelize_1.DataTypes.DATE,
allowNull: false,
},
updated_timestamp: {
type: sequelize_1.DataTypes.DATE,
allowNull: false,
},
created_at: {
type: sequelize_1.DataTypes.DATE,
allowNull: false,
},
updated_at: {
type: sequelize_1.DataTypes.DATE,
allowNull: false,
},
};
JISInfotextsModel.jsonSchema = {
type: "array",
items: {
type: "object",
properties: {
id: { type: "string" },
severity_level: { type: "string", enum: Object.values(InfotextSeverityLevelEnum_1.InfotextSeverityLevel) },
display_type: { type: "string", enum: ["GENERAL", "INLINE"] },
active_period_start: { type: "object", required: ["toISOString"] },
active_period_end: {
oneOf: [
{ type: "object", required: ["toISOString"] },
{ type: "null", nullable: true },
],
},
description_text: { $ref: "#/definitions/Translation" },
created_timestamp: { type: "object", required: ["toISOString"] },
updated_timestamp: { type: "object", required: ["toISOString"] },
},
additionalProperties: false,
required: [
"id",
"severity_level",
"display_type",
"active_period_start",
"description_text",
"created_timestamp",
"updated_timestamp",
],
},
definitions: {
Translation: {
type: "object",
properties: {
cs: { type: "string" },
en: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
},
additionalProperties: false,
required: ["cs"],
},
},
};
//# sourceMappingURL=JISInfotextsModel.js.map