openapi: 3.1.0
info:
  title: Wunder Stations User API
  description: |
    Retrieve end user relevant information about Stations.

    Stations provide an abstraction layer on smart stations, which allow for docking/undocking of vehicles.
  version: 1.0.0
  contact:
    name: Wunder Mobility GmbH
    url: 'https://wundermobility.com'
    email: info@wundermobility.com
servers:
  - url: 'https://{environment}.api.gourban.services/v1/{tenant}/smart-stations'
    description: Wunder Stations User API
    variables:
      environment:
        default: go
        enum:
          - go
          - go-staging
      tenant:
        default: demo
        description: Tenant identifier of your system. Usually 8 characters.
paths:
  /stations:
    get:
      summary: GET /stations
      operationId: getAllTenantStations
      parameters:
        - name: stationType
          in: query
          required: false
          schema:
            type: string
            enum:
              - DUCKT
            default: DUCKT
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StationDto'
  '/stations/{stationId}':
    get:
      summary: 'GET /stations/{stationId}'
      operationId: getStationById
      parameters:
        - name: stationId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StationDto'
components:
  schemas:
    Point:
      type: object
      x-stoplight:
        id: lxkhqefqru3se
      x-examples:
        Vienna:
          type: Point
          coordinates:
            - 16.363449
            - 48.210033
      description: Describes a single point on a coordinate system
      properties:
        type:
          type: string
          default: Point
          description: The type is always set to 'Point'
        coordinates:
          type: array
          description: 'Contains two values: `[lng,lat]`'
          items:
            type: number
            format: double
    OpeningTimeEntry:
      type: object
      properties:
        day:
          type: string
          enum:
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
            - SUNDAY
        slotNumber:
          type: integer
          format: int32
        state:
          type: string
          enum:
            - OPEN
            - CLOSED
        time:
          type: string
          format: partial-time
        prettyString:
          type: string
    OpeningInformation:
      type: object
      properties:
        openingTimeEntries:
          type: array
          items:
            $ref: '#/components/schemas/OpeningTimeEntry'
    VehicleDto:
      type: object
      properties:
        id:
          type: integer
          format: int64
        homeStationId:
          type: integer
          format: int64
        homeStationIds:
          type: array
          items:
            type: integer
            format: int64
        adapterUid:
          type: string
        externalId:
          type: string
        gurn:
          type: string
        portState:
          type: string
          enum:
            - UNDEFINED
            - UNLOCKED
            - LOCKED
    PortDto:
      type: object
      properties:
        id:
          type: integer
          format: int64
        status:
          type: string
          enum:
            - VACANT
            - OCCUPIED
            - OUT_OF_ORDER
        externalId:
          type: integer
          format: int64
        name:
          type: string
        types:
          type: string
          enum:
            - CHARGING
            - DOCKING
            - LOCKING
        vehicle:
          $ref: '#/components/schemas/VehicleDto'
    StationDto:
      type: object
      properties:
        id:
          type: integer
          format: int64
        stationUuid:
          type: string
        branchId:
          type: integer
          format: int64
        name:
          type: string
        description:
          type: string
        position:
          $ref: '#/components/schemas/Point'
        address:
          type: string
        type:
          type: string
          enum:
            - DUCKT
        phoneNumber:
          type: string
        openingInformation:
          $ref: '#/components/schemas/OpeningInformation'
        availablePortCount:
          type: integer
          format: int64
        totalPortCount:
          type: integer
          format: int64
        ports:
          type: array
          items:
            $ref: '#/components/schemas/PortDto'
        connectedVehicleExternalIds:
          type: array
          items:
            type: string
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
security:
  - jwtAuth: []
