openapi: 3.1.0
info:
  title: Trip
  version: 2.0.0
  description: Schema definition for the Trip entity in the Beckn Mobility domain.
  license:
    name: CC-BY-NC-SA 4.0 International
    url: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    Trip:
      x-iri: https://schema.nfh.global/Trip/v2.0
      type: object
      title: Trip
      description: A confirmed and booked journey from an origin to a destination,
        representing a completed mobility service order.
      x-tags:
        - mobility
        - ride-hailing
      properties:
        tripId:
          description: Unique identifier for the trip
          type: string
        origin:
          description: Pickup location
          $ref: https://schema.nfh.global/Location/v2.0/attributes.yaml#/components/schemas/Location
        destination:
          description: Dropoff location
          $ref: https://schema.nfh.global/Location/v2.0/attributes.yaml#/components/schemas/Location
        startTime:
          description: Actual start time of the trip
          type: string
          format: date-time
        endTime:
          description: Actual end time of the trip
          type: string
          format: date-time
        distance:
          description: Total distance of the trip in kilometres
          type: number
        driverRef:
          description: Reference to the driver for this trip
          $ref: https://schema.nfh.global/Driver/v2.0/attributes.yaml#/components/schemas/Driver
        vehicleRef:
          description: Reference to the vehicle for this trip
          $ref: https://schema.nfh.global/Vehicle/v2.0/attributes.yaml#/components/schemas/Vehicle
        id:
          description: Unique identifier for the trip
          type: string
        descriptor:
          description: Human-readable description of the trip
          $ref: https://schema.nfh.global/Descriptor/v2.0/attributes.yaml#/components/schemas/Descriptor
      additionalProperties: false
