{
  "title": "Industry Core: Notifications Schema",
  "required": [
    "header",
    "content"
  ],
  "type": "object",
  "properties": {
    "header": {
      "$ref": "#/NotificationHeader"
    },
    "content": {
      "$ref": "#/NotificationBody"
    }
  },
  "NotificationHeader": {
    "$ref": "#/urn_samm_io.catenax.shared.message_header_3.0.0_HeaderCharacteristic"
  },
  "NotificationBody": {
    "type": "object"
  },
  "urn_samm_org.eclipse.esmf.samm_characteristic_2.1.0_Boolean": {
    "type": "boolean",
    "description": "Represents a boolean value (i.e. a \"flag\")."
  },
  "urn_samm_org.eclipse.esmf.samm_characteristic_2.1.0_Timestamp": {
    "type": "string",
    "pattern": "-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?|(24:00:00(\\.0+)?))(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?",
    "description": "Describes a Property which contains the date and time with an optional timezone.",
    "example": "2007-08-31T16:47+00:00"
  },
  "urn_samm_io.catenax.shared.uuid_2.0.0_UuidV4Trait": {
    "type": "string",
    "description": "The provided regular expression ensures that the UUID is composed of five groups of characters separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4 hyphens), optionally prefixed by \"urn:uuid:\" to make it an IRI.",
    "pattern": "(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)|(^urn:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)"
  },
  "urn_samm_io.catenax.shared.business_partner_number_2.0.0_BpnlTrait": {
    "type": "string",
    "description": "The provided regular expression ensures that the BPNL is composed of prefix 'BPNL', 10 digits and two alphanumeric letters.",
    "pattern": "^BPNL[a-zA-Z0-9]{12}$"
  },
  "urn_samm_io.catenax.shared.message_header_3.0.0_ContextCharacteristic": {
    "type": "string",
    "description": "Defining a string value for the context",
    "example": "IndustryCore-UniqueIDPush-ConnectToParent:2.0.0"
  },
  "urn_samm_io.catenax.shared.message_header_3.0.0_SemanticVersioningTrait": {
    "type": "string",
    "description": "Constraint for defining a SemVer version.",
    "pattern": "^(0|[1-9][0-9]*).(0|[1-9][0-9]*).(0|[1-9][0-9]*)(-(0|[1-9A-Za-z-][0-9A-Za-z-]*)(.[0-9A-Za-z-]+)*)?([0-9A-Za-z-]+(.[0-9A-Za-z-]+)*)?$",
    "example": "3.0.0"
  },
  "urn_samm_io.catenax.shared.message_header_3.0.0_HeaderCharacteristic": {
    "description": "Characteristic describing the common shared aspect Message Header",
    "type": "object",
    "properties": {
      "messageId": {
        "description": "Unique ID identifying the message. The purpose of the ID is to uniquely identify a single message, therefore it MUST not be reused.",
        "$ref": "#/urn_samm_io.catenax.shared.uuid_2.0.0_UuidV4Trait"
      },
      "context": {
        "description": "Information about the context the message should be considered in.\nThe value MUST consist of two parts: an identifier of the context (e.g. business domain, etc.) followed by a version number.\nBoth the identifier and the version number MUST correspond to the content of the message.\nIf the content of a message is described by an aspect model available in the Catena-X Semantic Hub, then the unique identifier of this semantic model (e.g. urn:samm:io.catenax.<ASPECT-MODEL-NAME>:1.x.x) MUST be used as a value of the context field. This is considered the default case.\nIn all other cases the value of the context field MUST follow the pattern <domain>-<subdomain>-<object>:<[major] version> (e.g. TRACE-QM-Alert:1.x.x).\nVersioning only refers to major versions in both default and fallback cases.\nNote: The version of the message's header is specified in the version field.",
        "$ref": "#/urn_samm_io.catenax.shared.message_header_3.0.0_ContextCharacteristic"
      },
      "sentDateTime": {
        "description": "Time zone aware timestamp holding the date and the time the message was sent by the sending party. The value MUST be formatted according to the ISO 8601 standard",
        "$ref": "#/urn_samm_org.eclipse.esmf.samm_characteristic_2.1.0_Timestamp"
      },
      "senderBpn": {
        "description": "The Business Partner Number of the sending party. The value MUST be a valid BPN. BPNA and BPNS are not allowed. Applicable constraints are defined in the corresponding standard",
        "$ref": "#/urn_samm_io.catenax.shared.business_partner_number_2.0.0_BpnlTrait"
      },
      "receiverBpn": {
        "description": "The Business Partner Number of the receiving party. The value MUST be a valid BPN. BPNA and BPNS are not allowed. Applicable constraints are defined in the corresponding standard.",
        "$ref": "#/urn_samm_io.catenax.shared.business_partner_number_2.0.0_BpnlTrait"
      },
      "expectedResponseBy": {
        "description": "Time zone aware timestamp holding the date and time by which the sending party expects a certain type of response from the receiving party. The meaning and interpretation of the fields's value are context-bound and MUST therefore be defined by any business domain or platform capability making use of it. The value MUST be formatted according to the ISO 8601 standard",
        "$ref": "#/urn_samm_org.eclipse.esmf.samm_characteristic_2.1.0_Timestamp"
      },
      "relatedMessageId": {
        "description": "Unique ID identifying a message somehow related to the current one",
        "$ref": "#/urn_samm_io.catenax.shared.uuid_2.0.0_UuidV4Trait"
      },
      "version": {
        "description": "The unique identifier of the aspect model defining the structure and the semantics of the message's header. The version number should reflect the versioning schema of aspect models in Catena-X.",
        "$ref": "#/urn_samm_io.catenax.shared.message_header_3.0.0_SemanticVersioningTrait"
      }
    },
    "required": [
      "messageId",
      "context",
      "sentDateTime",
      "senderBpn",
      "receiverBpn",
      "version"
    ]
  }
}