"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.jisEventsJsonSchema = void 0;
const JISEventSeverityLevelEnum_1 = require("../../../helpers/jis/JISEventSeverityLevelEnum");
const jisEventCause_1 = require("../constants/jisEventCause");
const jisEventEffect_1 = require("../constants/jisEventEffect");
const jisEventType_1 = require("../constants/jisEventType");
exports.jisEventsJsonSchema = {
    type: "array",
    items: {
        type: "object",
        properties: {
            id: { type: "string" },
            type: { type: "string", enum: jisEventType_1.jisEventType },
            header_text: { $ref: "#/definitions/Translation" },
            cause: { type: "string", enum: jisEventCause_1.jisEventCause },
            cause_detail: { $ref: "#/definitions/TranslationNullable" },
            severity_level: { type: "string", enum: Object.values(JISEventSeverityLevelEnum_1.JISEventSeverityLevel) },
            active_period: {
                type: "object",
                properties: {
                    start: { type: "string", format: "date-time" },
                    end: {
                        oneOf: [
                            { type: "string", format: "date-time" },
                            { type: "null", nullable: true },
                        ],
                    },
                },
                additionalProperties: false,
                required: ["start"],
            },
            display_period: {
                type: "object",
                properties: {
                    start: { type: "string", format: "date-time" },
                    end: {
                        oneOf: [
                            { type: "string", format: "date-time" },
                            { type: "null", nullable: true },
                        ],
                    },
                },
                additionalProperties: false,
                required: ["start"],
            },
            effect: {
                oneOf: [
                    {
                        type: "array",
                        items: {
                            type: "string",
                            enum: jisEventEffect_1.jisEventEffect,
                        },
                        minItems: 1,
                        maxItems: 3,
                        uniqueItems: true,
                    },
                    {
                        type: "string",
                        enum: jisEventEffect_1.jisEventEffect,
                    },
                ],
            },
            effect_detail: { $ref: "#/definitions/Translation" },
            description_text: { $ref: "#/definitions/Translation" },
            description_html: { $ref: "#/definitions/Translation" },
            url: { $ref: "#/definitions/Translation" },
            organization_name: { type: "string" },
            informed_entity: {
                type: "object",
                nullable: true,
                properties: {
                    routes: {
                        type: "array",
                        nullable: true,
                        items: {
                            type: "object",
                            properties: {
                                id: { type: "string" },
                            },
                            additionalProperties: false,
                            required: ["id"],
                        },
                    },
                },
                additionalProperties: false,
            },
            created_timestamp: { type: "string", format: "date-time" },
            last_modified_timestamp: { type: "string", format: "date-time" },
            deleted_at: {
                oneOf: [
                    { type: "string", format: "date-time" },
                    { type: "null", nullable: true },
                ],
            },
        },
        required: [
            "id",
            "type",
            "header_text",
            "cause",
            "cause_detail",
            "severity_level",
            "active_period",
            "display_period",
            "effect",
            "effect_detail",
            "description_text",
            "description_html",
            "url",
            "organization_name",
            "created_timestamp",
            "last_modified_timestamp",
        ],
    },
    definitions: {
        Translation: {
            type: "object",
            properties: {
                cs: { type: "string" },
                en: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
            },
            additionalProperties: false,
            required: ["cs"],
        },
        TranslationNullable: {
            type: "object",
            properties: {
                cs: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
                en: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
            },
            additionalProperties: false,
            required: ["cs"],
        },
    },
};
//# sourceMappingURL=JISEventsJsonSchema.js.map