﻿{ "$schema":                "https://json-schema.org/draft/2020-12/schema",
  "$id":                    "https://schemas.mpai.community/MMM4/V2.2/actions/MUMovePA.json",
  "title":                  "MUMovePA", 
  "type":                   "object",
  "required":               [ "Header", "Time" ], 
  "properties":             {

    "Header":               { "type": "string", "pattern": "^MMM-3MP-V[0-9]{1,2}[.][0-9]{1,2}$" },
    "MInstanceID":          { "type": "string" },
    "UEnvironmentID":       { "type": "string" },
    "MUMovePAID":           { "type": "string" },
    "MUMovePATime":         { "type": "string" },

    "Time":                 { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/Time.json" },

    "MUMovePARQ":           { "type": "object", "properties": {
      "RQ1":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "Nil" ] },
        "RItemID":          { "type": "string" } } },
      "RQ2":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "From" ] },
        "PointOfView1":     { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/PointOfView.json" } } },
      "RQ3":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "To" ] },
        "PointOfView2":     { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/PointOfView.json" } } },
      "RQ4":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "With" ] },
        "ULocation":        { "type": "string" } } },
      "RQ5":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "With" ] },
        "Trajectory":       { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/Trajectory.json" } } },
      "RQ6":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "With" ] },
        "Rights":           { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Right.json#/properties/Rights" } } },
      "RQ7":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "With" ] },
        "SPM":              { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/ServicePricingModel.json" } } } } },

    "MUMovePARS":           { "type": "object", "properties": {
      "RS1":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "With" ] },
        "Rights":           { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Right.json#/properties/Rights" } } },
      "RS2":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "With" ] },
        "SPM":              { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/ServicePricingModel.json" } } },
      "RS3":                { "type": "object", "properties": {
        "Complement":       { "type": "string", "enum": [ "With" ] },
        "PAStatus":         { "type": "array", "items": { "oneOf": [
                            { "type": "object", "properties": { 
          "Err":            { "type": "string", "enum": [ "Clash", "FaultyPA", "IncID", "ULocOOR", "InsRights", "InsValue" ] } } },
                            { "type": "object", "properties": {
          "Ack":            { "type": "string", "enum": [ "Ack" ] } } } ] } } } } } },

    "DataXMData":           { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json" },
    "DescrMetadata":        { "type": "string", "maxLength": 2048 } },

  "oneOf": [                { "required": [ "MUMovePARQ" ], "not": { "required": [ "MUMovePARS" ] } },
                            { "required": [ "MUMovePARS" ], "not": { "required": [ "MUMovePARQ" ] } } ] }