openapi: 3.0.3
info:
  title: Catena-X DCM Id Based Comment
  description: Open API documentation for the Catena-X DCM Id Based Comment
  version: 1.0.0
paths:
  /internal-dcm-application-id-based-comment-post-endpoint:
    post:
      tags:
      - IdBasedComment
      operationId: postIdBasedComment
      description: Endpoint to receive an Id Based Comment with header information from a Catena-X DCM partner.
      requestBody:
        $ref: '#/components/requestBodies/IdBasedComment'
      responses:
        "200":
          description: OK
        "201":
          description: Created
        "400":
          description: Bad request
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "405":
          description: Method not allowed
        "422":
          description: Unprocessable Entity
        "501":
          description: Not Implemented	
        "503":
          description: Service Unavailable
components:
  schemas:
    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.message_header_3.0.0_ContextCharacteristic:
      type: string
      description: Defining a string value for the context
    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.
    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_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-]+)*)?$"
    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: '#/components/schemas/urn_samm_io.catenax.shared.uuid_2.0.0_UuidV4Trait'
        context:
          description: |-
            Information about the context the message should be considered in.
            The value MUST consist of two parts: an identifier of the context (e.g. business domain, etc.) followed by a version number.
            Both the identifier and the version number MUST correspond to the content of the message.
            If 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.
            In 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).
            Versioning only refers to major versions in both default and fallback cases.
            Note: The version of the message's header is specified in the version field.
          $ref: '#/components/schemas/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: '#/components/schemas/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: '#/components/schemas/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: '#/components/schemas/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: '#/components/schemas/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: '#/components/schemas/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: '#/components/schemas/urn_samm_io.catenax.shared.message_header_3.0.0_SemanticVersioningTrait'
      required:
      - messageId
      - context
      - sentDateTime
      - senderBpn
      - receiverBpn
      - version
    MessageHeaderAspect:
      description: Aspect model describing the shared message header.
      type: object
      properties:
        header:
          description: Contains standardized attributes for message processing common
            across several use cases.
          $ref: '#/components/schemas/urn_samm_io.catenax.shared.message_header_3.0.0_HeaderCharacteristic'
      required:
      - header
    urn_samm_io.catenax.shared.uuid_1.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.id_based_comment_1.0.0_AuthorCharacteristic:
      type: string
      description: Characteristic for an E-Mail or a BPNL
    urn_samm_io.catenax.id_based_comment_1.0.0_Timestamp:
      type: string
      format: date-time
      description: Point in time.
    urn_samm_io.catenax.id_based_comment_1.0.0_CommentTrait:
      type: string
      description: The provided regular expression ensures that the text of a comment
        is limited to the maximum length of 5.000 characters.
      pattern: "^[\\s\\S]{0,5000}$"
    urn_samm_io.catenax.id_based_comment_1.0.0_CommentTypeCharacteristic:
      type: string
      description: The classification of a comment.
      enum:
      - information
      - warning
      - default
      - actionRequired
    urn_samm_org.eclipse.esmf.samm_characteristic_2.1.0_Boolean:
      type: boolean
      description: Represents a boolean value (i.e. a "flag").
    urn_samm_io.catenax.id_based_comment_1.0.0_ListOfReferenceDatesCharacteristic:
      description: Point in time.
      type: array
      items:
        type: string
        format: date
      uniqueItems: true
    urn_samm_io.catenax.id_based_comment_1.0.0_ObjectTypeCharacteristic:
      type: string
      description: Defining a string value for the objectType.
    urn_samm_io.catenax.shared.business_partner_number_1.0.0_BpnlTrait:
      type: string
      description: "The provided regular expression ensures that the BPNL is composed\
        \ of prefix 'BPNL', 10 digits and two uppercase letters."
      pattern: "^BPNL[0-9]{8}[a-zA-Z0-9]{4}$"
    IdBasedComment:
      description: Aspect model for an exchange of comment belonging to a entity.
      type: object
      properties:
        commentId:
          description: The Comment ID uniquely identifies the entity within the business
            relationship between a customer and its supplier.
          $ref: '#/components/schemas/urn_samm_io.catenax.shared.uuid_1.0.0_UuidV4Trait'
        objectId:
          description: The ID of the object to which the comment belongs.
          $ref: '#/components/schemas/urn_samm_io.catenax.shared.uuid_1.0.0_UuidV4Trait'
        author:
          description: "The E-Mail address of the creator who wrote the comment. In\
            \ case comment creator wants to stay anonymous, show BPNL in app which\
            \ is sent the comment along."
          $ref: '#/components/schemas/urn_samm_io.catenax.id_based_comment_1.0.0_AuthorCharacteristic'
        postedAt:
          description: Point in time when the comment was created.
          $ref: '#/components/schemas/urn_samm_io.catenax.id_based_comment_1.0.0_Timestamp'
        changedAt:
          description: Point in time when the comment was last changed.
          $ref: '#/components/schemas/urn_samm_io.catenax.id_based_comment_1.0.0_Timestamp'
        commentText:
          description: Text up to 5.000 characters in format "UTF-8" will be shared.
          $ref: '#/components/schemas/urn_samm_io.catenax.id_based_comment_1.0.0_CommentTrait'
        commentType:
          description: Type of a comment to indicate a priority.
          $ref: '#/components/schemas/urn_samm_io.catenax.id_based_comment_1.0.0_CommentTypeCharacteristic'
        requestDelete:
          description: Indicates that the deletion of the comment is requested by
            sender incl. all of it's history.
          $ref: '#/components/schemas/urn_samm_org.eclipse.esmf.samm_characteristic_2.1.0_Boolean'
        listOfReferenceDates:
          description: Point in time the comment belongs to.
          $ref: '#/components/schemas/urn_samm_io.catenax.id_based_comment_1.0.0_ListOfReferenceDatesCharacteristic'
        objectType:
          description: Aspect Model which the comment refers to. The value MUST consist
            of the Catena-X aspect model unique identifier of the referenced data
            model without a version.
          $ref: '#/components/schemas/urn_samm_io.catenax.id_based_comment_1.0.0_ObjectTypeCharacteristic'
        customer:
          description: The Business Partner Number Legal Entity (BPNL) of the party
            requesting materials from a supplier.
          $ref: '#/components/schemas/urn_samm_io.catenax.shared.business_partner_number_1.0.0_BpnlTrait'
        supplier:
          description: The Business Partner Number Legal Entity (BPNL) of the party
            providing materials to a customer.
          $ref: '#/components/schemas/urn_samm_io.catenax.shared.business_partner_number_1.0.0_BpnlTrait'
      required:
      - commentId
      - objectId
      - objectType
      - customer
      - supplier
    InformationObject:
      description: Bundles all business objects in this property.
      type: array
      items:
        $ref: '#/components/schemas/IdBasedComment'
      uniqueItems: true
    Content:
      description: Object to bundle all transferred business objects.
      type: object
      properties:
        informationObject:
          description: Property to collect all transferred business objects.
          $ref: '#/components/schemas/InformationObject'
    IdBasedCommentWithHeader:
      description: An entity that combines the IdBasedComment with the message header data model in order to be compliant with the DCM standard for the exchange of a comment.
      type: object
      properties:
        messageHeader:
          description: The Capacity Group ID uniquely identifies the capacity group
            within the business relationship between a supplier and its customer.
          $ref: '#/components/schemas/MessageHeaderAspect'
        content:
          description: Bundles all business objects in this property.
          $ref: '#/components/schemas/Content'
  requestBodies:
    IdBasedComment:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IdBasedCommentWithHeader'