openapi: 3.1.1
info:
  title: RatingForm
  version: 2.0.0
  description: A form designed to capture rating and feedback from a user. This can
    be used by both BAP and BPP to fetch ratings and feedback of their respective
    users.
  license:
    name: CC-BY-NC-SA 4.0 International
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    RatingForm:
      x-iri: https://schema.nfh.global/RatingForm/v2.0
      description: A form designed to capture rating and feedback from a user. This
        can be used by both BAP and BPP to fetch ratings and feedback of their respective
        users.
      title: RatingForm
      x-tags:
      - common
      type: object
      properties:
        target:
          description: The entity being rated
          type: object
          properties:
            id:
              description: ID of the entity being rated (order/item/fulfillment/provider/agent).
              type: string
            ratingTargetType:
              description: What is being rated. This can be any entity in the order
                lifecycle that influenced the overall experience of the user
              type: string
              enum:
              - Order
              - Fulfillment
              - FulfillmentStage
              - Provider
              - Agent
        range:
          oneOf:
          - type: object
            properties:
              bestRating:
                description: Maximum of the rating scale (default 5 if omitted).
                type: number
              worstRating:
                description: Minimum of the rating scale (default 1 or 0 if omitted).
                type: number
          - type: array
            description: A custom rating range indexed from 0 to n
            items:
              type: object
              properties:
                index:
                  type: integer
                  minimum: 0
                value:
                  $ref: https://schema.nfh.global/Descriptor/v2.1/attributes.yaml#/components/schemas/Descriptor
        feedbackForm:
          description: A feedback form sent along with a rating request
          $ref: https://schema.nfh.global/Form/v2.1/attributes.yaml#/components/schemas/Form
        feedbackRequired:
          type: boolean
          description: Specifies whether feedback after rating is required for acceptance
            of rating
      required:
      - target
      - feedbackRequired
      additionalProperties: false
