{ "$schema":                "https://json-schema.org/draft/2020-12/schema",
  "$id":                    "https://schemas.mpai.community/MMM4/V3.0/data/Rules.json",
  "title":                  "Rules V3.0",
  "type":                   "object",
  "properties":             {

    "Header":               { "type": "string", "const": "MMM-RUL-V3.0" },
    "MInstanceID":          { "type": "string" },
    "MEnvironmentID":       { "type": "string" },
    "RulesID":              { "type": "string" },
    "RulesTime":            { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SimpleTime.json" },

    "RulesData":            { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, 
                              "required": [ "PenaltiesID", "DeonticVerb", "PAIDOrPA", "Level" ], "properties": {

      "DeonticVerb":        { "type": "string", "enum": [ "Must", "May", "May Not" ] },

      "PAIDOrPA":           { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "oneOf": [
                            { "type": "object", "additionalProperties": false, "required": [ "ProcessAction" ], "properties": {
        "ProcessAction":    { "$ref": "https://schemas.mpai.community/MMM4/V3.0/data/ProcessAction.json" } } },
                            { "type": "object", "additionalProperties": false,"required": [ "ProcessActionID" ], "properties": {
        "ProcessActionID":  { "type": "string" },

        "Status":           { "type": "string", "enum": [ "Model", "Final" ], "default": "Model" } } } ] } } } } },

    "DataXMData":           { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json" },
    "DescrMetadata":        { "type": "string", "maxLength": 2048 } } }
