openapi: 3.0.1
info:
  title: certification check
  description: QS certification check rest service
  contact:
    name: 'QS Qualität und Sicherheit GmbH '
    url: http://www.q-s.de/
    email: info@q-s.de
  version: 1.0.0
servers:
- url: https://qs-plattform.de/QSSoftware/rest/search
  description: Production server
- url: https://test.qs-plattform.de/QSSoftware/rest/search
  description: Test server
tags:
- name: certification check
paths:
  /check/{location_id}:
    get:
      summary: checks the location
      description: checks the location with all scopes
      operationId: check
      parameters:
      - name: location_id
        in: path
        description: location id
        required: true
        schema:
          type: string
      responses:
        "200":
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/certificate'
        "404":
          description: not found
  /check/{location_id}/{scope}:
    get:
      summary: checks the location and scope
      description: checks the location with the submitted scope
      operationId: check_1
      parameters:
      - name: location_id
        in: path
        description: location id
        required: true
        schema:
          type: string
      - name: scope
        in: path
        description: scope
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/certificate'
        "404":
          description: not found
components:
  schemas:
    certificate:
      required:
      - certification_scheme
      - location_id
      - scope
      - state
      type: object
      properties:
        location_id:
          type: string
        scope:
          type: integer
          format: int32
        certification_scheme:
          type: string
          enum:
          - QS
          - QMMILCH
          - ITW
          - OTHER
        state:
          type: string
          enum:
          - CERTIFIED
          - NOT_CERTIFIED
          - STANDARD
          - QM_PLUS
          - QM_2PLUS_HF3
          - QM_3PLUS_HF4
        blockage:
          type: array
          items:
            type: string
            enum:
            - INACTIVE
            - COMPLAINT
            - PREFAT
            - UNOCCUPIED
            - BLOCKED
        regio:
          type: string
          enum:
          - APPLICANT
          - CERTIFIED
          - NOT_CERTIFIED
          - BLOCKED
        fias:
          type: string
          enum:
          - APPLICANT
          - CERTIFIED
          - NOT_CERTIFIED
          - BLOCKED
        family:
          type: boolean
        hkzd:
          type: string
          enum:
          - APPLICANT
          - CERTIFIED
          - NOT_CERTIFIED
          - BLOCKED
        fin_bio:
          type: string
          enum:
          - APPLICANT
          - CERTIFIED
          - NOT_CERTIFIED
          - BLOCKED
        fin_water:
          type: string
          enum:
          - APPLICANT
          - CERTIFIED
          - NOT_CERTIFIED
          - BLOCKED
        fin_trading:
          type: string
          enum:
          - APPLICANT
          - CERTIFIED
          - NOT_CERTIFIED
          - BLOCKED
        fin_energy:
          type: string
          enum:
          - APPLICANT
          - CERTIFIED
          - NOT_CERTIFIED
          - BLOCKED
        ggn_nr:
          type: string
        thkg_nr:
          type: string
        diagnostic_data:
          type: boolean
        free_range:
          type: boolean
        ' identity':
          type: string
          enum:
          - FATTENING
          - BIRTH
        crops:
          type: array
          items:
            type: string
        milk_only:
          type: boolean
        allowed_to_deliver_until:
          type: string
          format: yyyy-MM-dd
