openapi: 3.0.3
info:
  title: SSB API
  description: |-
    Schnittstellenbeschreibung SSB REST API.
    NOCH NICHT LIVE!
  contact:
    email: zz.sie.bad@swr.de
  version: 0.0.1
servers:
  - url: https://ssb.swr.ard/v1
tags:
  - name: kostenstellen
    description: Abfrage von Kostenstellen
  - name: kostenstellenHierarchie
    description: Abfrage der Kostenstellen Hierarchie
  - name: kostentraeger
    description: Abfrage von Kostenträgern (PSP-Elemente)
  - name: contentItem
    description: Abfrage von Content Items (Produktionsnummern)
paths:
  /kostenstellen:
    get:
      tags:
        - kostenstellen
      summary: Alle Kostenstellen abrufen
      responses:
        '200':
          description: Alle Kostenstellen
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Kostenstellen'
  /kostenstellen/{kostenstellenNummer}:
    get:
      tags:
        - kostenstellen
      summary: Kostenstellen nach Kostenstellennummer abrufen
      description: Wildcard Kostenstellen erlaubt?
      parameters:
        - name: kostenstellenNummer
          in: path
          description: Status values that need to be considered for filter
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Kostenstellen'
        '400':
          description: Invalid kostenstellennummer
  /kostenstellen-hierarchie:
    get:
      tags:
        - kostenstellenHierarchie
      summary: Alle Kostenstellen Hierarchien abrufen
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/KostenstellenHierarchie'
  /kostentraeger:
    get:
      tags:
        - kostentraeger
      summary: Alle Kostenstellen Hierarchien abrufen
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Kostentraeger'
  /content-item:
    get:
      tags:
        - contentItem
      summary: Alle Kostenstellen Hierarchien abrufen
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ContentItem'
 
components:
  schemas:
    Kostenstellen:
      type: object
      properties:
        kostenstellennummer:
          type: string
          example: 12123456
        kostenrechnungskreis:
          type: string
          example: 1000
        kostenstellendaten:  
          type: array
          items:
            type: object
            properties:
              gueltigAb:
                type: string
                example: 2022-01-01T00:00:00
              gueltigBis:
                type: string
                example: 2025-02-01T00:00:00
              bezeichnung:
                type: string
              beschreibung:
                type: string
                nullable: true
              verantwortlicher:
                type: string
              eMailVerantwortlicherBenutzer:
                type: string
                nullable: true
              abteilung:
                type: string
                nullable: true
              artDerKostenstelle:
                type: string
              hierarchiebereich:
                type: string
              buchungskreis:
                type: string
              nachfolgerkostenstelle:
                type: string
                nullable: true
              waehrung:
                type: string
              mengeFuehren:
                type: boolean
              primaerkostenIst:
                type: boolean
              primaerkostenPlan:
                type: boolean
              sekundaerkostenIst:
                type: boolean
              sekundaerkostenPlan:
                type: string
              erloeseIst:
                type: string
              erloesePlan:
                type: string
              name:
                type: string
                nullable: true
              name2:
                type: string
                nullable: true
              name3:
                type: string
                nullable: true
              name4:
                type: string
                nullable: true
              ort:
                type: string
                nullable: true
              alternativeKostenstellennummer:
                type: string
                nullable: true
  
    KostenstellenHierarchie:
      type: object
      properties:
        buchungskreis:
          type: string
          example: 1800
        kostenstellengruppe:
          type: array
          items:
            type: object
            properties:
              kostenstellengruppeId:
                type: string
                example: 18SWR
              kostenstellengruppeBezeichnung:
                type: string
                example: Südwestrundfunk
              uebergeordneteGruppeId:
                type: string
                nullable: true
              uebergeordneteGruppeBezeichnung:
                type: string
                nullable: true
        auspraegungsinformation:
          type: array
          items:
            type: object
            properties:
              hierarchieebene:
                type: number
                example: 1
              kostenstellennummer:
                type: string
                example: 0018420000
                nullable: true
  
    Kostentraeger:
      type: object
      properties:
        projektstrukturplanelement:
          type: string
        bezeichnung:
          type: string
        kostenrechnungskreis:
          type: string
        buchungskreis:
          type: string
        projektart:
          type: string
        systemstatus:
          type: string
        anforderndeKostenstellennummer:
          type: string
        angelegtAm:
          type: string
        datumLetzteAenderung:
          type: string
        echtBebuchteKostenstellennummer:
          type: string
        geschaeftsbereich:
          type: string
        kontierungselement:
          type: boolean
        objektklasse:
          type: string
        planungselement:
          type: boolean
        verantwortlicheKostenstellennummer:
          type: string
        bewilligung:
          type: object
          nullable: true
          properties:
            bewilligungsId:
              type: string
            verwendungsKostenstellennummer:
              type: string
            bewilligungstyp:
              type: string
            bewilligungsstatus:
              type: string
            haushaltsjahr:
              type: string
            endkostenstandGeplant:
              type: string
              nullable: true
            vertriebskanaelePlan:
              type: string
            erstsendungWiederholung:
              type: string
            programmgruppe:
              type: string
              nullable: true
        contentItem:
          type: object
          nullable: true
          properties:
            contentItemId:
              type: string
            anstalten:
              type: string
            barrierefreiheit:
              type: string
            entstehungsartHerkunft:
              type: string
            finanzierungsbeteiligungDurchExternePartner:
              type: boolean
            gemeinsameVerguetungsregeln:
              type: boolean
            greenproduction:
              type: boolean
            medienfoerderung:
              type: string
            praesentationsformen:
              type: string
            produktionsrhythmus:
              type: string
            programminhalte:
              type: string
            rechteumfang:
              type: string
            zielgruppe:
              type: string
            kostentraegerart:
              type: string
            outputmengeAnzahlPlanFolgen:
              type: number
            outputmengePlanMinuten:
              type: number
            outputmengeGesamt:
              type: number
            produktionsjahr:
              type: string
            produktionstitel:
              type: string
            produktionsuntertitel:
              type: string
              nullable: true
            zeitraumProduktionStart:
              type: string
              nullable: true
            zeitraumProduktionEnde:
              type: string
              nullable: true
            erstellenderBuchungskreisContentItem:
              type: string
            freigabeVerwendungAndereBuchungskreise:
              type: boolean
            fertigstellungsdatum:
              type: string
              nullable: true
            rfaMedieninhalte:
              type: object
              nullable: true
              properties:
                finanzierung:
                  type: string
                contentObjektId:
                  type: string
                kostenstellennummer:
                  type: string
                markeWelle:
                  type: string
                repertoirefaehig:
                  type: boolean
                sendetitel:
                  type: string
                  nullable: true
                alternativerIdentifikator:
                  type: string
                  nullable: true
                inaktiv:
                  type: boolean
                coProduktionspartner:
                  type: boolean
              
    ContentItem:
      type: object
      properties:
        aenderungsdatum:
          type: string
          example: 2022-01-01T00:00:00
        abrufjahr:
          type: string
        gueltigVon:
          type: string
          example: 2022-01-01T00:00:00
        gueltigBis:
          type: string
          example: 2022-01-01T00:00:00
        contentItemId:
          type: string
          example: "00000253"
        controllingBrid:
          type: string
          nullable: true
        bezeichnung:
          type: string
        anstalten:
          type: string
          example: "0018"
        barrierefreiheit:
          type: string
          example: "0009"
        entstehungsartHerkunft:
          type: string
          example: "0010"
        finanzierungsbeteiligungDurchExternePartner:
          type: boolean
        gemeinsameVerguetungsregeln:
          type: string
          example: 1000
        greenproduction:
          type: boolean
        medienfoerderung:
          type: string
          example: "0003"
        praesentationsformen:
          type: string
          example: "0013"
        produktionsrhythmus:
          type: string
          example: "0001"
        programminhalte:
          type: string
          example: "0020"
        rechteumfang:
          type: string
          example: "0001"
        zielgruppe:
          type: string
          example: "0001"
        kostentraegerart:
          type: string
          example: "EKOPV"
        outputmengeAnzahlPlanFolgen:
          type: number
          example: 5
        outputmengePlanMinuten:
          type: number
          example: 10
        outputmengeGesamt:
          type: number
          example: 50
        outputmengeneinheit:
          type: string
          example: MIN
        produktionsjahr:
          type: string
          example: 2022
        produktionstitel:
          type: string
        produktionsuntertitel:
          type: string
          nullable: true
        zeitraumProduktionStart:
          type: string
          nullable: true
          example: 2022-01-01T00:00:00
        zeitraumProduktionEnde:
          type: string
          nullable: true
          example: 2022-01-01T00:00:00
        erstellenderBuchungskreisContentItem:
          type: string
          example: "1300"
        freigabeVerwendungAndereBuchungskreise:
          type: boolean
        fertigstellungsdatum:
          type: string
          nullable: true
          example: 2022-01-01T00:00:00
        rfaMedieninhalte:
          $ref: '#/components/schemas/RfaMedieninhalte'
          
    RfaMedieninhalte:
      type: object
      properties:
        gueltigVon:
          type: string
          example: 2022-01-01T00:00:00
        gueltigBis:
          type: string
          example: 2022-01-01T00:00:00
        finanzierung:
          type: string
        kostenstellennummer:
          type: string
        markeWelle:
          type: string
        repertoirefaehig:
          type: boolean
        sendetitel:
          type: string
          nullable: true
        alternativerIdentifikator:
          type: string
          nullable: true
        inaktiv:
          type: boolean
        coProduktionspartner:
          type: boolean
        geplanteDatenErstpublikation:
          type: string
        clusterId:
          type: string
          nullable: true
        clusterBezeichnung:
          type: string
          nullable: true
        contentObjektId:
          type: string
          nullable: true
        contentBezeichnung:
          type: string
          nullable: true