asyncapi: 2.0.0
info:
  title: eBay Feedback Received Notifications
  version: 1.0.0
  description: 'This contract defines the payload for eBay feedback received notification. The service dispatches notifications to users when they receive a feedback from another user.'
channels:
  FEEDBACK_RECEIVED:
    subscribe:
      message:
        $ref: '#/components/messages/message'
      bindings:
        http:
          type: request
          method: POST
          headers:
            type: object
            properties:
              Content-Type:
                type: string
                enum: ['application/json']
components:
  messages:
    message:
      headers:
        type: object
        properties:
          X-EBAY-SIGNATURE:
            description: ECC message signature
            type: string
      payload:
        type: object
        properties:
          metadata:
            $ref: '#/components/schemas/MetaData'
          notification:
            $ref: '#/components/schemas/Notification'

  schemas:
    MetaData:
      type: object
      properties:
        topic:
          type: string
          description: 'The notification topic to which the user or application is subscribed.'
        schemaVersion:
          type: string
          description: 'The schema version for this topic.'
        deprecated:
          type: boolean
          description: 'An indication regarding whether the schema version or topic is deprecated.'
          default: 'false'

    Notification:
      type: object
      properties:
        notificationId:
          type: string
          description: 'The unique identifier for the notification topic.'
        eventDate:
          type: string
          description: 'The event date associated with the notification. This date is returned as a UTC-formatted timestamp.'
        publishDate:
          type: string
          description: 'The publish date for the notification message. This date is returned as a UTC-formatted timestamp.'
        publishAttemptCount:
          type: integer
          description: 'The number of attempts that have been made to publish this notification message.'
        data:
         $ref: '#/components/schemas/FeedbackData'

    FeedbackData:
      type: object
      description: "The payload for the Feedback Received notification."
      properties:
        receiverUserDetail:
          type: object
          description: "Information about the user who received the feedback."
          properties:
              userId:
                type: string
                description: "The unique, public identifier for the user who received the feedback."
              role:
                type: string
                description: "The role of the feedback receiver."
                enum:
                  - BUYER
                  - SELLER
        
        feedbackDetail:
            type: object
            description: "Details of the feedback received by the user."
            properties:
              feedbackId:
                type: string
                description: "The unique feedback id of the feedback received by the user."
              orderLineItemSummary:
                type: object
                description: "Summary of the listing transaction."
                properties:
                  orderLineItemId:
                    type: string
                    description: "This is the concatenation of the listingId and transactionId of an order, represented as `listingId-transactionId`."
                  listingId:
                    type: string
                    description: "The unique id of the listing for which feedback has been received."
                  listingTitle:
                    type: string
                    description: "The title of the listing for which feedback has been received."
                  listingPrice:
                      type: object
                      description: "The price information of the item for which feedback has been received."
                      properties:
                        currency:
                          type: string
                          description: "The currency of the item."
                        value:
                          type: number
                          description: "The value of the item."
              commentType:
                description: "The type of feedback being received."
                type: string
                enum:
                  - POSITIVE
                  - NEUTRAL
                  - NEGATIVE
              feedbackComment:
                type: object
                description: "The feedback comment received by the user."
                properties:
                  commentText:
                    type: string
                    description: "The text of the feedback comment."
                  state:
                    type: string
                    description: "The state of the feedback comment. This can be different from the feedbackState field."
                    enum:
                      - ENTERED
                      - WITHDRAWN
                      - HIDDEN
                      - REVISED
                      - REVISION_OPEN
                      - REVISION_DECLINED_OR_EXPIRED
              replyComment:
                type: object
                description: "feedback reply comment."
                properties:
                  commentText:
                    type: string
                    description: "The text of the reply comment."
                  state:
                    type: string
                    description: "The status of the reply comment."
                    enum:
                      - ENTERED
                      - WITHDRAWN
                      - HIDDEN
                      - REVISED
                      - REVISION_OPEN
                      - REVISION_DECLINED_OR_EXPIRED
              followupComment:
                type: object
                description: "The feedback follow up comment."
                properties:
                  commentText:
                    type: string
                    description: "The text of the follow up comment."
                  state:
                    type: string
                    description: "The status of the follow up comment."
                    enum:
                      - ENTERED
                      - WITHDRAWN
                      - HIDDEN
                      - REVISED
                      - REVISION_OPEN
                      - REVISION_DECLINED_OR_EXPIRED
              providerUserDetail:
                type: object
                description: "Information about the user who provided the feedback."
                properties:
                  userId:
                    type: string
                    description: "The unique, public identifier of the user who provided the feedback."
                  role:
                    type: string
                    description: "The role of the user who provided the feedback."
                    enum:
                      - BUYER
                      - SELLER
                  feedbackScore:
                    type: integer
                    description: "The numeric feedback score of the feedback provider."
              feedbackState:
                  type: string
                  description: "The state of the entire feedback as a whole."
                  enum:
                      - ENTERED
                      - DESCORED
                      - MUTUAL_WITHDRAWAL_INITIATED
                      - FEEDBACK_REVISION_OPEN
                      - FEEDBACK_REVISION_CLOSED
              feedbackEnteredDate:
                  type: string
                  description: "The date when the feedback was entered. This date is returned as a UTC-formatted timestamp."

