openapi: 3.0.0
paths:
  /v1/assets:
    get:
      operationId: v1_AssetsController_get
      summary: Get assets
      parameters:
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            minimum: 1
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Items per page
          schema:
            minimum: 1
            maximum: 100
            default: 10
            type: number
      responses:
        "200":
          description: Assets list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssetListDTO"
      tags:
        - Assets
      security:
        - ApiKeyAuth: []
  /v1/demands:
    get:
      operationId: v1_DemandsController_get
      summary: Get demands
      parameters:
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            minimum: 1
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Items per page
          schema:
            minimum: 1
            maximum: 100
            default: 10
            type: number
      responses:
        "200":
          description: Demands list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DemandListDTO"
      tags:
        - Demands
      security:
        - ApiKeyAuth: []
info:
  title: Otark API
  description: ""
  version: "1.0"
  contact: {}
tags: []
servers:
  - url: https://api.otark.com
    description: Production
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
  schemas:
    AssetPricing:
      type: object
      properties:
        years:
          type: number
          description: Number of years
          example: 15
        price:
          type: number
          description: Price of the asset
          example: 14.55
      required:
        - years
        - price
    AssetListItem:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the asset
          example: ast_R4YRVPVqVqX2tbLu4jKGR
        name:
          type: string
          description: Name of the asset
          example: Green Energy Package
        assetType:
          type: string
          description: Type of asset
          enum:
            - WIND
            - SOLAR
        nominalPower:
          type: number
          description: Nominal power of the asset in MW
          example: 500
        averageAnnualPower:
          type: number
          description: Average annual power generation in MWh
          example: 4500
        deliveryStart:
          type: string
          description: Start date of the delivery period
          example: "2000-01-01T00:00:00.000Z"
        ppaType:
          type: string
          description: Type of PPA
          enum:
            - PAY_AS_NOMINATED
            - PAY_AS_PRODUCED
            - PAY_AS_FORECASTED
        additionalInfo:
          type: string
          description: Additional information about the asset
          example: Includes maintenance and support
        state:
          type: string
          description: State where the asset is located
          example: Berlin
        country:
          type: string
          description: Country where the asset is located
          example: DE
        coverUrl:
          type: string
          description: Cover asset URL
          example: https://cdn.otark.com/asset-covers/abc.jpg
        pricing:
          description: Pricing of the asset
          type: array
          items:
            $ref: "#/components/schemas/AssetPricing"
      required:
        - id
        - name
        - assetType
        - nominalPower
        - averageAnnualPower
        - deliveryStart
        - ppaType
        - additionalInfo
        - state
        - country
        - pricing
    AssetListDTO:
      type: object
      properties:
        assets:
          description: List of assets
          type: array
          items:
            $ref: "#/components/schemas/AssetListItem"
      required:
        - assets
    DemandListItemDTO:
      type: object
      properties:
        id:
          type: string
          example: dem_KKbRxNEDjBFFlnX1Khiaw
          description: The unique identifier of the demand
        contractPeriod:
          type: number
          example: 12
          description: The desired contract period in months
        deliveryVolume:
          type: number
          example: 100
          description: The desired delivery volume in MWh
        additionalInfo:
          type: string
          example: Additional information about the demand
          description: Additional info
        country:
          type: string
          example: DE
          description: The country of the demand
        state:
          type: string
          example: Berlin
          description: The state of the demand
        deliveryStart:
          format: date-time
          type: string
          example: "2000-01-01T00:00:00.000Z"
          description: The start date of delivery
      required:
        - id
        - contractPeriod
        - deliveryVolume
        - additionalInfo
        - country
        - state
        - deliveryStart
    DemandListDTO:
      type: object
      properties:
        demands:
          description: List of demands
          type: array
          items:
            $ref: "#/components/schemas/DemandListItemDTO"
      required:
        - demands
