openapi: 3.0.0
paths:
  /v1/assets:
    get:
      operationId: v1_AssetsController_get
      summary: Anlagen abrufen
      parameters:
        - name: page
          required: false
          in: query
          description: Seitennummer
          schema:
            minimum: 1
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Einträge pro Seite
          schema:
            minimum: 1
            maximum: 100
            default: 10
            type: number
      responses:
        "200":
          description: Liste der Anlagen
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssetListDTO"
      tags:
        - Assets
      security:
        - ApiKeyAuth: []
info:
  title: Otark Management API
  description: ""
  version: "1.0"
  contact: {}
tags: []
servers:
  - url: https://api.otark.com
    description: Produktion
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
  schemas:
    AssetPricing:
      type: object
      properties:
        years:
          type: number
          description: Anzahl der Jahre
          example: 15
        price:
          type: number
          description: Preis der Anlage
          example: 14.55
      required:
        - years
        - price
    AssetListItem:
      type: object
      properties:
        id:
          type: string
          description: Eindeutige Kennung der Anlage
          example: ast_R4YRVPVqVqX2tbLu4jKGR
        name:
          type: string
          description: Name der Anlage
          example: Green Energy Package
        assetType:
          type: string
          description: Art der Anlage
          enum:
            - WIND
            - SOLAR
        nominalPower:
          type: number
          description: Nennleistung der Anlage in MW
          example: 10
        averageAnnualPower:
          type: number
          description: Durchschnittliche Jahreserzeugung in MWh
          example: 10400
        deliveryStart:
          type: string
          description: Beginn des Lieferzeitraums
          example: "2026-12-31T23:00:00.000Z"
        ppaType:
          type: string
          description: Art des PPA
          enum:
            - PAY_AS_NOMINATED
            - PAY_AS_PRODUCED
            - PAY_AS_FORECASTED
        additionalInfo:
          type: string
          description: Zusätzliche Angaben zur Anlage
          example: Includes maintenance and support
        state:
          type: string
          description: Bundesland, in dem die Anlage steht
          example: Berlin
        country:
          type: string
          description: Land, in dem die Anlage steht
          example: DE
        coverUrl:
          type: string
          description: URL des Titelbilds
          example: https://cdn.otark.com/asset-covers/abc.jpg
        pricing:
          description: Preisstaffel der Anlage
          type: array
          items:
            $ref: "#/components/schemas/AssetPricing"
      required:
        - id
        - name
        - assetType
        - nominalPower
        - averageAnnualPower
        - deliveryStart
        - ppaType
        - additionalInfo
        - state
        - country
        - pricing
    Pagination:
      type: object
      properties:
        page:
          type: integer
          description: Laufende Seitennummer (beginnend bei 1)
          example: 1
        limit:
          type: integer
          description: Höchstzahl der Einträge pro Seite
          example: 10
        total_items:
          type: integer
          description: Gesamtzahl der Einträge über alle Seiten
          example: 23
        total_pages:
          type: integer
          description: Gesamtzahl der Seiten
          example: 3
      required:
        - page
        - limit
        - total_items
        - total_pages
    AssetListDTO:
      type: object
      properties:
        assets:
          description: Liste der Anlagen
          type: array
          items:
            $ref: "#/components/schemas/AssetListItem"
        pagination:
          $ref: "#/components/schemas/Pagination"
      required:
        - assets
        - pagination
