get:
  operationId: get-submissions-for-pickup
  summary: Abholbereite Einreichungen auflisten
  description: Mit diesem Request werden alle abholbereiten Einreichungen sowie deren Zustellpunkte aufgelistet.
  tags:
    - Einreichungsempfang
  security:
    - OAuth2:
        - 'subscribe:destination:<id>'
  parameters:
    - $ref: '../../parameters/destinationIdInQuery.yaml'
    - $ref: '../../parameters/pagination/limit.yaml'
    - $ref: '../../parameters/pagination/offset.yaml'
  responses:
    '200':
      description: OK
      content:
        application/json:
          schema:
            $ref: '../../schemas/submissions-for-pickup.yaml'
          examples:
            Beispiel:
              $ref: '../../examples/submissions-for-pickup.yaml'
    '401':
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: '../../schemas/error.yaml'
    '403':
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: '../../schemas/error.yaml'

post:
  operationId: create-submission
  summary: Einreichung erstellen
  description: >
    Dieser Endpunkt ist der erste, initiale Schritt zum Erstellen einer Einreichung. Danach können Anlagen hochgeladen
    und schließlich die Einreichung an den Zustellpunkt versendet werden, der in diesem Endpunkt angegeben wurde.
  tags:
    - Einreichungsübermittlung
  security:
    - OAuth2:
        - 'send:region:DE<region-id>+send:service:<service-uri>'
        - 'send:region:DE<region-id>'
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../../schemas/create-submission.yaml'
        examples:
          Beispiel:
            $ref: '../../examples/create-submission.yaml'
  responses:
    '201':
      description: Created
      content:
        application/json:
          schema:
            $ref: '../../schemas/submission-created.yaml'
          examples:
            Beispiel:
              $ref: '../../examples/submission-created.yaml'
    '400':
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error.yaml
    '401':
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error.yaml
    '403':
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error.yaml
    '404':
      description: Destination not found
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error.yaml
    '413': # TODO: Check
      description: Request Entity Too Large
      content:
        application/problem+json:
          schema:
            $ref: ../../schemas/error.yaml