openapi: 3.0.3
info:
  title: simap
  description: |

    *Project KISSimap.ch*

    ### Changelog
    The version changelog can be found [here](/api/specifications/changelog.html).

    ### Quick Guide Authorisation Code Flow
    A Quick guide for the Authorization Code Flow used in simap.ch can be found here [here](https://simap-public.s3-ch-bern-1.obj.begasoft.ch/api-assets/Quick_Guide_OAuthFlow.pdf).

    # Management Summary for API
    The API of the new simap.ch platform is documented on this page. It is open to all organizations for connecting their applications to simap.ch.
    **Please note:** Slight differences between the APIs of INT and PROD may occur as new functionalities available on the INT environment may not yet exist on the production environment (PROD). Please compare the API versions of INT and PROD and consult the changelog for differences.
    In the following, the API’s functions are summarized depending on the user’s role

    ## Vendor
    Vendors are provided with all the functions needed to find procurement projects and to participate to the tendering process. This includes:
    * registering the vendor organization and confirming or refusing user’s applications to join the vendor organization
    * searching for publications using keywords and filter criteria, getting the publication details
    * expressing interest to a procurement project
    * downloading the tender documents
    * asking questions and seeing the answers given by the procurement office
    * creating subscriptions
    * manage generic vendor documents in vendor profile
    * manage digital submissions of own vendor

    ## Procurement office
    Procurement offices have the functions needed to publish and manage procurement projects, including:
    * registering the procurement office, adding it to a public institution and confirming or refusing user’s applications to join the procurement office
    * creating procurement projects using an open or a selective procedure
    * structuring the procurement in lots
    * managing and using publication templates
    * creating and publishing tenders, competitions or studies, abandonments, revocations, corrections, participant selections or offering phases in selective procedures. Publications are created and edited as drafts which are then submitted for publication at the chosen publication date.
    * managing translations of publications
    * asking questions and answering to questions
    * sending mail messages to all interested vendors
    * registering offer entry and creating participation and offer protocols
    * manage external vendor submissions
    * open and access digital vendor submissions

    ## Competence centres
    The functions for competence centers include:
    * managing publication templates, remedies notice templates, contact information and publication date exceptions
    * the impersonate function that allows a user to take on the role of another user in order to give assistance

    ## General functions
    The API contains other functions available to all users regardless of their role:
    * registering as a user to create a personal account
    * applying for collaboration to a vendor organization, a procurement office, or a competence center
    * getting information like lists of cantons, countries, languages, TED-activities, and predefined selection criteria

    ## Technical information

    ### General design decisions:
    * `PUT/POST/PATCH return updated entity`: Can help keeping state in UI consistent.
    * `No toplevel arrays for lists`: The API never returns an array as toplevel element even if the resulting list is unpaged. This keeps the design consistent with paged lists.
    * `Domain before version: /me/v1 (not /v1/me)`. This makes it easier for a single backend version to implement two versions at the same time as only the changing part has to be implemented twice.

    ### Timezone
    All date and time fields defined by the API are meant to be relative to the time zone `Europe/Zurich` and to the winter-/summertime offsets at the selected date.

    ### Extensions for code-generation
    With the following extension values on an endpoint we improve the code generation, these values are implemented in modified generator templates
    * `x-roles` - code generator advice that describes the roles that have access to that endpoint, no roles = no restrictions
    * `x-spring-jsonnode-requestbody` - code generator advice to override the request body type, replace it with a JsonObject
    * `x-generic-response-body` - code generator advice to override the response type, replace it with the defined API model
      * `model` - the name of the API model that acts as an interface
    * `x-spring-plain-multipart-request` - code generator advice to override handling of multipart form handling
    * `x-service-returns-response` - service responds with ResponseEntity to provide more control within the service
    * `x-extra-annotation` - adds an extra annotation to a property typically used to add custom validations (see custom validations further below)
    * `x-streaming-response-body` - code generator advice to support generating streaming based response type like StreamingResponseBody in spring based frameworks

    Used custom string formats:
    * `time`, represents a local time with the following precision `hh:mm` e.g. `13:15`
    * `url`, represents a URL, needs to comply with regex:
      `^https?:\/\/(?:www\.)?(?:xn--)?[a-z0-9]+(?:[-.](?:xn--)?[a-z0-9]+){0,100}\.[a-z]{2,63}(?::\d{1,5})?(?:[/?#]\S*)?$`
    * `fileName`, needs to comply with regex: 
      `^(?!(CON|PRN|AUX|NUL|COM0|COM1|COM2|COM3|COM4|COM5|COM6|COM7|COM8|COM9|COM¹|COM²|COM³|LPT0|LPT1|LPT2|LPT3|LPT4|LPT5|LPT6|LPT7|LPT8|LPT9|LPT¹|LPT²|LPT³)(\.|$))([^\x00-\x1F<>:"/\\|?*]){0,198}[^\x00-\x1F<>:"/\\|?* .]$`
      see also https://learn.microsoft.com/en-gb/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#file-and-directory-names
    * `fileNamePathStripped`, accepts that a file name is prefixed with a path but strips it to get the file name, i.e. ignores the path. For instance, foo/bar.txt will become bar.txt
    * `cpvCode`, string compatible with cpvCode regex `^[0-9]{8}$`
    * `bkpCode`, string compatible with bkpCode regex `^[0-9]{1,3}(\.[0-9]$|$)`
    * `ebkphCode`, string compatible with ebkphCode regex `^[A-Z](\s\d|\d|$).*`
    * `ebkptCode`, string compatible with ebkptCode regex `^[A-Z](\s\d|\d|$).*`
    * `npkCode`, string compatible with npkCode regex `^[0-9]{3}$`
    * `oagCode`, string compatible with oagCode regex `^((\d{1,3})(\.|$)){1,3}$`
    * `html`, XHTML-based string, only a very limited set of XHTML tags can be used:
        * `a` (including href, rel and target attributes)
        * `ul`, `ol`, `li`
        * `b`, `i`, `u`, `em`, `strong`
        * `p`, `br`
        
        the following protocols are allowed for `a`:
        * `http(s)`
        * `mailto`
        * `tel`
        * `callto`

    Used custom number formats:
     * `price`, represents a number with the precision of a price (2 digits), i.e `123.65`

    ### Streaming based json
    We support media type `application/x-ndjson` to be able to support possibly large json responses in a memory efficient way. Ndjson is a format of chunked json, separated by line. 
    In the description of those endpoints we refer to the specific model which is compatible to every non-empty json value returned in the response.
    Please see https://github.com/ndjson/ndjson-spec for more details.

    ### Custom Validations
    - In general, an array is not allowed to contain `null` as entry.
    - EmailList: each email in the array needs to comply with regex: `^(([^<>()\[\].,;:\s@"]+(\.[^<>()\[\].,;:\s@"]+)*)|(".+"))@(([^<>()\[\].,;:\s@"]+\.)+[^<>()\[\].,;:\s@"]{2,})$`
    - Url: needs to comply with regex: `^https?:\/\/(?:www\.)?(?:xn--)?[a-z0-9]+(?:[-.](?:xn--)?[a-z0-9]+){0,100}\.[a-z]{2,63}(?::\d{1,5})?(?:[/?#]\S*)?$`
    - TedSendableAddress: all required fields need to be set in contrast to partially defined addresses, i.e. if you patch and also send a corresponding address property, then you need to patch all required fields, you cannot reset some of them to null respectively).
  version: 1.5.1
  license:
    name: proprietary software license
    url: https://simap.ch
servers:
  - url: /api
security:
  - SimapOIDC:
      - subscription_user
      - procurement_project_contributor
      - procurement_user
      - procurement_admin
      - vendor_user
      - vendor_admin
      - competence_centre_print_user
      - competence_centre_admin
      - simap_admin
tags:
  - name: pub-draft
    description: Endpoints dedicated to managing pub-drafts, including creation, editing, and the overall publication workflow
  - name: pub-draft-tender
    description: Endpoints for managing and refining tender-specific information in pub-draft
  - name: pub-draft-study-contract
    description: Endpoints for managing and refining study-contract-specific information in pub-draft
  - name: pub-draft-competition
    description: Endpoints for managing and refining competition-specific information in pub-draft
  - name: pub-draft-participant-selection
    description: Endpoints for managing and refining participant-selection-specific information in pub-draft
  - name: pub-draft-selective-offering-phase
    description: Endpoints for managing and refining selective-offering-phase-specific information in pub-draft
  - name: pub-draft-rfi
    description: Endpoints for managing and refining request-for-information-specific information in pub-draft
  - name: pub-draft-award
    description: Endpoints for managing and refining award-specific information in pub-draft
  - name: pub-draft-correction
    description: Endpoints for managing and refining correction-specific information in pub-draft
  - name: pub-draft-revocation
    description: Endpoints for managing and refining revocation-specific information in pub-draft
  - name: pub-draft-abandonment
    description: Endpoints for managing and refining abandonment-specific information in pub-draft
  - name: publications
    description: Endpoints for viewing publications with visibility details depending on role
  - name: institutions
    description: Get and search through a hierarchical institution tree of comp-centres and proc-offices
  - name: comp-centres
    description: Endpoints for managing comp-centres and executing actions related to comp-centre-roles
  - name: comp-centre-publishers
    description: Endpoints for managing publishers
  - name: publishers
    description: Get list of publishers
  - name: proc-office
    description: Endpoints for managing proc-offices and executing actions related proc-office-roles
  - name: proc-office-projects
    description: Endpoints for managing projects as a proc-office member
  - name: qnas
    description: Endpoints for managing questions and answers organised in rounds
  - name: roles
    description: Get and set roles of a user
  - name: user
    description: Endpoints for managing my user information and impersonating other users
  - name: subscriptions
    description: Endpoints for managing subscriptions of my user
  - name: project-documents
    description: Endpoints to download documents from projects
  - name: vendor
    description: Endpoints for managing vendors and executing actions related vendor-roles
  - name: vendor-projects
    description: Endpoints for viewing projects relevant to vendor and modify the notification-settings
  - name: vendor-submissions
    description: Endpoints for managing digital submission as a vendor for a project
  - name: vendor-submission-documents
    description: Endpoints for uploading documents for a specific digital submission
  - name: vendor-documents
    description: Endpoints for uploading documents as a vendor which can be (re)used for project-submissions
  - name: statistics
    description: Endpoints for getting different kinds of statistics
  - name: static-content
    description: Endpoints to control static page content (Content Management)
  - name: codes
    description: Get and search lists of different nomenclature codes of procurement
  - name: util
    description: Endpoints for getting metadata of the system
  - name: test
    description: Endpoints to minimise test expenses, providing shortcuts to specific application states
  - name: sustainability-triggers
    description: Endpoints for the sustainability triggers management for competence centres
paths:
  /cantons/v1:
    get:
      summary: Get the list of cantons
      operationId: listCantons
      tags:
        - util
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cantons'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /countries/v1:
    get:
      summary: Get the list of countries
      operationId: listCountries
      tags:
        - util
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Countries'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /languages/v1:
    get:
      summary: Get the list of languages
      operationId: listLanguages
      tags:
        - util
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Languages'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /activities/v1:
    get:
      summary: Get the list of main activities as defined by TED (Tenders Electronic Daily)
      operationId: listActivities
      tags:
        - util
      externalDocs:
        description: TED-Codes
        url: https://op.europa.eu/en/web/eu-vocabularies/concept-scheme/-/resource?uri=http://publications.europa.eu/resource/authority/main-activity
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MainActivities'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /criteria/v1:
    get:
      summary: Get the list of predefined criteria
      operationId: listCriteria
      tags:
        - util
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Criteria'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /sustainability-form/v1/mappings:
    get:
      summary: Get sustainability form question to form type mappings
      operationId: getSustainabilityFormMappings
      tags:
        - util
      x-roles:
        - procurement_admin
        - procurement_user
        - procurement_project_contributor
        - competence_centre_admin
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SustainabilityFormMappings'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/cpv:
    get:
      summary: Get the list of cpv (Common Procurement Vocabulary) codes
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: listCPVCodes
      tags:
        - codes
      parameters:
        - in: query
          name: parentCode
          schema:
            type: string
            example: '03111400'
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CPVCodes'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/cpv/search:
    get:
      summary: find cpv (Common Procurement Vocabulary) codes by partial number or name
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: findCPVCodes
      tags:
        - codes
      parameters:
        - in: query
          name: query
          schema:
            type: string
            example: office
            minLength: 1
          description: You can use partial numbers, words or sentences for the query. If the query starts with a number only for the codes is searched
          required: true
        - in: query
          name: language
          schema:
            $ref: '#/components/schemas/SystemLanguage'
          description: Language to search in, if not provided, defaults to german
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CPVCodesSearchResults'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v2/cpc:
    get:
      summary: Get the list of cpc (Central Product Classification) codes
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: listCPCCodes
      tags:
        - codes
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CPCCodes'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/bkp:
    get:
      summary: Get the list of bkp (Baukostenplan) codes
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: listBKPCodes
      tags:
        - codes
      parameters:
        - in: query
          name: parentCode
          schema:
            type: string
            example: '003.4'
            maxLength: 5
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BKPCodes'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/bkp/search:
    get:
      summary: find bkp (Baukostenplan) codes by partial number or name
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: findBKPCodes
      tags:
        - codes
      parameters:
        - in: query
          name: query
          schema:
            type: string
            example: Nebenkosten
            minLength: 1
          description: You can use partial numbers, words or sentences for the query. If the query starts with a number only for the codes is searched
          required: true
        - in: query
          name: language
          schema:
            $ref: '#/components/schemas/SystemLanguage'
          description: Language to search in, if not provided, defaults to german
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BKPCodesSearchResults'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/npk:
    get:
      summary: Get the list of npk (Normpositionen-Katalog) codes
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: listNPKCodes
      tags:
        - codes
      parameters:
        - in: query
          name: parentCode
          schema:
            type: string
            example: '003.4'
            maxLength: 5
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NPKCodes'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/npk/search:
    get:
      summary: find npk (Normpositionen-Katalog) codes by partial number or name
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: findNPKCodes
      tags:
        - codes
      parameters:
        - in: query
          name: query
          schema:
            type: string
            example: Pfähle
            minLength: 1
          description: You can use partial numbers, words or sentences for the query. If the query starts with a number only for the codes is searched
          required: true
        - in: query
          name: language
          schema:
            $ref: '#/components/schemas/SystemLanguage'
          description: Language to search in, if not provided, defaults to german
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NPKCodesSearchResults'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/ebkp-t:
    get:
      summary: Get the list of ebkp-t (Elementbasierter Baukostenplan Tiefbau) codes
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: listEBKPTCodes
      tags:
        - codes
      parameters:
        - in: query
          name: parentCode
          schema:
            type: string
            example: J
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EBKPTCodes'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/ebkp-t/search:
    get:
      summary: find ebkp-t (Elementbasierter Baukostenplan Tiefbau) codes by partial number or name
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: findEBKPTCodes
      tags:
        - codes
      parameters:
        - in: query
          name: query
          schema:
            type: string
            example: Kunst
            minLength: 1
          description: You can use partial numbers, words or sentences for the query. If the query starts with a number only for the codes is searched
          required: true
        - in: query
          name: language
          schema:
            $ref: '#/components/schemas/SystemLanguage'
          description: Language to search in, if not provided, defaults to german
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EBKPTCodesSearchResults'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/ebkp-h:
    get:
      summary: Get the list of ebkp-h (Elementbasierter Baukostenplan Hochbau) codes
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: listEBKPHCodes
      tags:
        - codes
      parameters:
        - in: query
          name: parentCode
          schema:
            type: string
            example: J
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EBKPHCodes'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/ebkp-h/search:
    get:
      summary: find ebkp-h (Elementbasierter Baukostenplan Hochbau) codes by partial number or name
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: findEBKPHCodes
      tags:
        - codes
      parameters:
        - in: query
          name: query
          schema:
            type: string
            example: Kunst
            minLength: 1
          description: You can use partial numbers, words or sentences for the query. If the query starts with a number only for the codes is searched
          required: true
        - in: query
          name: language
          schema:
            $ref: '#/components/schemas/SystemLanguage'
          description: Language to search in, if not provided, defaults to german
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EBKPHCodesSearchResults'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/oag:
    get:
      summary: Get the list of oag (Objektarten-Gliederung) codes
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: listOAGCodes
      tags:
        - codes
      parameters:
        - in: query
          name: parentCode
          schema:
            type: string
            example: '1.10'
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAGCodes'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /codes/v1/oag/search:
    get:
      summary: find oag ( Objektarten-Gliederung) codes by partial number or name
      description: |
        More details about the code can be found in the confluence [Nomenklaturen - Übersicht](https://projects.unic.com/x/6A1vBg)
      operationId: findOAGCodes
      tags:
        - codes
      parameters:
        - in: query
          name: query
          schema:
            type: string
            example: Büro
            minLength: 1
          description: You can use partial numbers, words or sentences for the query. If the query starts with a number only for the codes is searched
          required: true
        - in: query
          name: language
          schema:
            $ref: '#/components/schemas/SystemLanguage'
          description: Language to search in, if not provided, defaults to german
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAGCodesSearchResults'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /institutions/v1/institutions:
    get:
      summary: Get the institutions tree as flat list
      operationId: listInstitutions
      tags:
        - institutions
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Institutions'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /institutions/v1/institutions/{institutionId}:
    parameters:
      - in: path
        name: institutionId
        schema:
          type: string
          format: uuid
        required: true
        description: Id of the institution, can be obtained by GET `/institutions/v1/institutions`
    get:
      summary: Get details for single institution
      operationId: getInstitutionById
      tags:
        - institutions
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Institution'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1:
    get:
      parameters:
        - in: query
          name: search
          schema:
            type: string
            minLength: 3
          required: true
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
      summary: Search for users by first name, last name or email
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query, the last item can be found in the first result.
        For the user-search the item represents the email-address, as the results are ordered by it and it's the primary identification.
        If no more results are available the api returns an empty list or one with fewer items than the specified itemsPerPage.
      operationId: searchUsers
      x-roles:
        - simap_admin
        - competence_centre_admin
      tags:
        - user
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersSearchResult'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/all:
    get:
      summary: Retrieve all users according to your permission
      description: |
        chunked json of `UserRoleExport`, separated by line.
      operationId: exportAllUsers
      x-roles:
        - simap_admin
        - competence_centre_admin
      tags:
        - user
      x-service-returns-response: true
      x-streaming-response-body: true
      responses:
        '200':
          description: ok
          content:
            application/x-ndjson:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/user/{userId}:
    parameters:
      - in: path
        name: userId
        schema:
          type: string
          format: uuid
        required: true
        description: Id of the user, can be obtained by GET on /users/v1
    get:
      summary: Get details for single user
      operationId: getUserById
      x-roles:
        - procurement_admin
        - procurement_user
        - competence_centre_admin
        - vendor_admin
        - vendor_user
        - simap_admin
      tags:
        - user
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/user/{userId}/unlock:
    post:
      operationId: unlockUser
      summary: simap_admin unlock a temporarily disabled or locked user login
      x-roles:
        - simap_admin
      tags:
        - user
      parameters:
        - name: userId
          schema:
            type: string
            format: uuid
          in: path
          required: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/my:
    get:
      operationId: getMyUser
      summary: Get the current user
      tags:
        - user
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      operationId: editMyUser
      summary: Changes the current user.
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      tags:
        - user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserEditable'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      operationId: deleteMyUser
      summary: Delete the current user
      tags:
        - user
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      x-service-returns-response: true
      responses:
        '204':
          description: deleted
        '412':
          description: Response contains all the reasons why a user can not be deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDeletionResultResponse'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/user/{impersonatedUserId}/impersonate:
    post:
      operationId: impersonateUser
      summary: A simap admin can impersonate a specific user for customer service purposes.
      x-roles:
        - simap_admin
        - competence_centre_admin
      tags:
        - user
      parameters:
        - name: impersonatedUserId
          schema:
            type: string
            format: uuid
          in: path
          required: true
          description: Id of the user to be impersonated, can be obtained by GET on /users/v1
      responses:
        '200':
          description: |
            Because of https://github.com/keycloak/keycloak/issues/8756
            we currently can't use the issued refresh-token.
            Please refresh original token and re-impersonate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImpersonateTokens'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/user/{impersonatedUserId}/impersonate/refresh-token:
    get:
      operationId: refreshTokenImpersonatedUser
      summary: Refresh the impersonated user's token
      x-roles:
        - simap_admin
        - competence_centre_admin
      tags:
        - user
      parameters:
        - name: impersonatedUserId
          schema:
            type: string
            format: uuid
          in: path
          required: true
          description: Id of the user to be impersonated, can be obtained by GET on /users/v1
      responses:
        '200':
          description: |
            Because of https://github.com/keycloak/keycloak/issues/8756
            we currently can't use the issued refresh-token.
            Please refresh original token and re-impersonate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImpersonateTokens'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/my/history/mutations:
    get:
      summary: Get the history of mutations of the own user
      operationId: getMyHistoryMutations
      description: |
        This endpoint returns the own user history of mutations.
      tags:
        - user
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserHistoryMutations'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/my/history/proc-office-memberships:
    get:
      summary: Get the history of procurement office memberships of the own user
      operationId: getMyHistoryProcOfficeMemberships
      description: |
        This endpoint returns the own user history of procurement office memberships.
      tags:
        - user
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserHistoryOrganizationMemberships'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/my/history/vendor-memberships:
    get:
      summary: Get the history of vendor memberships of the own user
      operationId: getMyHistoryVendorMemberships
      description: |
        This endpoint returns the own user history of vendor memberships.
      tags:
        - user
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserHistoryOrganizationMemberships'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/search-with-org-and-role:
    get:
      parameters:
        - in: query
          name: search
          schema:
            type: string
            minLength: 3
          required: true
        - name: lang
          schema:
            $ref: '#/components/schemas/SystemLanguage'
          in: query
          required: true
          description: search language
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
      summary: Search for users by givenname, lastname, email or organization
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query, the last item can be found in the first result.
        For the user-search the item represents the email-address, as the results are ordered by it and it's the primary identification.
        If no more results are available the api returns an empty list or one with fewer items than the specified itemsPerPage.
      operationId: searchUsersWithOrgAndRole
      x-roles:
        - simap_admin
      tags:
        - user
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersWithOrgAndRoleSearchResult'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/my/organizations:
    get:
      summary: Get organization memberships of a user
      operationId: getMyOrganizationMemberships
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      tags:
        - user
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationMemberships'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /users/v1/my/organizations/{organizationId}:
    parameters:
      - name: organizationId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the organization
    delete:
      summary: Delete own request to join an organization or delete own membership (leave organization)
      operationId: deleteMyOrganizationMembership
      tags:
        - user
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      responses:
        '204':
          description: ok
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1:
    get:
      summary: Get the list of competence centres
      operationId: getCompCentres
      tags:
        - comp-centres
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentres'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/procoffices:
    get:
      parameters:
        - in: query
          name: search
          description: |
            Search by proc office name.
            Requires at least 3 valid characters.
          schema:
            type: string
            minLength: 3
          required: false
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
        - in: query
          name: status
          description: Filter by procurement offices in status
          schema:
            $ref: '#/components/schemas/ProcOfficeStatus'
          required: false
      summary: Search procurement offices that are part of an institution below the current comp-centre sorted by name.
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query. The last item can be found in the pagination-information
        of the first result and represents the name of the ProcOffice.
      operationId: findProcOfficesOfMyCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeSearchResult'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/cc/{compCentreId}:
    parameters:
      - $ref: '#/components/parameters/ParamCompCentreId'
    get:
      summary: Get details for single competence centre
      operationId: getCompCentre
      tags:
        - comp-centres
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentreDetail'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Add or update information of a CompetenceCentre
      operationId: updateCompCentre
      x-roles:
        - competence_centre_admin
      tags:
        - comp-centres
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompCentre'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentre'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/cc/{compCentreId}/addmember:
    parameters:
      - $ref: '#/components/parameters/ParamCompCentreId'
    put:
      summary: add a new member to the competence centre
      operationId: addCompCentreMember
      x-roles:
        - competence_centre_admin
      tags:
        - comp-centres
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompCentreJoin'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentreMember'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/cc/{compCentreId}/members/{userId}:
    parameters:
      - $ref: '#/components/parameters/ParamCompCentreId'
      - in: path
        name: userId
        schema:
          type: string
          format: uuid
        required: true
        description: Id of the user, can be obtained by GET on /compcentres/v1/my
    delete:
      summary: A competence centre admin can remove an accepted member from the competence centre. Accepted users get notified about their removal.
      operationId: removeCompCentreMember
      x-roles:
        - competence_centre_admin
      tags:
        - comp-centres
      responses:
        '204':
          description: ok
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/members:
    get:
      summary: Get the list of competence centre members (admins and print-users) of the current competence centre.
      operationId: getCompCentreMembers
      x-roles:
        - competence_centre_admin
      tags:
        - comp-centres
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentreMembers'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/procoffices/users/search:
    get:
      parameters:
        - in: query
          name: search
          schema:
            type: string
            minLength: 3
          required: true
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query, the last item can be found in the first result.
        For the user-search the item represents the email-address, as the results are ordered by it and it's the primary identification.
      summary: Search users attached to competence centre through procurement office or direct competence centre users
      operationId: searchAttachedUsers
      x-roles:
        - competence_centre_admin
      tags:
        - comp-centres
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachedUserSearchResult'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/remedies-notices:
    get:
      summary: Get or search list of remedies notice templates
      parameters:
        - in: query
          name: search
          description: |
            Search by `name`
            Either empty or requires at least 3 valid characters.
          schema:
            type: string
            pattern: (^$)|.{3,}
          required: false
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query, the last item can be found in the first result.
      operationId: searchRemediesNoticeTemplatesByCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemediesNoticeTemplatesSearchResult'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/remedies-notices/{remediesNoticeTemplateId}:
    parameters:
      - name: remediesNoticeTemplateId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the remedies notice template
    get:
      summary: Get a single remedies notice template
      operationId: getRemediesNoticeTemplateByCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemediesNoticeTemplate'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Create a remedies notice template
      operationId: createRemediesNoticeTemplateForCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemediesNoticeTemplateRequest'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemediesNoticeTemplate'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Update a remedies notice template
      operationId: updateRemediesNoticeTemplateForCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemediesNoticeTemplateRequest'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemediesNoticeTemplate'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete a remedies notice template
      operationId: deleteRemediesNoticeTemplateInCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/pub-draft-templates:
    get:
      summary: Get the list of pub-draft templates within the users current comp-centre
      parameters:
        - in: query
          name: search
          description: |
            Search by project title.
            Either empty or requires at least 3 valid characters.
          schema:
            type: string
            pattern: (^$)|.{3,}
          required: false
        - name: template-type
          schema:
            $ref: '#/components/schemas/PubDraftTemplatePubTypeFilter'
          in: query
          required: false
          description: filter for publication type
        - name: created-by-me
          schema:
            type: boolean
            default: false
          in: query
          required: false
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query, the last item can be found in the first result.
      operationId: searchPubDraftTemplatesByCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTemplateSearchResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/contacts/{contactId}:
    parameters:
      - name: contactId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the contact of the competence centre
    put:
      summary: Create a contact for a competence centre
      operationId: createContactForCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompCentreContact'
      responses:
        '201':
          description: The contact for a competence centre is successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentreContact'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Update a contact of a competence centre
      operationId: updateContactForCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompCentreContact'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentreContact'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete a contact of a competence centre
      operationId: deleteContactInCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/urls/{urlId}:
    parameters:
      - name: urlId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the url of the competence centre
    put:
      summary: Create a url for a competence centre
      operationId: createUrlForCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompCentreUrl'
      responses:
        '201':
          description: The url for a competence centre was successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentreUrl'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Update a url of a competence centre
      operationId: updateUrlForCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompCentreUrl'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentreUrl'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete a url of a competence centre
      operationId: deleteUrlInCompCentre
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/urls/{compCentreId}/order:
    parameters:
      - $ref: '#/components/parameters/ParamCompCentreId'
    patch:
      summary: Reorder the urls of a competence centre
      description: |
        expects an ordered list of urls and will update the positions of the urls according to the ordering in the list.
      operationId: reorderCompCentreUrls
      tags:
        - comp-centres
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompCentreUrls'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompCentreUrls'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/publications/to-publish:
    get:
      summary: Get the list of pub drafts to publish
      description: |
        List all pub drafts in state 'to_publish' which are assigned to the competence centre of the 
        logged in user where the editorial deadline has passed but not the publication date at the date and time of the request.
        This list can be used by a 'competence centre print user' (or the competence centre admin) to get all pub drafts needed 
        to publish in the assigned publishing organ(s) like 'Amtsblatt'.
      operationId: listPubDraftsOfCompCentreToPublish
      tags:
        - comp-centres
      x-roles:
        - competence_centre_print_user
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationsToPublish'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/publisher/publication-dates/{publicationDateId}:
    parameters:
      - name: publicationDateId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the publication date
    put:
      summary: |
        Create a new regular publication date for the publisher which is assigned to my competence centre.
        In case the publisher is shared amongst multiple competence centres this will also affect the
        other competence centres.
      operationId: createPublicationDateRule
      tags:
        - comp-centre-publishers
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicationDateRule'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationDateRule'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: |
        Delete regular publication date for the publisher which is assigned to my competence centre.
        In case the publisher is shared amongst multiple competence centres this will also affect the
        other competence centres.
      operationId: deletePublicationDateRule
      tags:
        - comp-centre-publishers
      x-roles:
        - competence_centre_admin
      responses:
        '204':
          description: No Content - Deleted
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        '409':
          description: |
            Can't delete publication date because it is used in a publication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftsPlannedForPublication'
        default:
          $ref: '#/components/responses/ServerError'
  /compcentres/v1/my/publisher/publication-dates/exceptions/{publicationDateExceptionId}:
    parameters:
      - name: publicationDateExceptionId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the publication date exception
    put:
      summary: |
        Create a publication date exception for the publisher which is assigned to my competence centre
        In case the publisher is shared amongst multiple competence centres this will also affect the
        other competence centres.
      operationId: createPublicationDateException
      tags:
        - comp-centre-publishers
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicationDateException'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationDateException'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: |
        Delete a publication date exception for the publisher which is assigned to my competence centre
        In case the publisher is shared amongst multiple competence centres this will also affect the
        other competence centres.
      operationId: deletePublicationDateException
      tags:
        - comp-centre-publishers
      x-roles:
        - competence_centre_admin
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po:
    get:
      parameters:
        - in: query
          name: search
          description: |
            Search by proc office name.
            Requires at least 3 valid characters.
          schema:
            type: string
            minLength: 3
          required: false
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
        - in: query
          name: status
          description: Filter by procurement offices in status
          schema:
            $ref: '#/components/schemas/ProcOfficeStatus'
          required: false
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query. The last item can be found in the pagination-information
        of the first result and represents the name of the ProcOffice.
      summary: Search procurement offices
      operationId: searchProcOffices
      tags:
        - proc-office
      x-roles:
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeSearchResult'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po/public:
    get:
      summary: Get the list with the public data of proc offices.
      tags:
        - proc-office
      operationId: listPublicProcOffices
      parameters:
        - in: query
          name: institutionId
          schema:
            type: string
            format: uuid
          description: Filter proc offices with the id of the institution that oversees them.
          required: false
        - in: query
          name: search
          schema:
            type: string
            example: Gemeinde Bargen
            minLength: 3
          description: Search for proc offices by name. You can use partial words or names for the query.
          required: false
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficesPublicData'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my:
    get:
      summary: get my current procurement office
      operationId: getMyProcOffice
      tags:
        - proc-office
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOffice'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po/{procOfficeId}:
    parameters:
      - $ref: '#/components/parameters/ParamProcOfficeId'
    get:
      summary: Get procurement office
      operationId: getProcOffice
      tags:
        - proc-office
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOffice'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Create a procurement office
      operationId: createProcOffice
      tags:
        - proc-office
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcOffice'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOffice'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '409':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Update a procurement office
      operationId: updateProcOffice
      tags:
        - proc-office
      x-roles:
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcOffice'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOffice'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po/{procOfficeId}/accept:
    parameters:
      - $ref: '#/components/parameters/ParamProcOfficeId'
    patch:
      summary: Accept a request from a new procurement office to join an organization. This will update the state of the procurement office to 'confirmed'
      operationId: acceptRequestToJoinOrganization
      tags:
        - proc-office
      x-roles:
        - competence_centre_admin
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOffice'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        '409':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po/{procOfficeId}/reject:
    parameters:
      - $ref: '#/components/parameters/ParamProcOfficeId'
    post:
      summary: Reject a request from a new procurement office to join an organization. This will delete the procurement office resource.
      operationId: rejectRequestToJoinOrganization
      tags:
        - proc-office
      x-roles:
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcOfficeRejectMessage'
      responses:
        '204':
          description: Ok - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        '409':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po/{procOfficeId}/join:
    parameters:
      - $ref: '#/components/parameters/ParamProcOfficeId'
    post:
      summary: Send request to join a proc-office for current user
      operationId: requestToJoinProcOffice
      tags:
        - proc-office
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcOfficeJoinRequest'
      responses:
        '201':
          description: created join request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MyProcOfficeMembership'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po/{procOfficeId}/members:
    parameters:
      - $ref: '#/components/parameters/ParamProcOfficeId'
    get:
      summary: Get the list of members and the current requests to join the procurement office
      operationId: listMembers
      parameters:
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
          description: |
            Pagination key, the `email` of the last user, the `lastItem` value of the `pagination` object.
        - name: role
          schema:
            $ref: '#/components/schemas/ProcOfficeRole'
          in: query
          required: false
          description: filter by provided procOfficeRole
        - name: search
          schema:
            type: string
          in: query
          required: false
          description: Search members by matching text in firstName, lastName or email address field
      tags:
        - proc-office
      x-roles:
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeMembers'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Respond with accept or reject to request for joining procurement office
      operationId: respondToRequest
      tags:
        - proc-office
      x-roles:
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcOfficeJoinResponse'
      responses:
        '201':
          description: resource created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeJoinResponse'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po/{procOfficeId}/members/{userId}:
    parameters:
      - $ref: '#/components/parameters/ParamProcOfficeId'
      - name: userId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the user, can be obtained by GET on /procoffices/v1/po/{procOfficeId}/members
    get:
      summary: The procurement office can get the member details
      operationId: getMemberById
      tags:
        - proc-office
      x-roles:
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeMember'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: The procurement office can remove an accepted member or a rejected request. Accepted members get notified about their removal.
      operationId: removeProcOfficeMember
      tags:
        - proc-office
      x-roles:
        - procurement_admin
      responses:
        '204':
          description: ok
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/po/{procOfficeId}/members/roles:
    parameters:
      - $ref: '#/components/parameters/ParamProcOfficeId'
    put:
      summary: Update roles of procurement office members
      description: |
        Will update the roles of the given procurement members.
        Will return the updated members.
      operationId: updateProcurementMembersRoles
      tags:
        - proc-office
      x-roles:
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcOfficeMembers'
            example:
              procOfficeMembers:
                - id: 00000000-0000-0000-0000-000000000002
                  firstName: Bernd
                  lastName: procurement_user
                  email: procurement_user@test.ch
                  phoneNumber: '+41323275638'
                  language: de
                  createdAt: '2022-06-13T15:29:08.613Z'
                  updatedAt: '2022-06-13T15:29:08.613Z'
                  active: true
                  passwordLastChanged: '2022-06-13'
                  membership: requested
                  role: procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeMembers'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v2/my/projects/projects-overview:
    parameters:
      - name: created-by-me
        schema:
          type: boolean
          default: false
        in: query
        required: false
        description: filter for my publications
      - name: status
        schema:
          $ref: '#/components/schemas/PubDraftStatus'
        in: query
        required: false
        description: filter for status, only needed when entryType = drafted
      - name: archived
        schema:
          type: boolean
          default: false
        in: query
        required: true
        description: filter for archived or active projects
      - name: type
        schema:
          $ref: '#/components/schemas/ProjectSearchPubTypeFilter'
        in: query
        required: false
        description: filter for publication type
      - name: pre-phase
        schema:
          type: boolean
          default: false
        in: query
        required: false
        description: filter for pre phase publications
      - name: search
        schema:
          type: string
        in: query
        required: false
        description: search input
      - name: lang
        schema:
          type: array
          items:
            $ref: '#/components/schemas/SystemLanguage'
        in: query
        required: false
        description: defines in which languages shall be searched in case of translated fields. In case this property is not defined or an empty array is given, then we we search in all languages.
      - name: lastItem
        in: query
        schema:
          type: string
        required: false
    get:
      summary: project overview for the current proc-office
      description: |
        Returns all projects in draft, published and archived status.
      operationId: getProcurementProjectOverview
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectsOverview'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/project-header:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get general header information of a project by id
      operationId: getProjectHeaderById
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectHeader'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/my-notification-settings:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    put:
      summary: Create or update project specific procurement user notification settings
      operationId: updateProcOfficeUserNotificationSettings
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcOfficeUserNotificationSettings'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeUserNotificationSettings'
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    get:
      summary: get project specific procurement user notification settings
      operationId: getProcOfficeUserNotificationSettings
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeUserNotificationSettings'
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/archive:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    patch:
      summary: mark or unmark a project as archived
      operationId: archiveProcOfficeProject
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateArchiveStatus'
      responses:
        '204':
          description: No Content
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/remedies-notices:
    get:
      summary: Get the list of remedies notice templates
      parameters:
        - in: query
          name: search
          description: |
            Search by `name`
            Either empty or requires at least 3 valid characters.
          schema:
            type: string
            pattern: (^$)|.{3,}
          required: false
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query, the last item can be found in the first result.
      operationId: searchRemediesNoticeTemplatesByProcOffice
      tags:
        - proc-office
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemediesNoticeTemplatesSearchResult'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/remedies-notices/{remediesNoticeTemplateId}:
    parameters:
      - name: remediesNoticeTemplateId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the remedies notice template
    get:
      summary: Get a single remedies notice template
      operationId: getRemediesNoticeTemplateByProcOffice
      tags:
        - proc-office
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemediesNoticeTemplate'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/pub-draft-templates:
    get:
      summary: Get the list of pub-draft templates within the users current proc-office or comp-centre
      parameters:
        - in: query
          name: search
          description: |
            Search by project title.
            Either empty or requires at least 3 valid characters.
          schema:
            type: string
            pattern: (^$)|.{3,}
          required: false
        - name: template-type
          schema:
            $ref: '#/components/schemas/PubDraftTemplatePubTypeFilter'
          in: query
          required: false
          description: filter for publication type
        - name: created-by-me
          schema:
            type: boolean
            default: false
          in: query
          required: false
        - name: org-type
          schema:
            $ref: '#/components/schemas/ProcOfficePubDraftTemplateOrgTypeFilter'
          in: query
          required: true
          description: filter based on organization type. Either templates of my proc-office or my comp-centre
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
      description: |
        Rolling pagination:
        To fetch the next page add the lastItem to the query, the last item can be found in the first result.
      operationId: searchPubDraftTemplatesByProcOffice
      tags:
        - proc-office
      x-roles:
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTemplateSearchResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v2/my/projects/{projectId}/involved-vendors:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - name: search
        in: query
        description: |
          Optional: Search vendor in list by `vendorName` (requires at least 3 characters)
        schema:
          type: string
          pattern: (^$)|.{3,}
        required: false
      - name: status
        in: query
        schema:
          $ref: '#/components/schemas/InvolvedVendorStatus'
        required: false
        description: |
          filter by `status`
      - name: noPagination
        in: query
        schema:
          type: boolean
        required: false
        description: |
          If defined no page size limit is applied and all elements after the defined lastItem are returned.
      - name: lastItem
        in: query
        schema:
          type: string
        required: false
        description: |
          Rolling pagination:
          To fetch the next page add the lastItem to the query, the last item can be found in the first result.
          For vendors the last item is the vendor name. It is sorted by it and is the primary identification.
          If no more results are available the api returns an empty list or a list with fewer items than the specified itemsPerPage.
      - $ref: '#/components/parameters/QueryParamLotId'
    get:
      summary: Get involved vendors for a project
      operationId: getVendorsInvolvedInProject
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvolvedVendorSearchResult'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v2/my/projects/{projectId}/involved-vendors/{vendorId}:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamVendorId'
        description: |
          Id of the vendor, which shall be involved in the project.
          Available vendors can be searched by GET on `/vendors/v1/`
    put:
      summary: Add a vendor to the list of involved vendors for the given project and define that the vendor showed interest
      description: |
        This endpoint is not supported for project with process-type `invitation`;
        For invitation use dedicated endpoint `/procoffices/v1/my/projects/{projectId}/involved-vendors/{vendorId}/invite`

        Setting 'interest-shown' for a vendor via this endpoint allows the vendor to access the project documents and qnas.
        It also gives a proc-office member the possibility to execute follow up actions as i.e. mark external submission.
      operationId: involveVendorInProject
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvolvedVendorWithActions'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v2/my/projects/{projectId}/involved-vendors/{vendorId}/invite:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamVendorId'
        description: |
          Id of the vendor, which shall be invited to the project.
          Available vendors can be searched by GET on `/vendors/v1/`
    put:
      summary: Add a vendor to the list of involved vendors for the given project and define that the vendor is invited
      description: |
        This endpoint is only supported for projects with process-type `invitation`;
        For any other process-types use dedicated endpoint `/procoffices/v1/my/projects/{projectId}/involved-vendors/{vendorId}`

        Setting 'invited' for a vendor via this endpoint grants them access to view the project and all publications in it, 
        including publications which would otherwise remain hidden since they have not been published publicly.

        Setting 'invitation_declined' is only possible through the invited vendor.
      operationId: inviteVendorToProject
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvolvedVendorWithActions'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/involved-vendors/{vendorId}/offer-external-submission:
    put:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - name: vendorId
          schema:
            type: string
            format: uuid
          in: path
          required: true
          description: Id of the vendor which submitted the documents externally for the given project
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        description: ok
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalDocumentSubmission'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvolvedVendorSubmissionResult'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
      operationId: markOfferExternalSubmissionForVendor
      summary: Register that a given vendor handed in offer documents externally for a given project.
  /procoffices/v1/my/projects/{projectId}/involved-vendors/{vendorId}/participation-external-submission:
    put:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - name: vendorId
          schema:
            type: string
            format: uuid
          in: path
          required: true
          description: Id of the vendor which submitted the documents externally for the given project
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        description: ok
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalDocumentSubmission'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvolvedVendorSubmissionResult'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
      operationId: markParticipationExternalSubmissionForVendor
      summary: Register that a given vendor handed in participation documents externally for a given project with a publication applying a selective process
  /procoffices/v1/my/projects/{projectId}/involved-vendors/{vendorId}/rfi-external-submission:
    put:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - name: vendorId
          schema:
            type: string
            format: uuid
          in: path
          required: true
          description: Id of the vendor which submitted the documents externally for the given project
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        description: ok
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalDocumentSubmission'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvolvedVendorSubmissionResult'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
      operationId: markRequestForInformationExternalSubmissionForVendor
      summary: Register that a given vendor handed in documents externally for a given rfi project.
  /procoffices/v1/my/projects/{projectId}/involved-vendors-messages/{messageId}:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - name: messageId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the message
    post:
      summary: send the message
      operationId: sendMessageToInvolvedVendors
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
      responses:
        '202':
          description: The message was accepted and will be processed
        '400':
          description: |
            in case:
            - payload is not valid (see SendMessageRequest)
            - no matching involved vendor with a contact was found and no additional email addresses were specified.
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/qnas:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - $ref: '#/components/parameters/QueryParamLotId'
      summary: Provide overview for all qna-rounds with the attached qna-Pairs within a project.
      operationId: getQnaRounds
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QnaRoundsWithQnas'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v2/my/projects/{projectId}/participation-protocol:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/QueryParamLotId'
    get:
      summary: Get all the necessary data for the participation protocol
      operationId: getParticipationProtocol
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvolvedVendorProtocolResult'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v2/my/projects/{projectId}/offer-protocol:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/QueryParamLotId'
    get:
      summary: Get all the necessary data for the offer protocol
      operationId: getOfferProtocol
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvolvedVendorProtocolResult'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/documents:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - name: pubDraftId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents by pubDraftId
        - name: lotId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents assigned to provided lotId or not assigned to a lot
        - name: qnaRoundId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents by qnaRoundId
        - name: type
          schema:
            $ref: '#/components/schemas/ProjectDocumentSourceType'
          in: query
          required: false
          description: filter list of project documents by provided document source type
      summary: Get the list of documents assigned to a project filtered by provided query parameters
      operationId: searchProjectDocuments
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: Uploaded project documents for this project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDocuments'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/documents/zip-token:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - name: pubDraftId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents by pubDraftId
        - name: lotId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents assigned to provided lotId or not assigned to a lot
        - name: qnaRoundId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents by qnaRoundId
        - name: type
          schema:
            $ref: '#/components/schemas/ProjectDocumentSourceType'
          in: query
          required: false
          description: filter list of project documents by provided document source type
      summary: Get a Download Token to fetch a zip file containing all project document files
      operationId: getProjectDocumentsZipToken
      tags:
        - proc-office-projects
      x-roles:
        - procurement_admin
        - procurement_user
        - procurement_project_contributor
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadToken'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/documents/{projectDocumentId}:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamProjectDocumentId'
    post:
      summary: Update metadata of a project document
      operationId: updateProjectDocumentMetadata
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectDocumentUpdate'
      responses:
        '200':
          description: The created project document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDocument'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: delete a project document
      operationId: deleteProjectDocument
      description: |
        Delete the uploaded document and the project document in case the pub-draft is not yet
        published. Otherwise mark the project document as deleted and delete the file only.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '204':
          description: No Content - Deleted
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/documents/{projectDocumentId}/upload:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamProjectDocumentId'
    post:
      summary: Upload a document to a project
      operationId: uploadProjectDocument
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-plain-multipart-request: true
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProjectDocumentUploadMultipart'
      responses:
        '201':
          description: The created project document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDocument'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          description: The user doesn't have permissions to upload a project document
        '413':
          description: The total file size exceeds the allowed size of 2GB
        '415':
          description: Unsupported Filetype
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/contributors:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the list of contributors in the project
      operationId: listProjectContributors
      parameters:
        - in: query
          name: lastItem
          schema:
            type: string
          required: false
          description: |
            Provide as pagination key, the `lastItem` value of the `pagination` object.to fetch next results.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectContributors'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/contributors/{userId}:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamUserId'
    put:
      summary: Add contributor to project
      operationId: addProjectContributor
      tags:
        - proc-office-projects
      x-roles:
        - procurement_user
        - procurement_admin
      responses:
        '201':
          description: resource created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectContributor'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Remove contributor from project
      operationId: removeProjectContributor
      tags:
        - proc-office-projects
      x-roles:
        - procurement_user
        - procurement_admin
      responses:
        '204':
          description: ok
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/internal-reference:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    patch:
      summary: Patch the internal reference of a project
      operationId: patchInternalReference
      description: |
        Update the internal reference of the given project.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcOfficeProjectInternalReference'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectInternalReference'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/history/publications:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the publication history of a procurement office project by project id
      operationId: getProcOfficeProjectPublicationHistory
      description: |
        This endpoint returns the publication history of a procurement office project by project id.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectHistoryPublications'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/history/qnas:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the qna history of a procurement office project by project id
      operationId: getProcOfficeProjectQnaHistory
      description: |
        This endpoint returns the qna history of a procurement office project by project id.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectHistoryQnas'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/history/qnas/{hid}:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamHistoryId'
    get:
      summary: Get the qna history of a procurement office project by project id and history id
      operationId: getProcOfficeProjectQnaHistoryByHid
      description: |
        This endpoint returns given qna history entry with the previous entry for the given qna entry based on the history entry.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectHistoryQnaWithPrevious'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/history/involvements:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the involved vendors history of a procurement office project by project id
      operationId: getProcOfficeProjectInvolvementHistory
      description: |
        This endpoint returns the involved vendors history of a procurement office project by project id.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectHistoryInvolvements'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/history/vendor-messages:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the vendor message history of a procurement office project by project id
      operationId: getProcOfficeProjectVendorMessageHistory
      description: |
        This endpoint returns the vendor message history of a procurement office project by project id.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectHistoryVendorMessages'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/history/project-contributors:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the project contributor history of a procurement office project by project id
      operationId: getProcOfficeProjectContributorHistory
      description: |
        This endpoint returns the project contributor history of a procurement office project by project id.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeProjectHistoryProjectContributors'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/history/document-downloads:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the document download history of a procurement office project by project id
      operationId: getProcOfficeProjectDocumentDownloadHistory
      description: |
        This endpoint returns the document download history for the given project.
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectHistoryDocumentDownloads'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/history/memberships:
    get:
      summary: Get the membership-history of the proc office members for procurement_admin
      operationId: getMyProcOfficeMembershipHistory
      description: |
        This endpoint returns the membership-history of procurement office members for procurement-admins.
      tags:
        - proc-office
      x-roles:
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeHistoryMemberships'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/history/base-data:
    get:
      summary: Get the base-data-history of the proc office for the procurement_admin
      operationId: getMyProcOfficeBaseDataHistory
      description: |
        This endpoint returns the base-data-history of procurement offices for procurement-admins.
      tags:
        - proc-office
      x-roles:
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeHistoryBaseDataEntries'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/history/address-data:
    get:
      summary: Get the address-history of the proc office for the procurement_admin
      operationId: getMyProcOfficeAddressHistory
      description: |
        This endpoint returns the address-history of procurement offices for procurement-admins.
      tags:
        - proc-office
      x-roles:
        - procurement_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeHistoryAddressDataEntries'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/involved-vendors/{vendorId}/digital-submissions:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/QueryParamLotId'
      - $ref: '#/components/parameters/ParamVendorId'
    get:
      summary: Get the digital submissions for a project
      description: Get the digital submissions for a project, lotId needs to be provided as query parameter if project was created with lotsType 'with'.
      operationId: getProcOfficeVendorDigitalSubmissions
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeVendorDigitalSubmissions'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /procoffices/v1/my/projects/{projectId}/involved-vendors/{vendorId}/digital-submissions/{vendorDigitalSubmissionId}/open:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamVendorId'
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionId'
    post:
      summary: Open a vendor digital submission
      operationId: openVendorDigitalSubmissions
      tags:
        - proc-office-projects
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficeVendorDigitalSubmissionOpenResult'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamVendorLastItem'
        - name: search
          description: |
            - Search by `name`, `additionalName`, UID or DUNS
            - Either empty or requires at least 3 valid characters.
          schema:
            type: string
            pattern: (^$)|.{3,}
          in: query
          required: false
        - name: typeOfServices
          description: |
            filter: if defined, vendors are filtered by one of the provided type of service
          schema:
            type: array
            items:
              $ref: '#/components/schemas/PubOrderType'
          in: query
          required: false
        - name: cpvCodes
          description: |
            filter: if defined, vendors are filtered by one of the provided CPV codes
          schema:
            type: array
            items:
              type: string
              format: cpvCode
          in: query
          required: false
        - name: bkpCodes
          description: |
            filter: if defined, vendors are filtered by one of the provided BKP codes
          schema:
            type: array
            items:
              type: string
              format: bkpCode
          in: query
          required: false
        - name: ebkphCodes
          description: |
            filter: if defined, vendors are filtered by one of the provided eBKP-h codes
          schema:
            type: array
            items:
              type: string
              format: ebkphCode
          in: query
          required: false
        - name: ebkptCodes
          description: |
            filter: if defined, vendors are filtered by one of the provided eBKP-t codes
          schema:
            type: array
            items:
              type: string
              format: ebkptCode
          in: query
          required: false
        - name: npkCodes
          description: |
            filter: if defined, vendors are filtered by one of the provided NPK codes
          schema:
            type: array
            items:
              type: string
              format: npkCode
          in: query
          required: false
        - name: oagCodes
          description: |
            filter: if defined, vendors are filtered by one of the provided OAG codes
          schema:
            type: array
            items:
              type: string
              format: oagCode
          in: query
          required: false
      summary: Find registered vendors by name, UID, DUNS or filters
      description: |
        Returns all registered vendors matching the search input and filters
        Note that you need to specify at least the search input or one of the filters, 
        a search query without search input nor filter is not allowed.
        Filters and search input are combined using a logical AND.

        Pagination:

        Rolling pagination:
        To fetch the next page add the lastItem to the query. The last item can be found in the pagination-information
        of the first or previous result.
      operationId: findVendors
      tags:
        - vendor
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorSearchResults'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v2/vendor/{vendorId}:
    parameters:
      - $ref: '#/components/parameters/ParamVendorId'
    get:
      summary: Get information for specific vendor
      operationId: getVendor
      tags:
        - vendor
      x-roles:
        - vendor_admin
        - vendor_user
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDetail'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Create a vendor profile
      operationId: createVendor
      tags:
        - vendor
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorCreate'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vendor'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Update a vendor profile
      description: |
        Update a vendors profile. UID- or DUNS number can only be updated once. The update 
        does not synchronize the values with the register, those values need to be fetched before
        using the `verify-uid` or `verify-duns` endpoints.
      operationId: updateVendor
      tags:
        - vendor
      x-roles:
        - vendor_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorDetail'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDetail'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete the vendor profile
      description: |
        The vendor admin can delete his vendor organization but only if nobody showed interest in any project.
        All member relations to this vendor (users and admins) are deleted but not the user itself.
      operationId: deleteVendor
      tags:
        - vendor
      x-roles:
        - vendor_admin
      responses:
        '204':
          description: deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/vendor/{vendorId}/public:
    parameters:
      - $ref: '#/components/parameters/ParamVendorId'
    get:
      summary: Get public information for specific vendor
      operationId: getVendorPublic
      tags:
        - vendor
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorPublic'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v2/verify-uid:
    post:
      summary: Verify an UID
      description: |
        returns either:
        * an existing vendor (different id than provided in body)
        * a new prefilled vendor-profile (same id as provided in body)
        * error 404 if nothing was found, or 400 when a malformed UID was provided
      operationId: verifyVendorUid
      tags:
        - vendor
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyVendorUid'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vendor'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v2/verify-duns:
    post:
      summary: Verify a DUNS number
      description: |
        returns either:
        * an existing vendor (different id than provided in body)
        * a new prefilled vendor-profile (same id as provided in body)
        * error 404 if nothing was found, or 400 when a malformed DUNS was provided
      operationId: verifyVendorDuns
      tags:
        - vendor
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyVendorDuns'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vendor'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
          description: No active and validated vendor was found for the provided duns number.
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my:
    get:
      summary: Get the active vendor of the current user
      operationId: getMyVendor
      tags:
        - vendor
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MyVendor'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/deactivate:
    delete:
      summary: Deactivate the vendor of the current user
      operationId: deactivateMyVendor
      description: |
        A vendor admin can deactivate their vendor, the vendor in which they are currently active.

        This action is always possible and not reversible.

        The vendor is flagged as `deactivated`, will no longer be found in the public vendor directory and 
        members of the vendor can no longer act as a member of the vendor. 

        A Proc Office can't add a deactivated vendor to a project. 
        But if the vendor was involved in a project prior the deactivation, the proc office has the ability to interact, use the deactivated vendor
        in publications.

        After the deactivation of the vendor the current role of the executing user will be set to `subscription_user` 
        as the current role and organisation is no longer valid.
      tags:
        - vendor
      x-roles:
        - vendor_admin
      responses:
        '204':
          description: deactivated
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/history/memberships:
    get:
      summary: Get the membership-history of vendor members for vendor-admins
      operationId: getMyVendorMembershipHistory
      description: |
        This endpoint returns the membership-history of vendor members for vendor-admins.
      tags:
        - vendor
      x-roles:
        - vendor_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorHistoryMemberships'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/history/base-data:
    get:
      summary: Get the base-data-history of vendors for vendor-admins
      operationId: getMyVendorBaseDataHistory
      description: |
        This endpoint returns the base-data-history of vendors for vendor-admins.
      tags:
        - vendor
      x-roles:
        - vendor_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorHistoryBaseDataEntries'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/history/address-data:
    get:
      summary: Get the address-history of vendors for vendor-admins
      operationId: getMyVendorAddressHistory
      description: |
        This endpoint returns the address-history of vendors for vendor-admins.
      tags:
        - vendor
      x-roles:
        - vendor_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorHistoryAddressDataEntries'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/vendor/{vendorId}/join:
    parameters:
      - $ref: '#/components/parameters/ParamVendorId'
    post:
      summary: Send request to join a vendor for current user
      operationId: requestToJoinVendor
      tags:
        - vendor
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorJoinRequest'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MyVendorMembership'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/vendor/{vendorId}/members:
    parameters:
      - $ref: '#/components/parameters/ParamVendorId'
    get:
      summary: |
        Get the list of members including their current member status for the given vendor. 
        In case of vendor_user, vendor_admin only members of the own vendor can be queried.

        Use /vendors/v1/vendor/{vendorId}/public to query the public information of a vendor.
      operationId: listVendorMembers
      tags:
        - vendor
      x-roles:
        - vendor_user
        - vendor_admin
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorMembers'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Respond with accept, reject or revoke to request for joining vendor
      operationId: respondToVendorJoinRequest
      tags:
        - vendor
      x-roles:
        - vendor_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorJoinResponse'
      responses:
        '201':
          description: resource created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorJoinResponse'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/vendor/{vendorId}/members/{userId}:
    parameters:
      - $ref: '#/components/parameters/ParamVendorId'
      - name: userId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the user, can be obtained by `GET /vendors/v1/vendor/{vendorId}/members`
    delete:
      summary: The vendor can remove an accepted member or reject a join-request. Accepted members get notified about their removal.
      operationId: removeVendorMember
      tags:
        - vendor
      x-roles:
        - vendor_admin
      responses:
        '204':
          description: ok
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/vendor/{vendorId}/members/public:
    parameters:
      - $ref: '#/components/parameters/ParamVendorId'
    put:
      summary: Update public vendor admins
      description: |
        This endpoint is used to change the visibility of admins and to update their `organizationUnit`.
        The given vendor admins will be made public and the `organizationUnit` is updated, missing public admins will be
        made private.

        The request requires one valid vendor admin and will return the public admin members.
        There must be always one public vendor admin.

        Get the current members of a vendor with `GET /vendors/v1/vendor/{vendorId}/members`
      operationId: updatePublicVendorMembers
      tags:
        - vendor
      x-roles:
        - vendor_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorUsers'
            example:
              vendorUsers:
                - id: 1ab34585-c01d-46c3-bc5f-f997d91eb910
                  organizationUnit: Sales
                - id: 224d8f9f-3846-47f9-a0e7-8190e8d05d7e
                  organizationUnit: null
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorUsers'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/vendor/{vendorId}/members/roles:
    parameters:
      - $ref: '#/components/parameters/ParamVendorId'
    put:
      summary: Update roles of vendor members
      description: |
        Will update the roles of vendor members.
        Will return all members.
        Get the current members of a vendor with `GET /vendors/v1/vendor/{vendorId}/members`
      operationId: updateVendorMembersRoles
      tags:
        - vendor
      x-roles:
        - vendor_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorMembers'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorMembers'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/simap-admin/vendors:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamVendorLastItem'
        - $ref: '#/components/parameters/ParamVendorSearch'
      summary: Simap Admin endpoint to find registered vendors by name, UID or DUNS
      operationId: simapAdminFindVendors
      description: |
        This endpoint is for the `simap_admin` to search for a vendor over all vendors, active or not.
      tags:
        - vendor
      x-roles:
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorSearchResults'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v2/my/projects/projects-overview:
    parameters:
      - name: search
        schema:
          type: string
          minLength: 3
        in: query
        required: false
        description: search input
      - name: lang
        schema:
          type: array
          items:
            $ref: '#/components/schemas/SystemLanguage'
        in: query
        required: false
        description: defines in which languages shall be searched in case of translated fields. In case this property is not defined or an empty array is given, then we we search in all languages
      - name: archived
        schema:
          type: boolean
          default: false
        in: query
        required: true
        description: filter for archived or active projects
      - name: lastItem
        in: query
        schema:
          type: string
        required: false
    get:
      summary: vendor project overview
      description: |
        Returns all projects the vendor showed interest and which meet the search input and filters.
      operationId: getVendorProjectOverview
      tags:
        - vendor-projects
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectsSearch'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/projects/{projectId}/qnas:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - $ref: '#/components/parameters/QueryParamLotId'
      summary: Provide overview for all qna-rounds with the attached qna-Pairs within a project for vendors with interest.
      operationId: getQnaRoundsForProject
      tags:
        - vendor-projects
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QnaRoundsWithQnas'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/projects/{projectId}/documents:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - name: publicationId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents by publicationId
        - name: lotId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents assigned to provided lotId or not assigned to a lot
        - name: qnaRoundId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents by qnaRoundId
        - name: type
          schema:
            $ref: '#/components/schemas/ProjectDocumentSourceType'
          in: query
          required: false
          description: filter list of project documents by provided document source type
      summary: Get the list of project documents assigned to this project filtered by query parameters
      operationId: searchDocumentsForProject
      tags:
        - vendor-projects
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: List published project documents
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationProjectDocuments'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/projects/{projectId}/documents/zip-token:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamProjectId'
        - name: publicationId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents by publicationId
        - $ref: '#/components/parameters/QueryParamLotId'
        - name: qnaRoundId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: filter list of project documents by qnaRoundId
        - name: type
          schema:
            $ref: '#/components/schemas/ProjectDocumentSourceType'
          in: query
          required: false
          description: filter list of project documents by provided document source type
      summary: Get a download token to fetch a zip file containing all project documents for the given project and lot.
      operationId: getVendorProjectsDocumentsZipToken
      tags:
        - vendor-projects
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadToken'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v2/my/projects/{projectId}/my-notification-settings:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    put:
      summary: Create or update project specific vendor user notification settings
      operationId: updateVendorUserNotificationSettings
      tags:
        - vendor-projects
      x-roles:
        - vendor_admin
        - vendor_user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorUserNotificationSettings'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorUserNotificationSettings'
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    get:
      summary: get project specific vendor user notification settings
      operationId: getVendorUserNotificationSettings
      tags:
        - vendor-projects
      x-roles:
        - vendor_admin
        - vendor_user
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorUserNotificationSettings'
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/projects/{projectId}/archive:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    patch:
      summary: mark or unmark a project as archived
      operationId: archiveVendorProject
      tags:
        - vendor-projects
      x-roles:
        - vendor_user
        - vendor_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateArchiveStatus'
      responses:
        '204':
          description: No Content
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/projects/{projectId}/history/involvements:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the involved vendors history of a vendor project by project id
      operationId: getVendorProjectInvolvementHistory
      description: |
        This endpoint returns the involved vendors history of a vendor project by project id.
      tags:
        - vendor
      x-roles:
        - vendor_user
        - vendor_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectHistoryInvolvements'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/projects/{projectId}/history/document-downloads:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get the document download history of a vendor project by project id
      operationId: getVendorProjectDocumentDownloadHistory
      description: |
        This endpoint returns the document download history of a vendor project by project id.
      tags:
        - vendor
      x-roles:
        - vendor_user
        - vendor_admin
      parameters:
        - $ref: '#/components/parameters/QueryParamFrom'
        - $ref: '#/components/parameters/QueryParamTo'
        - $ref: '#/components/parameters/QueryParamLastItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectHistoryDocumentDownloads'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/documents:
    get:
      summary: Get the list of vendor documents
      operationId: listVendorDocuments
      tags:
        - vendor-documents
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDocuments'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/documents/{vendorDocumentId}:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDocumentId'
    get:
      parameters:
        - $ref: '#/components/parameters/QueryParamToken'
      summary: |
        Download a vendor document by id, authenticate via token in query parameter -- token can be obtained by:
        /vendors/v1/my/documents/{vendorDocumentId}/token
      operationId: downloadVendorDocument
      tags:
        - vendor-documents
      x-service-returns-response: true
      responses:
        '200':
          description: Vendor document as download
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: delete a vendor document
      operationId: deleteVendorDocument
      description: |
        Delete the uploaded vendor document.
      tags:
        - vendor-documents
      x-roles:
        - vendor_admin
      responses:
        '204':
          description: No Content - Deleted
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/documents/{vendorDocumentId}/token:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDocumentId'
    get:
      summary: Get a Download Token to fetch vendor document files
      operationId: getVendorDocumentDownloadToken
      tags:
        - vendor-documents
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadToken'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/documents/{vendorDocumentId}/upload:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDocumentId'
    post:
      summary: Upload a vendor document
      operationId: uploadVendorDocument
      tags:
        - vendor-documents
      x-roles:
        - vendor_admin
      x-spring-plain-multipart-request: true
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VendorDocumentUploadMultipart'
      responses:
        '201':
          description: The created vendor document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDocument'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          description: The user doesn't have permissions to upload a project document
        '413':
          description: The total file size exceeds the allowed size of 2GB
        '415':
          description: Unsupported Filetype
        default:
          $ref: '#/components/responses/ServerError'
  /publications/v1/project/{projectId}/interest:
    put:
      parameters:
        - name: projectId
          schema:
            type: string
            format: uuid
          in: path
          required: true
          description: Id of the project the vendor wants to set or change his interest in a project.
      summary: Show or withdraw interest in a project for the vendor the logged in user belongs to.
      operationId: updateInterestInProject
      tags:
        - publications
      x-roles:
        - vendor_user
        - vendor_admin
      requestBody:
        description: ok
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectInterestRequest'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectInterestRequest'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /publications/v1/project/{projectId}/decline-invitation:
    post:
      parameters:
        - name: projectId
          schema:
            type: string
            format: uuid
          in: path
          required: true
          description: Id of the project the vendor wants to set or change his interest in a project.
      summary: Decline project invitation for the vendor the logged in user belongs to.
      description: |
        The vendor must first be invited by the procurement office to have the option to decline.
        Decline an invitation is used only for project with processType 'invitation'; otherwise the interest-status should be used.
        See `/publications/v1/project/{projectId}/interest`
      operationId: declineInvitationToProject
      tags:
        - publications
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '204':
          description: ok
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /publications/v2/project/project-search:
    parameters:
      - name: search
        description: |
          Search input, either empty or requires between 3 and 1000 valid characters.
        schema:
          type: string
          pattern: (^$)|.{3,1000}
        in: query
        required: false
      - name: lang
        schema:
          type: array
          items:
            $ref: '#/components/schemas/SystemLanguage'
        in: query
        required: false
        description: defines in which languages shall be searched in case of translated fields. In case this property is not defined or an empty array is given, then we search in all languages
      - name: projectSubTypes
        description: |
          quick-filter: if defined then publications need to be one of the given types
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ProjectSubType'
        in: query
        required: false
      - name: issuedByOrganizations
        description: |
          quick-filter: if defined then publications need to be issued by one of the selected organizations or as a 
          child of the selected organizations (procurement-offices, institution or competence centre).
        schema:
          type: array
          items:
            type: string
            format: uuid
        in: query
        required: false
      - name: processTypes
        description: |
          extended-filter: if defined, projects are filtered by one of the provided projects processTypes
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PubProcessType'
        in: query
        required: false
      - name: newestPubTypes
        description: |
          extended-filter: if defined, projects are filtered by one of the provided pubTypeFilter values matching newest publication.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ProjectSearchPubTypeFilter'
        in: query
        required: false
      - name: cpvCodes
        description: |
          extended-filter: if defined, projects are filtered by one of the provided CPV codes defined in any publications
        schema:
          type: array
          items:
            type: string
            format: cpvCode
        in: query
        required: false
      - name: cpcCodes
        description: |
          extended-filter: if defined, projects are filtered by one of the provided CPC codes defined in any publications
        schema:
          type: array
          items:
            type: string
            format: uuid
        in: query
        required: false
      - name: bkpCodes
        description: |
          extended-filter: if defined, projects are filtered by one of the provided BKP codes defined in any publications
        schema:
          type: array
          items:
            type: string
            format: bkpCode
        in: query
        required: false
      - name: ebkphCodes
        description: |
          extended-filter: if defined, projects are filtered by one of the provided eBKP-h codes defined in any publications
        schema:
          type: array
          items:
            type: string
            format: ebkphCode
        in: query
        required: false
      - name: ebkptCodes
        description: |
          extended-filter: if defined, projects are filtered by one of the provided eBKP-t codes defined in any publications
        schema:
          type: array
          items:
            type: string
            format: ebkptCode
        in: query
        required: false
      - name: npkCodes
        description: |
          extended-filter: if defined, projects are filtered by one of the provided NPK codes defined in any publications
        schema:
          type: array
          items:
            type: string
            format: npkCode
        in: query
        required: false
      - name: oagCodes
        description: |
          extended-filter: if defined, projecs are filtered by one of the provided OAG codes defined in any publications
        schema:
          type: array
          items:
            type: string
            format: oagCode
        in: query
        required: false
      - name: orderAddressCountryOnlySwitzerland
        description: |
          Filter for projects that take place in Switzerland. 

          If `true` will only return projects where the country of the `orderAddress` is `CH` - Switzerland.
          If `false` or omitted will apply no filter return all projects (swiss projects included).

          Specifically if the country in one of the defined `orderAddress`es is Switzerland.
          If a project is `with` lots, a project is found if at least one of the lot order addresses contains Switzerland.

          Not every publication defines a `orderAddress`. Projects with only such publications will be ignored with this filter.
        schema:
          type: boolean
        in: query
        required: false
      - name: orderAddressCantons
        description: |
          List of two letter abbreviation of a swiss canton e.g. `BE,FR,VD`.

          Filter for projects that take place in one of the specified cantons in Switzerland.

          Returns the projects where the canton of one of the defined `orderAddress`es is in the given list.  
          If a project is `with` lots, a project is found if at least one of the lot order addresses contain one of the defined cantons.

          Not every publication defines a `orderAddress` and a proc office can describe a `orderAddress` in a unstructured way, only as a description.
          Projects with only such publications will be ignored with this filter.
        schema:
          type: array
          items:
            type: string
            format: canton
        in: query
        required: false
      - name: newestPublicationFrom
        description: |
          extended-filter: if defined, projects are filtered by newest publication date after or equals the provided date
        schema:
          type: string
          format: date
        in: query
        required: false
      - name: newestPublicationUntil
        description: |
          extended-filter: if defined, projects are filtered by newest publication date before or equals the provided date
        schema:
          type: string
          format: date
        in: query
        required: false
      - name: lastItem
        in: query
        schema:
          type: string
        required: false
    get:
      summary: public project search
      description: |
        Returns all public projects meeting the search input and filters
        Note that you need to specify at least the search input or one of the quick filters, 
        i.e. a search query without search input nor quick-filter is not allowed

        Rolling pagination:
        To fetch the next page add the lastItem to the query. The last item can be found in the pagination-information
        of the first result and is a combination of newest publication date and project-number in the format 
        <date>|<projectNumber>
      operationId: getPublicProjectSearch
      tags:
        - publications
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectsSearch'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /publications/v1/project/{projectId}/publication-details/{publicationId}:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamPublicationId'
    get:
      summary: Get publication detail
      operationId: getPublicationDetail
      tags:
        - publications
      x-generic-response-body:
        model: PublicationDetailInterface
      x-service-returns-response: true
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationDetail'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /publications/v2/project/{projectId}/project-header:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
    get:
      summary: Get general header information of a project by id
      operationId: getPublicProjectHeaderById
      tags:
        - publications
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicProjectHeader'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /publications/v1/publication/{currentPublicationId}/past-publications:
    get:
      parameters:
        - name: currentPublicationId
          schema:
            type: string
            format: uuid
          in: path
          required: true
          description: Id of the publication for which the past publications should be retrieved.
        - name: lotId
          schema:
            type: string
            format: uuid
          in: query
          required: false
          description: Lot number of the publication for which the past publications should be retrieved.
      operationId: getPastPublications
      summary: Get past publications for this publication.
      tags:
        - publications
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PastPublications'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /subscriptions/v1/my:
    get:
      summary: user subscriptions
      description: |
        Returns all provided user subscriptions
      operationId: getMySubscription
      tags:
        - subscriptions
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriptions'
        '401':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /subscriptions/v1/my/{subscriptionId}:
    parameters:
      - name: subscriptionId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the subscription
    get:
      summary: Get information for specific subscription
      operationId: getSubscription
      tags:
        - subscriptions
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Create or update a user subscription
      operationId: createOrUpdateSubscription
      tags:
        - subscriptions
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionUpdate'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete a users subscription
      operationId: deleteSubscription
      tags:
        - subscriptions
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get publication draft
      operationId: getPubDraftBase
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftBaseInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Create a publication draft base
      operationId: createPubDraftBase
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftBaseInterface
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PubDraftCreationRequest'
            examples:
              createConstructionCallForBids:
                summary: Example request to create a construction tender pub draft in the open process with lots.
                value:
                  type: tender
                  title:
                    de: Mein Bau mit Losen
                  internalReference: (optional) A-38
                  processType: open
                  orderType: construction
                  lotsType: with
                  creationLanguage: de
              createCorrection:
                summary: Example request to create a correction for a published pub draft that can be corrected.
                value:
                  correction: true
                  referencingPubId: UUID of publication to correct
              createAward:
                summary: Example request to create an award for a lot of a project with lots
                value:
                  type: award
                  referencingPubId: 7f3f2d69-d42f-4e5e-94f6-cda6d46e5b09
                  referencingLotId: 4ad0a6bc-c0de-42ed-a13c-1d5ee5cfe94f
              createDirectAward:
                summary: Example request to create a direct award (Freihändige Vergabe) in the `direct` process.
                value:
                  type: direct_award
                  title:
                    de: Eine freihändige Vergabe
                  internalReference: (optional) A-38
                  orderType: supply
                  creationLanguage: de
              createDirectAwardForExternalPublication:
                summary: Example request to create a direct award (Direkter Zuschlag) that references a publication that started in the previous Simap app.
                value:
                  type: competition
                  directAward: true
                  title:
                    de: Ein Direkter Zuschlag
                  internalReference: (optional) A-38
                  processType: selective
                  lotsType: without
                  competitionType: idea_competition
                  creationLanguage: de
              createRequestForInformation:
                summary: Example request to create a request for information project / publication
                value:
                  type: request_for_information
                  title:
                    en: MY RFI
                  internalReference: (optional) A-38
                  creationLanguage: en
              createNewProjectFromTemplate:
                summary: Example request to create a initial publication and project based on a template
                value:
                  createFromTemplateProjectId: 7f3f2d69-d42f-4e5e-94f6-cda6d46e5b09
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '409':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete the pub_draft of the given id including its project in case there aren't any other pub_drafts for this project
      operationId: deletePubDraft
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/copy:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    put:
      summary: create a new publication draft as a copy of an existing publication draft (in any state)
      description: |
        Create a copy of an existing initial publication draft. All data is copied except:
          - any references to other publications (i.e. if call_for_bids was referring to an advance_notice)
          - internal_reference
          - project documents
          - qna rounds and qnas
          - involved vendors
          - procurement_project_contributors
          - project notification settings
      operationId: copyPubDraft
      tags:
        - pub-draft
      x-roles:
        - procurement_user
        - procurement_admin
      x-generic-response-body:
        model: PubDraftBaseInterface
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PubDraftCopyRequest'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/detail:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get publication draft detail
      operationId: getPubDraftDetail
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_print_user
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftDetailInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftDetail'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/wizard-state:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the wizard state for a publication
      operationId: getWizardState
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WizardState'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Update the wizard state for a publication
      operationId: updateWizardState
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WizardState'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WizardState'
        '400':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/submit:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    post:
      summary: Submit the validated pub-draft for publication.
      description: |
        Submit a `validated` pub draft for publication before the `editorialDeadline` has passed.

        Due to the possibility that the deadline has passed between the validation and submission, the system will check the
        `publicationDate / editorialDeadline` is valid / has passed.

        If at the time of submission this is invalid, the api will return an error - `412 Precondition failed`, and set the status of the pub draft to `draft`
        as the draft is no longer valid, a new publication date must be selected.
      operationId: submitPubDraft
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-generic-response-body:
        model: PubDraftBaseInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        '412':
          $ref: '#/components/responses/ServerError'
          description: |
            Precondition failed - The publication date has passed / the editorial deadline has passed, can't submit anymore
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/withdraw:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    post:
      summary: Withdraw a submitted pub-draft for publication.
      description: |
        Withdraw a `submitted` pub draft for publication before the `editorialDeadline` has passed so that it can be edited again.

        Will set the status back to `draft`.

        Once the editorial deadline has passed the draft can't be withdrawn.
      operationId: withdrawSubmittedPubDraft
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-generic-response-body:
        model: PubDraftBaseInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/translation-languages:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    patch:
      summary: Patch the translation languages of a pub draft
      operationId: patchPubDraftTranslationLanguages
      description: |
        Set the translations for the publication. Can only be set for the initial, the first publication of a project.
        The followup publications will use and require the set translations from the initial publication. 

        Direct Awards (both variants) and the RFI do not support the `summary` type, only `complete` translations are allowed.
        The `summary` entries will be ignored.
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftBaseInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTranslationLanguages'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/lots/order:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    put:
      summary: Reorder the lots of a pub draft with lots
      operationId: reorderPubDraftLots
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PubDraftLotsReorder'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftLots'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/lots/{lotId}:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
      - $ref: '#/components/parameters/ParamLotId'
    delete:
      summary: delete a lot of a pub draft
      operationId: deletePubDraftLot
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '204':
          description: No Content - Deleted
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/tender/{pubDraftId}/project-info:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the project info of a tender publication draft
      operationId: getPubDraftTenderProjectInfo
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTenderProjectInfoInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the project info of a tender publication draft
      description: |
        Use the read-only `processType` to differentiate between the models of the open, selective or invitation process for the tender project info pub draft.

        Patch Rules for Fields:

        For a initial tender pub draft; all fields provided by the model for this endpoint can be patched.

        For a correction of a tender publication; almost all fields can be changed. 
        The exceptions are:
        * The (project)`title` - can no longer change after the publication of the initial publication.
        * `stateContractArea` - can no longer change after the publication of the initial publication.
        * `publicationTed` - can no longer change after the publication of the initial publication.
        * `offerTypes` - only additions are allowed, can't remove an existing selection.

        For a follow-up publication, a tender that follows an advance notice. 
        The creation of a `call_for_bids` publication from a preceding `advance_notice` is a special case.
        Almost all fields can be changed.
        The exceptions are:
        * The (project)`title` - can no longer change after the publication of the initial publication.
        * `stateContractArea` - can no longer change after the publication of the initial publication.

        Further information for the patching of data on this endpoint. 

        Address Updates: If you patch an Address then you have to use the generated id. 
        The id is generated on the creation of the publication and can be obtained via the GET request.

        The `stateContractArea` selection affects wich `remediesNotice` template is used, if defined, in the `terms` step.
      operationId: patchPubDraftTenderProjectInfo
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftTenderProjectInfoInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTenderProjectInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/tender/{pubDraftId}/dates:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the dates of a tender publication draft
      operationId: getPubDraftTenderDates
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTenderDatesInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the dates of a tender publication draft
      operationId: patchPubDraftTenderDates
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftTenderDatesInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTenderDates'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/tender/{pubDraftId}/procurement:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the procurement data of a tender publication draft
      operationId: getPubDraftTenderProcurement
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTenderProcurementInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the procurement data of a tender publication draft
      operationId: patchPubDraftTenderProcurement
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftTenderProcurementInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTenderProcurement'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/tender/{pubDraftId}/criteria:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the criteria of a tender publication draft
      operationId: getPubDraftTenderCriteria
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTenderCriteriaInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderCriteria'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the criteria data of a tender publication draft
      operationId: patchPubDraftTenderCriteria
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftTenderCriteriaInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTenderCriteria'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderCriteria'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/tender/{pubDraftId}/terms:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the terms of a tender publication draft
      operationId: getPubDraftTenderTerms
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTenderTermsInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderTerms'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the terms of a tender publication draft
      operationId: patchPubDraftTenderTerms
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftTenderTermsInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTenderTerms'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderTerms'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/tender/{pubDraftId}/lots/{lotId}:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
      - name: lotId
        schema:
          type: string
          format: uuid
        in: path
        required: true
    get:
      summary: Get a lot of a tender pub draft
      operationId: getPubDraftTenderLot
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTenderLotInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: create a new lot for the tender pub draft
      operationId: createPubDraftTenderLot
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTenderLotInterface
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PubDraftLotDescriptionCreate'
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the lot of a tender pub draft
      operationId: patchPubDraftTenderLot
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftTenderLotInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTenderLot'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/tender/{pubDraftId}/lots/{lotId}/order-type:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
      - name: lotId
        schema:
          type: string
          format: uuid
        in: path
        required: true
    patch:
      summary: Change the `orderType` of an individual lot in a tender project `with` lots.
      description: |
        In tender projects `with` lots and when the process type is `open` or `selective`
        It's possible to create tenders with mixed `orderType` lots e.g. where one lot is for a `construction` and another for a `supply`. 

        The project retains the main `orderType` that was selected upon creation but individual lots can have a different 
        type.
      operationId: changeLotOrderType
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTenderLotInterface
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              title: PubDraftTenderLotPatchOrderType
              properties:
                orderType:
                  $ref: '#/components/schemas/PubOrderType'
              required:
                - orderType
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTenderLot'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/tender/{pubDraftId}/invited-vendors:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the invited vendors of a tender publication draft
      operationId: getPubDraftTenderInvitedVendors
      description: Invited vendors are only available if project was created with processType `invitation`
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubInvitedVendors'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the invited vendors of a tender publication draft
      operationId: patchPubDraftTenderInvitedVendors
      description: Invited vendors are only available if project was created with processType `invitation`
      tags:
        - pub-draft-tender
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubInvitedVendorsPatch'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubInvitedVendors'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/competition/{pubDraftId}/project-info:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the project info of a competition publication draft
      operationId: getPubDraftCompetitionProjectInfo
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftProjectInfoInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the project info of a competition publication draft
      description: |
        Use the read-only `processType` to differentiate between the models of the open, selective or invitation process.

        Patch Rules for Fields:

        For a initial competition pub draft; all fields provided by the model for this endpoint can be patched.

        For a correction of a competition publication; almost all fields can be changed. 
        The exceptions are:
        * The (project)`title` - can no longer change after the publication of the initial publication.
        * `stateContractArea` - can no longer change after the publication of the initial publication.
        * `offerTypes` - only additions are allowed, can't remove an existing selection.

        For a follow-up publication, a competition that follows an advance notice. 
        The creation of a `call_for_bids` publication from a preceding `advance_notice` is a special case.
        Almost all fields can be changed.
        The exceptions are:
        * The (project)`title` - can no longer change after the publication of the initial publication.
        * `stateContractArea` - can no longer change after the publication of the initial publication.

        Further information for the patching of data on this endpoint.

        Address Updates: If you patch an Address then you have to use the generated id. 
        The id is generated on the creation of the publication and can be obtained via the GET request.

        The `stateContractArea` selection affects wich `remediesNotice` template is used, if defined, in the `terms` step.
      operationId: patchPubDraftCompetitionProjectInfo
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftProjectInfoInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftProjectInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/competition/{pubDraftId}/dates:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the dates of a competition publication draft
      operationId: getPubDraftCompetitionDates
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftDatesInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the dates of a competition publication draft
      operationId: patchPubDraftCompetitionDates
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftDatesInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftDates'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/competition/{pubDraftId}/procurement:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the procurement data of a competition publication draft
      operationId: getPubDraftCompetitionProcurement
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the procurement data of a competition publication draft
      operationId: patchPubDraftCompetitionProcurement
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftProcurement'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/competition/{pubDraftId}/criteria:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the dates of a competition publication draft
      operationId: getPubDraftCompetitionCriteria
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftCriteriaInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCriteria'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the criteria data of a competition publication draft
      operationId: patchPubDraftCompetitionCriteria
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftCriteriaInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftCriteria'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCriteria'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/competition/{pubDraftId}/terms:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the terms of a competition publication draft
      operationId: getPubDraftCompetitionTerms
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTermsExtendedInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTermsExtended'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the terms of a competition publication draft
      operationId: patchPubDraftCompetitionTerms
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftTermsExtendedInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTermsExtended'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTermsExtended'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/competition/{pubDraftId}/lots/{lotId}:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
      - name: lotId
        schema:
          type: string
          format: uuid
        in: path
        required: true
    get:
      summary: Get a lot of a competition pub draft
      operationId: getPubDraftCompetitionLot
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCompetitionLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: create a new lot for the competition pub draft
      operationId: createPubDraftCompetitionLot
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PubDraftLotDescriptionCreate'
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCompetitionLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the lot of a competition pub draft
      operationId: patchPubDraftCompetitionLot
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftCompetitionLot'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCompetitionLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/competition/{pubDraftId}/invited-vendors:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the invited vendors of a competition publication draft
      operationId: getPubDraftCompetitionInvitedVendors
      description: Invited vendors are only available if project was created with processType `invitation`
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubInvitedVendors'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the invited vendors of a competition publication draft
      operationId: patchPubDraftCompetitionInvitedVendors
      description: Invited vendors are only available if project was created with processType `invitation`
      tags:
        - pub-draft-competition
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubInvitedVendorsPatch'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubInvitedVendors'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/study-contract/{pubDraftId}/project-info:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the project info of a study publication draft
      operationId: getPubDraftStudyContractProjectInfo
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftProjectInfoInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the project info of a study-contract publication draft
      description: |
        Use the read-only `processType` to differentiate between the models of the open, selective or invitation process.

        Patch Rules for Fields:

        For a initial study-contract pub draft; all fields provided by the model for this endpoint can be patched.

        For a correction of a study-contract publication; almost all fields can be changed. 
        The exceptions are:
        * The (project)`title` - can no longer change after the publication of the initial publication.
        * `stateContractArea` - can no longer change after the publication of the initial publication.
        * `offerTypes` - only additions are allowed, can't remove an existing selection.

        For a follow-up publication, a study-contract that follows an advance notice. 
        The creation of a `call_for_bids` publication from a preceding `advance_notice` is a special case.
        Almost all fields can be changed.
        The exceptions are:
        * The (project)`title` - can no longer change after the publication of the initial publication.
        * `stateContractArea` - can no longer change after the publication of the initial publication.

        Further information for the patching of data on this endpoint.

        Address Updates: If you patch an Address then you have to use the generated id. 
        The id is generated on the creation of the publication and can be obtained via the GET request.

        The `stateContractArea` selection affects wich `remediesNotice` template is used, if defined, in the `terms` step.
      operationId: patchPubDraftStudyContractProjectInfo
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftProjectInfoInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftProjectInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/study-contract/{pubDraftId}/dates:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the dates of a study publication draft
      operationId: getPubDraftStudyContractDates
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftDatesInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the dates of a study publication draft
      operationId: patchPubDraftStudyContractDates
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftDatesInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftDates'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/study-contract/{pubDraftId}/procurement:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the procurement data of a study publication draft
      operationId: getPubDraftStudyContractProcurement
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the procurement data of a study publication draft
      operationId: patchPubDraftStudyContractProcurement
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftProcurement'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/study-contract/{pubDraftId}/criteria:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the criteria of a study publication draft
      operationId: getPubDraftStudyContractCriteria
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftCriteriaInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCriteria'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the criteria data of a study publication draft
      operationId: patchPubDraftStudyContractCriteria
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftCriteriaInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftCriteria'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCriteria'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/study-contract/{pubDraftId}/terms:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the terms of a study publication draft
      operationId: getPubDraftStudyContractTerms
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftTermsExtendedInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTermsExtended'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the terms of a study publication draft
      operationId: patchPubDraftStudyContractTerms
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftTermsExtendedInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftTermsExtended'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftTermsExtended'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/study-contract/{pubDraftId}/lots/{lotId}:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
      - $ref: '#/components/parameters/ParamLotId'
    get:
      summary: Get a lot of a study pub draft
      operationId: getPubDraftStudyContractLot
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftStudyContractLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: create a new lot for the study pub draft
      operationId: createPubDraftStudyContractLot
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PubDraftLotDescriptionCreate'
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftStudyContractLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the lot of a study pub draft
      operationId: patchPubDraftStudyContractLot
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftStudyContractLot'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftStudyContractLot'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/study-contract/{pubDraftId}/invited-vendors:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the invited vendors of a study publication draft
      operationId: getPubDraftStudyContractInvitedVendors
      description: Invited vendors are only available if project was created with processType `invitation`
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubInvitedVendors'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the invited vendors of a study publication draft
      operationId: patchPubDraftStudyContractInvitedVendors
      description: Invited vendors are only available if project was created with processType `invitation`
      tags:
        - pub-draft-study-contract
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubInvitedVendorsPatch'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubInvitedVendors'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/award/{pubDraftId}/project-info:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the project info of a award publication draft
      operationId: getPubDraftAwardProjectInfo
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAwardProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the project info of a award publication draft
      operationId: patchPubDraftAwardProjectInfo
      description: |
        Used for publications with type `award` or `direct-award`.

        When publication type is `direct-award`, one can edit the (project)`title`, `stateContractArea` and the addresses.

        The `stateContractArea` selection affects wich `remediesNotice` template is used, if defined, in the award-decision step. 

        On type `award`, only can only edit the addresses.

        Address Updates: If you patch an Address then you have to use the generated id. 
        The id is generated on the creation of the publication and can be obtained via the GET request.
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftAwardProjectInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAwardProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v2/award/{pubDraftId}/procurement:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the procurement data of a direct award publication draft
      operationId: getPubDraftAwardProcurement
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-generic-response-body:
        model: PubDraftDirectAwardProcurementInterface
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftDirectAwardProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the procurement data of a direct award publication draft
      operationId: patchPubDraftAwardProcurement
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      x-generic-response-body:
        model: PubDraftDirectAwardProcurementInterface
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftDirectAwardProcurement'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftDirectAwardProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/award/{pubDraftId}/decision:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the decision data of an award publication draft
      operationId: getPubDraftAwardDecision
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAwardDecisionStep'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the decision data of an award publication draft
      operationId: patchPubDraftAwardDecision
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftAwardDecisionStep'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAwardDecisionStep'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/award/{pubDraftId}/statistics:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the statistics data of an award publication draft
      operationId: getPubDraftAwardStatistics
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAwardStatistics'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the statistics data of an award publication draft
      operationId: patchPubDraftAwardStatistics
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftAwardStatistics'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAwardStatistics'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v2/award/{pubDraftId}/sustainability:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the sustainability form data of an award publication draft
      operationId: getPubDraftAwardSustainabilityForm
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAwardSustainabilityForm'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the sustainability form data of an award publication draft
      operationId: patchPubDraftAwardSustainabilityForm
      tags:
        - pub-draft-award
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftAwardSustainabilityForm'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAwardSustainabilityForm'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/rfi/{pubDraftId}/project-info:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the project info of a request for information pub draft
      operationId: getPubDraftRfiProjectInfo
      tags:
        - pub-draft-rfi
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRfiProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the project info of a request for information pub draft
      description: |
        Patch Rules for Fields:

        For a initial rfi pub draft; all fields provided by the model for this endpoint can be patched.

        For a correction of a rfi publication; almost all fields can be changed.
        The exceptions are:
        * The (project)`title` - can no longer change after the publication of the initial publication.
        * `offerTypes` - only additions are allowed, can't remove an existing selection.

        Further information for the patching of data on this endpoint.

        Address Updates: If you patch an Address then you have to use the generated id. 
        The id is generated on the creation of the publication and can be obtained via the GET request.
      operationId: patchPubDraftRfiProjectInfo
      tags:
        - pub-draft-rfi
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftRfiProjectInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRfiProjectInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/rfi/{pubDraftId}/dates:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the dates of a request for information pub draft
      operationId: getPubDraftRfiDates
      tags:
        - pub-draft-rfi
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRfiDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the dates of a request for information pub draft
      operationId: patchPubDraftRfiDates
      tags:
        - pub-draft-rfi
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftRfiDates'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRfiDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/rfi/{pubDraftId}/procurement:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the procurement data of a request for information pub draft
      operationId: getPubDraftRfiProcurement
      tags:
        - pub-draft-rfi
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRfiProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the procurement data of a request for information pub draft
      operationId: patchPubDraftRfiProcurement
      tags:
        - pub-draft-rfi
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftRfiProcurement'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRfiProcurement'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/rfi/{pubDraftId}/terms:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the terms of a request for information pub draft
      operationId: getPubDraftRfiTerms
      tags:
        - pub-draft-rfi
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRfiTerms'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the terms of a request for information draft
      operationId: patchPubDraftRfiTerms
      tags:
        - pub-draft-rfi
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftRfiTerms'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRfiTerms'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/abandonment/{pubDraftId}/abandonment:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the data of an abandonment pub draft
      operationId: getPubDraftAbandonmentInfo
      tags:
        - pub-draft-abandonment
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAbandonmentInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the data of an abandonment pub draft
      operationId: patchPubDraftAbandonmentInfo
      tags:
        - pub-draft-abandonment
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftAbandonmentInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftAbandonmentInfo'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/revocation/{pubDraftId}/revocation:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the information of a revocation publication draft
      operationId: getPubDraftRevocation
      tags:
        - pub-draft-revocation
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRevocationInfo'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the information of a revocation publication draft
      operationId: patchPubDraftRevocation
      tags:
        - pub-draft-revocation
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftRevocationInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftRevocationInfo'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/correction/{pubDraftId}/correction:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the data of a corrected pub draft
      operationId: getPubDraftCorrectionInfo
      tags:
        - pub-draft-correction
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCorrectionInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the data of a pub draft correction
      operationId: patchPubDraftCorrectionInfo
      tags:
        - pub-draft-correction
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftCorrectionInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftCorrectionInfo'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/participant-selection/{pubDraftId}/project-info:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the project info of a participant selection publication draft
      operationId: getPubDraftParticipantSelectionProjectInfo
      tags:
        - pub-draft-participant-selection
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubBaseProjectInfoAddress'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the project info of a participant selection publication draft
      operationId: patchPubDraftParticipantSelectionProjectInfo
      description: |
        Address Updates: If you patch an Address then you have to use the generated id. 
        The id is generated on the creation of the publication and can be obtained via the GET request.
      tags:
        - pub-draft-participant-selection
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubBaseProjectInfoAddress'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/participant-selection/{pubDraftId}/participant-selection:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the participant selection data
      operationId: getPubDraftParticipantSelection
      tags:
        - pub-draft-participant-selection
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftParticipantSelectionInfo'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the participant selection data
      operationId: patchPubDraftParticipantSelection
      tags:
        - pub-draft-participant-selection
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftParticipantSelectionInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftParticipantSelectionInfo'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/selective-offering-phase/{pubDraftId}/notice:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the notice information of a selective_offering_phase publication draft
      operationId: getPubDraftSelectiveOfferingPhaseNotice
      tags:
        - pub-draft-selective-offering-phase
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseNotice'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the information of a selective_offering_phase publication draft
      operationId: patchPubDraftSelectiveOfferingPhaseNotice
      tags:
        - pub-draft-selective-offering-phase
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseNotice'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseNotice'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/selective-offering-phase/{pubDraftId}/dates:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the dates of a selective_offering_phase publication draft
      operationId: getPubDraftSelectiveOfferingPhaseDates
      tags:
        - pub-draft-selective-offering-phase
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the dates of a selective_offering_phase publication draft
      operationId: patchPubDraftSelectiveOfferingPhaseDates
      tags:
        - pub-draft-selective-offering-phase
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseDates'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseDates'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/selective-offering-phase/{pubDraftId}/criteria:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    get:
      summary: Get the criteria of a selective_offering_phase publication draft
      operationId: getPubDraftSelectiveOfferingPhaseCriteria
      tags:
        - pub-draft-selective-offering-phase
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseCriteria'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the criteria of a selective_offering_phase publication draft
      operationId: patchPubDraftSelectiveOfferingPhaseCriteria
      tags:
        - pub-draft-selective-offering-phase
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseCriteria'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseCriteria'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/validate:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
      - name: dry-run
        schema:
          type: boolean
          default: false
        in: query
        required: false
        description: If set to true, validation will be run in dry-run mode and doesn't modify and calculate any data, nor transition to the 'validated' state.
    post:
      summary: Trigger the validation and get the result of that validation for a pub draft.
      description: |
        A call to this endpoint will trigger the validation for the given pub draft.

        It will return the validation result with the errors per available step of that draft.

        For pub drafts with lots, the validation on a lot will be handled as a step, meaning each lot will have an entry in the map, the key will be lot--LOT_ID
        and the list of validation errors for that lot.

        See the `PubSteps` enum for the available steps in the system

        If the validation is successful i.e. the result contains no errors, the query-parameter 'dry-run' is not set to 'true' and the pub_draft is not a template, the BE will 
          - update the status of the draft to `validated`
          - run TED validation if publication should be sent to TED
          - calculated diff if publication is a correction
      operationId: validatePubDraft
      tags:
        - pub-draft
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationResults'
              examples:
                without_lot:
                  value:
                    validationResults:
                      project-info:
                        - field: publicationLanguages
                          errorKey: required
                          invalidValue: null
                      dates:
                        - field: publicationDate
                          errorKey: min
                          invalidValue: '2020-01-01'
                      procurement:
                        - field: cpvCode
                          errorKey: failed_range
                          invalidValue: '03000000'
                      criteria:
                        - field: awardCriteria[0].weighting
                          errorKey: min
                          invalidValue: -1
                        - field: awardCriteria.isPriceCriterion
                          errorKey: max
                          invalidValue: 2
                      terms:
                        - field: remediesNotice
                          errorKey: required
                          invalidValue:
                            de: ''
                            fr: ''
                            it: ''
                            en: ''
                with_lots:
                  value:
                    validationResults:
                      project-info:
                        - field: publicationLanguages
                          errorKey: required
                          invalidValue: null
                        - field: procurementRecipientAddress.name
                          errorKey: required
                          invalidValue: null
                      dates:
                        - field: publicationDate
                          errorKey: min
                          invalidValue: '2020-01-01'
                      procurement:
                        - field: cpvCode
                          errorKey: failed_range
                          invalidValue: '03000000'
                      lot--91816901-1ffc-403d-af0b-1c78e7c263a3:
                        - field: orderAddress.countryId
                          errorKey: required
                          invalidValue: null
                        - field: awardCriteria[0].weighting
                          errorKey: min
                          invalidValue: -1
                        - field: awardCriteria.isPriceCriterion
                          errorKey: max
                          invalidValue: 2
                      lot--20c620ae-2443-40bd-b267-bd798a1a0a08: []
                      terms:
                        - field: remediesNotice
                          errorKey: required
                          invalidValue:
                            de: ''
                            fr: ''
                            it: ''
                            en: ''
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/past-publications:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamPubDraftId'
        - $ref: '#/components/parameters/QueryParamLotId'
      operationId: getPastPublishedPubDrafts
      summary: Get past publications for this pub-draft.
      description: |
        Returns the past published pub-drafts based on the given parameters and `submitted` or `to_publish` publications in the case were another draft is open.

        e.g. submitted award revocation and award draft for the revoked award.
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      tags:
        - pub-draft
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PastPublishedPubDrafts'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /pub-drafts/v1/pd/{pubDraftId}/past-publication-actions:
    get:
      parameters:
        - $ref: '#/components/parameters/ParamPubDraftId'
        - $ref: '#/components/parameters/QueryParamLotId'
      operationId: getPastPublishedPubDraftActions
      summary: Get past publication actions for this pub-draft.
      description: |
        returns the past pub-drafts actions available on this pub-draft. 
        LotId needs to be provided in case the project is created with lots as the available actions depend
        on the status of the project in a specific lot.
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      tags:
        - pub-draft
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcOfficePubActions'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /roles/v1/my:
    get:
      operationId: getRoles
      summary: Get available roles and organizations for the current user.
      tags:
        - roles
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      responses:
        '200':
          description: gives all possible combinations for roles and organizations for a user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RolesAndOrganizations'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      operationId: setRole
      summary: Sets a role and organization combination for the current user.
      tags:
        - roles
      x-roles:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleAndOrganizationChange'
      responses:
        '200':
          description: Changes role and organization of current user. Frontend needs to refresh access token to make the change active!
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleAndOrganizationChange'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /publishers/v1:
    get:
      summary: Get the list of publishers
      operationId: listPublishers
      tags:
        - publishers
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Publishers'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /publishers/v1/my:
    get:
      summary: Get the publisher (Amtsblatt) assigned to my current organization
      operationId: getMyPublisher
      tags:
        - publishers
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Publisher'
        '400':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /qnas/v1/rounds/{roundId}/publish:
    put:
      summary: Publish all answers in 'draft' state in the given qna round
      operationId: publishAnswers
      parameters:
        - in: path
          name: roundId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the qna round to publish questions in 'draft' state.
      tags:
        - qnas
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: All questions published by this request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QnaPublishResponses'
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /qnas/v1/rounds/{roundId}/qna/{qnaId}:
    put:
      summary: Add new question
      operationId: addQuestion
      parameters:
        - in: path
          name: roundId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the qna round
        - in: path
          name: qnaId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the current qna
      tags:
        - qnas
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Question'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Qna'
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Updates a question in the qnas
      operationId: updateQna
      parameters:
        - in: path
          name: roundId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the qna round
        - in: path
          name: qnaId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the current qna
      tags:
        - qnas
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QnaUpdate'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Qna'
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Deletes a question in the qnas
      operationId: deleteQna
      parameters:
        - in: path
          name: roundId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the qna round
        - in: path
          name: qnaId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the current qna
      tags:
        - qnas
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '204':
          description: ok
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /qnas/v1/rounds/{roundId}/qna/{qnaId}/publish:
    put:
      summary: Publish this answer
      operationId: publishQna
      parameters:
        - in: path
          name: roundId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the qna round
        - in: path
          name: qnaId
          schema:
            type: string
            format: uuid
          required: true
          description: |
            The id of the qna pair
      tags:
        - qnas
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QnaPublishResponse'
        '400':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /project-documents/v1/docs/{projectDocumentId}:
    parameters:
      - $ref: '#/components/parameters/ParamProjectDocumentId'
    get:
      parameters:
        - $ref: '#/components/parameters/QueryParamToken'
      summary: |
        Download a project document by id, authenticate via token in query parameter -- token can be obtained by:
        /project-documents/v1/docs/{projectDocumentId}/token
      operationId: downloadProjectDocument
      tags:
        - project-documents
      x-service-returns-response: true
      responses:
        '200':
          description: Project document as download
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /project-documents/v1/docs/{projectDocumentId}/token:
    parameters:
      - $ref: '#/components/parameters/ParamProjectDocumentId'
    get:
      summary: Get a Download Token to fetch protected files
      operationId: getDownloadToken
      tags:
        - project-documents
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadToken'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /project-documents/v1/docs/zip-download:
    get:
      parameters:
        - $ref: '#/components/parameters/QueryParamToken'
      summary: |
        Download a zip file containing all project documents, authenticate via token in query parameter -- token can be obtained by:
        * `/procoffices/v1/my/projects/{projectId}/documents/zip-token` 
        * `/vendors/v1/my/projects/{projectId}/documents/zip-token`
      operationId: downloadProjectDocumentsZip
      tags:
        - project-documents
      x-service-returns-response: true
      x-streaming-response-body: true
      responses:
        '200':
          description: chunked binary of Zip file containing all project documents
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/pub-drafts/{pubDraftId}/publish:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    put:
      summary: Set the publication-date of a draft to today.
      description: |
        Testing-function, only available on non-productive systems!
        Will publish the pub-draft, if it's previously submitted, on the next run of the publish-job of the middleware.
      operationId: publishPubDraft
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      responses:
        '204':
          description: ok
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/pub-drafts/{pubDraftId}/mark-as-to-publish:
    parameters:
      - $ref: '#/components/parameters/ParamPubDraftId'
    put:
      summary: mark a submitted publication as `to_publish`, override the default mechanism
      description: |
        Testing-function, only available on non-productive systems!
         
        This will mark the given publication as `to_publish`, overriding the calculated editorial_deadline, set it to know.

        With this, one can set the lock a publication before the system would normally lock it. Makes it possible to
        test the cases, that depend on the state, without waiting on the fixed times that are defined by the publishers config.  

        The publication needs to be `submitted`.
      operationId: markAsToPublish
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      responses:
        '204':
          description: ok
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-abandonment-test-scenario:
    post:
      summary: create abandonment test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createAbandonmentTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AbandonmentTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-advance-notice-test-scenario:
    post:
      summary: create advance_notice test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createAdvanceNoticeTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdvanceNoticeTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-award-test-scenario:
    post:
      summary: create award test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createAwardTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AwardTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-call-for-bids-test-scenario:
    post:
      summary: create call_for_bids test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createCallForBidsTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallForBidsTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-correction-test-scenario:
    post:
      summary: create correction test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createCorrectionTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CorrectionTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-direct-award-test-scenario:
    post:
      summary: create direct award test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createDirectAwardTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DirectAwardTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-participantselection-test-scenario:
    post:
      summary: create participant selection test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createParticipantSelectionTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParticipantSelectionTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-selectiveofferingphase-test-scenario:
    post:
      summary: create selective offering phase test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createSelectiveOfferingPhaseTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SelectiveOfferingPhaseTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-revocation-test-scenario:
    post:
      summary: create revocation test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createRevocationTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RevocationTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /test/v1/create-request-for-information-test-scenario:
    post:
      summary: create request_for_inofrmation test scenario
      description: |
        Testing-function, only available on non-productive systems!
      operationId: createRequestForInformationTestScenario
      tags:
        - test
      x-roles:
        - procurement_user
        - procurement_admin
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestForInformationTestScenario'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestScenarioResult'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /statistics/v1/my/awarded-vendors-export:
    get:
      parameters:
        - name: from
          schema:
            type: string
            format: date
          in: query
          required: true
          description: filter list of awarded publications having a publication date bigger or equals to the provided `from` date.
        - name: to
          schema:
            type: string
            format: date
          in: query
          required: true
          description: filter list of awarded publications having a publication date smaller or equals to the provided `to` date.
      summary: Get the list of awarded vendors and award publications based on the current user's role and organization
      operationId: exportAwardedVendors
      tags:
        - statistics
      x-roles:
        - procurement_admin
        - competence_centre_admin
        - simap_admin
      x-service-returns-response: true
      x-streaming-response-body: true
      responses:
        '200':
          description: chunked json of `AwardedVendorExport`, separated by line. Input parameters are additionally sent back as header values.
          headers:
            from:
              schema:
                type: string
                format: date
              description: results are filtered having a publication bigger or equals to this `from` date
            to:
              schema:
                type: string
                format: date
              description: results are filtered having a publication smaller or equals to this `to` date
          content:
            application/x-ndjson:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /statistics/v2/my/sustainability-export:
    get:
      parameters:
        - name: from
          schema:
            type: string
            format: date
          in: query
          required: true
          description: filter list of sustainability form data of awards having a publication date bigger or equals to the provided `from` date.
        - name: to
          schema:
            type: string
            format: date
          in: query
          required: true
          description: filter list of sustainability form data of awards having a publication date smaller or equals to the provided `to` date.
      summary: Get the list of sustainability form data of awards based on the current user's role and organization
      description: |
        This export excludes sustainability form data of revoked awards or of awards of abandonend projects/lots as well as awards not having sustainability form data.
        The result is returned as chunked json (`application/x-ndjson`). Every row has a discriminator property `selectedSustainabilityFormType` to distinguish between 
        different forms. The returned rows are sorted as following:
          * `selectedSustainabilityFormType` (nh01, nh02, nh03, nh04, nh05)
          * `publicationNumber` asc
      operationId: exportSustainabilityForm
      tags:
        - statistics
      x-roles:
        - procurement_admin
        - competence_centre_admin
        - simap_admin
      x-service-returns-response: true
      x-streaming-response-body: true
      responses:
        '200':
          description: chunked json of `SustainabilityFormExport`, separated by line. Input parameters are additionally sent back as header values.
          headers:
            from:
              schema:
                type: string
                format: date
              description: results are filtered having a publication bigger or equals to this `from` date
            to:
              schema:
                type: string
                format: date
              description: results are filtered having a publication smaller or equals to this `to` date
          content:
            application/x-ndjson:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /statistics/v1/my/call-for-bids-export:
    get:
      parameters:
        - name: from
          schema:
            type: string
            format: date
          in: query
          required: true
          description: filter list of call_for_bids publications having a publication date bigger or equals to the provided `from` date.
        - name: to
          schema:
            type: string
            format: date
          in: query
          required: true
          description: filter list of call_for_bids publications having a publication date smaller or equals to the provided `to` date.
      summary: Get the list of call_for_bids publications based on the current user's role and organization
      operationId: exportCallForBids
      tags:
        - statistics
      x-roles:
        - procurement_admin
        - competence_centre_admin
        - simap_admin
      x-service-returns-response: true
      x-streaming-response-body: true
      responses:
        '200':
          description: chunked json of `CallForBidsExport`, separated by line. Input parameters are additionally sent back as header values.
          headers:
            from:
              schema:
                type: string
                format: date
              description: results are filtered having a publication bigger or equals to this `from` date
            to:
              schema:
                type: string
                format: date
              description: results are filtered having a publication smaller or equals to this `to` date
          content:
            application/x-ndjson:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /statistics/v1/my/wto-statistics:
    get:
      parameters:
        - name: from
          schema:
            type: string
            format: date
          in: query
          required: true
          description: consider awards having a publication date bigger or equals to the `from` date.
        - name: to
          schema:
            type: string
            format: date
          in: query
          required: true
          description: consider awards having a publication date smaller or equals to the `to` date.
        - name: euroExchangeRate
          schema:
            type: number
            format: float
          in: query
          required: true
          description: exchange rate of euro to chf used to convert and aggregate the total prices of awards with currency 'eur'.
        - name: usdExchangeRate
          schema:
            type: number
            format: float
          in: query
          required: true
          description: exchange rate of usd to chf used to convert and aggregate the total prices of awards with currency 'usd'.
        - name: procOfficeTypeFilter
          schema:
            $ref: '#/components/schemas/WTOStatisticsProcOfficeType'
          in: query
          required: false
          description: |
            consider awards of proc_offices matching the provided proc_office filter type.
            There are 3 aggregation modes:

            - Procurement Offices:
              Aggregation of price totals is performed at the level of individual procurement offices.
              Applies to the types `central_or_decentral_federation`, `other_federation`, `entire_federal_administration`.

            - Cantons:
              Aggregation is performed at the canton level. The total prices of all procurement offices under the nodes `cantonal` and `other_cantonal` are combined.
              Applies to type `cantonal_or_other_cantonal`.

            - Communal Procurement Offices Aggregated by Canton:
              Corresponds to procurement offices under the nodes where the `ProcOfficeType` is either `communal` or `other_communal`, aggregated per canton.
              Applies to type `communal_or_other_communal`.
      summary: Get the aggregated wto statistic data based on the provided filters and the current user's role and organization
      operationId: exportWTOStatistics
      tags:
        - statistics
      x-roles:
        - procurement_admin
        - competence_centre_admin
        - simap_admin
      responses:
        '200':
          description: Get export of aggregated values of WTO related awards and direct_awards
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WTOStatisticsExport'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /static/v1/pages/{pageName}:
    parameters:
      - name: pageName
        schema:
          $ref: '#/components/schemas/PageName'
        in: path
        required: true
        description: Specify from which page the content should be retrieved
    get:
      summary: Get the content for a page identified by given PageName.
      operationId: getContentByPageName
      tags:
        - static-content
      x-service-returns-response: true
      responses:
        '200':
          description: page content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageComponent'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Patch the whole set of content-components over all tabs for a page identified by given PageName.
      description: |
        Changing the type of an existing content-component isn't possible. A content-component with a new id and type is needed, which results in the old component with the old type to be deleted in the database.
      operationId: patchContentByPageName
      tags:
        - static-content
      x-roles:
        - simap_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PageComponent'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageComponent'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /static/v1/article-items/{articleItemId}:
    parameters:
      - name: articleItemId
        schema:
          type: string
          format: uuid
        in: path
        required: true
    get:
      summary: Get the article-item by it's id.
      operationId: getArticleItemById
      tags:
        - static-content
      x-service-returns-response: true
      responses:
        '200':
          description: Content of article-item
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentComponentArticleItem'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Create an article-item and provide a new id.
      operationId: createArticleItem
      tags:
        - static-content
      x-roles:
        - simap_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContentComponentArticleItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentComponentArticleItem'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    patch:
      summary: Update an article-item with the given request-body
      operationId: updateArticleItem
      tags:
        - static-content
      x-roles:
        - simap_admin
      x-spring-jsonnode-requestbody: true
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/ContentComponentArticleItem'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentComponentArticleItem'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete an article-item with the given id
      operationId: deleteArticleItem
      tags:
        - static-content
      x-roles:
        - simap_admin
      x-spring-jsonnode-requestbody: true
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /static/v1/article-items/search/{category}:
    parameters:
      - name: category
        schema:
          $ref: '#/components/schemas/ContentComponentArticleCategory'
        in: path
        required: true
    get:
      summary: Get all article-items which have given category.
      operationId: getArticleItemByCategory
      tags:
        - static-content
      x-service-returns-response: true
      responses:
        '200':
          description: Content of article-item
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ContentComponentArticleItem'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/projects/{projectId}/digital-submissions:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/QueryParamLotId'
    get:
      summary: Get the digital submissions for a project
      description: provide a lotId if project was created with lots
      operationId: getVendorDigitalSubmissions
      tags:
        - vendor-submissions
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionDetails'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/projects/{projectId}/digital-submissions/{vendorDigitalSubmissionId}:
    parameters:
      - $ref: '#/components/parameters/ParamProjectId'
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionId'
    get:
      summary: Get the digital submission base information
      operationId: getVendorDigitalSubmission
      tags:
        - vendor-submissions
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    put:
      summary: Create a new submission for a project
      operationId: createVendorDigitalSubmission
      tags:
        - vendor-submissions
      x-roles:
        - vendor_user
        - vendor_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorDigitalSubmissionCreate'
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete an existing submission for a project
      operationId: deleteVendorDigitalSubmission
      tags:
        - vendor-submissions
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/digital-submissions/{vendorDigitalSubmissionId}/submit:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionId'
    post:
      summary: |
        Submit the vendor-submission. The submission will be visible for the procurement office after the offer-deadline
        has been reached.
      operationId: submitVendorDigitalSubmission
      tags:
        - vendor-submissions
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionBase'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        '412':
          $ref: '#/components/responses/ServerError'
          description: |
            Precondition failed - The offer-deadline has passed can't submit anymore
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/digital-submissions/{vendorDigitalSubmissionId}/lots/{lotId}:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionId'
      - $ref: '#/components/parameters/ParamLotId'
    put:
      summary: |
        Add an available lot to the current submission.
      operationId: addLotToVendorDigitalSubmission
      tags:
        - vendor-submissions
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        '412':
          $ref: '#/components/responses/ServerError'
          description: |
            Precondition failed - The submission can't be altered anymore.
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: |
        Remove a lot from the current submission.
      operationId: removeLotFromVendorDigitalSubmission
      tags:
        - vendor-submissions
      x-roles:
        - vendor_admin
        - vendor_user
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionBase'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        '412':
          $ref: '#/components/responses/ServerError'
          description: |
            Precondition failed - The submission can't be altered anymore.
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/digital-submissions/{vendorDigitalSubmissionId}/documents:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionId'
      - $ref: '#/components/parameters/QueryParamLotId'
    get:
      summary: get the vendor digital submissions documents for a submissions
      description: |
        get documents of a vendor digital submission. If no lotId as query parameter is provided, all generic documents attached
        to the submission are returned. If the submission is related to a specific lot (offering submission in the second phase
        of a selective process), lotId of related lot must be provided to filter correct documents
      operationId: getVendorDigitalSubmissionDocuments
      tags:
        - vendor-submission-documents
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionDocuments'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/digital-submissions/{vendorDigitalSubmissionId}/documents/{vendorDigitalSubmissionDocumentId}:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionId'
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionDocumentId'
    delete:
      summary: delete a vendor digital submission document
      operationId: deleteVendorDigitalSubmissionDocument
      description: |
        Delete the uploaded vendor digital submission document.
      tags:
        - vendor-submission-documents
      x-roles:
        - vendor_user
        - vendor_admin
      responses:
        '204':
          description: No Content - Deleted
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/digital-submissions/{vendorDigitalSubmissionId}/documents/{vendorDigitalSubmissionDocumentId}/upload:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionId'
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionDocumentId'
    post:
      summary: Upload a vendor submission document
      operationId: uploadVendorDigitalSubmissionDocument
      tags:
        - vendor-submission-documents
      x-roles:
        - vendor_user
        - vendor_admin
      x-spring-plain-multipart-request: true
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VendorDigitalSubmissionDocumentUploadMultipart'
      responses:
        '201':
          description: The created vendor submission document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionDocument'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          description: The user doesn't have permissions to upload a vendor submission document
        '413':
          description: The total file size exceeds the allowed size of 2GB
        '415':
          description: Unsupported Filetype
        default:
          $ref: '#/components/responses/ServerError'
  /vendors/v1/my/digital-submissions/{vendorDigitalSubmissionId}/documents/{vendorDigitalSubmissionDocumentId}/add-vendor-document:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionId'
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionDocumentId'
    put:
      summary: Add an existing vendor document to the current submission
      operationId: addVendorDigitalSubmissionDocumentFromVendorDocument
      tags:
        - vendor-submission-documents
      x-roles:
        - vendor_user
        - vendor_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorDigitalSubmissionDocumentAddVendorDocument'
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorDigitalSubmissionDocument'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          description: The user doesn't have permissions to add a vendor submission document
        default:
          $ref: '#/components/responses/ServerError'
  /vendor-digital-submission-documents/v1/docs/{vendorDigitalSubmissionDocumentId}:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionDocumentId'
    get:
      parameters:
        - $ref: '#/components/parameters/QueryParamToken'
      summary: |
        Download a vendor digital submission document by id, authenticate via token in query parameter -- token can be obtained by:
        '/vendor-digital-submission-documents/v1/docs/{vendorDigitalSubmissionDocumentId}/token'
      operationId: downloadVendorDigitalSubmissionDocument
      tags:
        - vendor-submission-documents
      x-service-returns-response: true
      responses:
        '200':
          description: Vendor digital submission document as download
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /vendor-digital-submission-documents/v1/docs/{vendorDigitalSubmissionDocumentId}/token:
    parameters:
      - $ref: '#/components/parameters/ParamVendorDigitalSubmissionDocumentId'
    get:
      summary: Get a Download Token to fetch vendor digital submission document files
      operationId: getVendorDigitalSubmissionDocumentDownloadToken
      tags:
        - vendor-submission-documents
      x-roles:
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadToken'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /sustainability/v1/triggers:
    get:
      summary: get list of current sustainability triggers
      operationId: getSustainabilityTriggers
      tags:
        - sustainability-triggers
      x-roles:
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SustainabilityTriggers'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /sustainability/v1/triggers/{sustainabilityTriggerId}:
    parameters:
      - name: sustainabilityTriggerId
        schema:
          type: string
          format: uuid
        in: path
        required: true
        description: Id of the sustainability trigger
    put:
      summary: Create a new sustainability trigger
      operationId: createSustainabilityTrigger
      tags:
        - sustainability-triggers
      x-roles:
        - competence_centre_admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SustainabilityTrigger'
      responses:
        '201':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SustainabilityTrigger'
        '400':
          $ref: '#/components/responses/ServerError'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
    delete:
      summary: Delete a sustainability trigger
      operationId: deleteSustainabilityTrigger
      tags:
        - sustainability-triggers
      x-roles:
        - competence_centre_admin
      responses:
        '204':
          description: No Content - Deleted
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
  /sustainability/v1/product-categories:
    get:
      summary: get list of available product categories
      operationId: getProductCategories
      tags:
        - sustainability-triggers
      x-roles:
        - competence_centre_admin
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductCategories'
        '401':
          $ref: '#/components/responses/ServerError'
        '403':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ErrorCode:
      type: string
      description: |
        All possible error codes returned by an expected backend error. The number of codes is subject to change therefore consumers must implement the error code handling forward compatible (i.e. handle the else case accordingly)

        - E0000 = Unknown error!
        - E0001 = Not implemented!
        - E0002 = No data or no such element!
        - E0003 = Bad request!
        - E0004 = The provided DUNS number has an invalid format!
        - E0005 = Not authorized!
        - E0006 = Error with UID!
        - E0007 = Error with role change!
        - E0008 = The given user is not part of the given organization!
        - E0009 = The user is not an admin of the organization!
        - E0010 = Last admin can not leave organization/system!
        - E0011 = Error while getting document
        - E0012 = The search query is to short
        - E0013 = Invalid input-format, must be an UUID
        - E0014 = The user can not be impersonated!
        - E0015 = Internal Server Error
        - E0016 = Pub draft doesn't have lots
        - E0017 = Lot limit for pub draft reached

        - E0020 = Invalid publication date or past editorial deadline
        - E0021 = Invalid pub draft
        - E0022 = Pub draft has passed the editorial deadline or is published

        - E0024 = Invalid payload
        - E0025 = Invalid parameter

        - E0027 = Remedies notice already exist for publication_type and state_contract_area
        - E0028 = Awarded vendor has no submission
        - E0029 = Cannot update non-awarded vendor
        - E0030 = Unsupported content-type
        - E0031 = Trying to update an entity with a lotId not part of the same project
        - E0032 = Document locked, cannot be updated anymore - DEPRECATED, no longer in use
        - E0034 = Cannot define a translation language which corresponds to the creation language
        - E0035 = Cannot show interest as deadline exceeded
        - E0036 = Cannot perform requested operation as vendor is not active anymore
        - E0037 = Cannot update value of a read-only column
        - E0038 = Cannot update the given pub-draft is not the top-pub-draft for this project_lot
        - E0039 = Pub draft is locked, can't be edited anymore
        - E0040 = User is already member of compCentre
        - E0041 = Pub draft is locked, can't be deleted anymore
        - E0042 = Requests against the eNotice2/TED api failed due to the service not being available.
        - E0043 = User has reached max. number of subscriptions
        - E0044 = cannot create/delete the publication date exception, date is today or in the past
        - E0045 = cannot create the publication date exception, publisher doesn't publish to an official journal
        - E0046 = cannot create the publication date exception, because another exception already exists for that date
        - E0047 = cannot create the publication date exception at the specified date, no publication date rule matches that date
        - E0048 = cannot create the publication date exception at the specified date, a publication date rule matches that date
        - E0049 = cannot create the publication date exception, editorial deadline was wrong (missing or should not have been provided)
        - E0050 = cannot create the publication date exception, editorial deadline was wrong (already passed)
        - E0051 = cannot create the publication date exception, because there are already exists pub-drafts set for publication on that date
        - E0052 = Cannot upload a document for the given publication, upload is not allowed
        - E0053 = cannot create email, invalid html given
        - E0054 = cannot create email, missing tag/attributes detected
        - E0055 = cannot create email, disallowed html tag/attributes detected
        - E0056 = cannot create email, no recipient specified
        - E0057 = Your organization has been deleted
        - E0059 = invalid html given
        - E0060 = disallowed html tag/attributes detected
        - E0061 = Vendor can not be deleted, is involved in projects
        - E0062 = DUNS conversion error
        - E0063 = Lot id does not correspond to referencingLot of pub-draft
        - E0064 = Uploading failed, virus detected
        - E0065 = Cannot delete offerType through correction
        - E0066 = Missing request query parameter
        - E0067 = Action is not allowed when impersonating
        - E0068 = Document not found in object storage
        - E0069 = Cannot change publication date rules
        - E0070 = Cannot copy pub-draft
        - E0071 = The search query contains at least one syntax error
        - E0072 = cannot delete the publication date exception, because there are already exists pub-drafts set for publication on that date
        - E0073 = Page with tab does not exist
        - E0074 = Content component position duplicate
        - E0075 = Submitting digital submission without documents
        - E0076 = URL-field in the request body either contains invalid characters, is incorrectly escaped, contains no or an unknown protocol
        - E0077 = Can not directly change type of content component
        - E0078 = Can not patch items of content-component-articles, must be empty
        - E0079 = An existing sustainability trigger clashes with the new trigger
        - E0080 = Cannot change the projectSubType of the given lot.
      enum:
        - E0000
        - E0001
        - E0002
        - E0003
        - E0004
        - E0005
        - E0006
        - E0007
        - E0008
        - E0009
        - E0010
        - E0011
        - E0012
        - E0013
        - E0014
        - E0015
        - E0016
        - E0017
        - E0020
        - E0021
        - E0022
        - E0024
        - E0025
        - E0027
        - E0028
        - E0029
        - E0030
        - E0031
        - E0032
        - E0034
        - E0035
        - E0036
        - E0037
        - E0038
        - E0039
        - E0040
        - E0041
        - E0042
        - E0043
        - E0044
        - E0045
        - E0046
        - E0047
        - E0048
        - E0049
        - E0050
        - E0051
        - E0052
        - E0053
        - E0054
        - E0055
        - E0056
        - E0057
        - E0059
        - E0060
        - E0061
        - E0062
        - E0063
        - E0064
        - E0065
        - E0066
        - E0067
        - E0068
        - E0069
        - E0070
        - E0071
        - E0072
        - E0073
        - E0074
        - E0075
        - E0076
        - E0077
        - E0078
        - E0079
        - E0080
    ServerErrorAttributes:
      type: object
      properties:
        message:
          type: string
          description: Details about the error. Usually this will be very short or empty to not disclose any technical details to attackers.
        path:
          type: string
        status:
          type: integer
        timestamp:
          type: string
          format: date-time
        errorCode:
          $ref: '#/components/schemas/ErrorCode'
        missingFields:
          type: array
          items:
            type: string
      required:
        - path
        - status
        - timestamp
        - errorCode
    Canton:
      type: object
      properties:
        id:
          type: string
        nuts3:
          type: string
          description: |
            NUTS3 is an european regional code to classify regions for statistics and other comparisons.

            This field describes the nuts3 code for the canton.

            [Also see: eurostat - NUTS](https://ec.europa.eu/eurostat/web/nuts/background)
      required:
        - id
        - nuts3
    Cantons:
      type: object
      properties:
        cantons:
          type: array
          items:
            $ref: '#/components/schemas/Canton'
      required:
        - cantons
    Translation:
      type: object
      properties:
        de:
          type: string
          example: Deutsch
        en:
          type: string
          example: English
        fr:
          type: string
          example: Français
        it:
          type: string
          example: Italiano
    Country:
      type: object
      properties:
        id:
          type: string
          description: |
            The `id` is the iso alpha 2 code of the country i.e. the two character country code. 
            e.g. `CH` for Switzerland.
        isoAlpha3:
          type: string
          description: |
            The iso alpha 3 code i.e. the three character country code. 
            e.g. `CHE` for Switzerland.
        euMember:
          type: boolean
          description: |
            Is true when this country is a EU member state.
        hasNutsCodes:
          type: boolean
          description: |
            Is true when this country has NUTS (Nomenclature of territorial units for statistics) codes.
            Those are EU, EFTA (European Free Trade Association) members and candidate countries for EU membership.

            [Also see: eurostat - NUTS](https://ec.europa.eu/eurostat/web/nuts/non-eu-regions) for an overview and more information.
        label:
          $ref: '#/components/schemas/Translation'
          description: |
            Name of the country.
      required:
        - id
        - isoAlpha3
        - euMember
        - hasNutsCodes
        - label
    Countries:
      type: object
      properties:
        countries:
          type: array
          items:
            $ref: '#/components/schemas/Country'
      required:
        - countries
    Language:
      type: object
      properties:
        id:
          type: string
      required:
        - id
    Languages:
      type: object
      properties:
        languages:
          type: array
          items:
            $ref: '#/components/schemas/Language'
      required:
        - languages
    MainActivity:
      type: object
      properties:
        id:
          type: string
          format: uuid
        label:
          allOf:
            - $ref: '#/components/schemas/Translation'
          readOnly: true
        isSectorActivity:
          type: boolean
          readOnly: true
        tedCode:
          type: string
          readOnly: true
      required:
        - id
        - label
        - isSectorActivity
        - tedCode
    MainActivities:
      type: object
      properties:
        mainActivities:
          type: array
          items:
            $ref: '#/components/schemas/MainActivity'
      required:
        - mainActivities
    TranslationSanitizedHtml:
      type: object
      properties:
        de:
          type: string
          format: html
        en:
          type: string
          format: html
        fr:
          type: string
          format: html
        it:
          type: string
          format: html
    Criterion:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: |
            For a new criterion supply a uuid, to update an existing criterion use the provided uuid.
        description:
          $ref: '#/components/schemas/TranslationSanitizedHtml'
        verification:
          $ref: '#/components/schemas/TranslationSanitizedHtml'
      required:
        - id
        - description
    Criteria:
      type: object
      properties:
        criteria:
          type: array
          items:
            $ref: '#/components/schemas/Criterion'
      required:
        - criteria
    SustainabilityFormType:
      description: |
        For sustainable procurements, forms have been defined which the procurement office must fill out in the
        event of an award and in case a trigger for the chosen cpv-code exists. There are currently 5 forms:
        - nh01 for goods and services
        - nh02 for building construction: planning services and competitions
        - nh03 for building construction: construction services
        - nh04 for civil engineering: planning services and competitions
        - nh05 for civil engineering: construction services
      type: string
      enum:
        - nh01
        - nh02
        - nh03
        - nh04
        - nh05
    SustainabilityFormMappings:
      type: object
      description: |
        Defines mapping of sustainability form question to form types as a dictionary
      additionalProperties:
        type: array
        items:
          $ref: '#/components/schemas/SustainabilityFormType'
    CPVCode:
      type: object
      properties:
        code:
          type: string
          format: cpvCode
          example: '30192000'
        label:
          $ref: '#/components/schemas/Translation'
      required:
        - code
    CPVCodeNode:
      type: object
      allOf:
        - $ref: '#/components/schemas/CPVCode'
        - type: object
          properties:
            hasChildren:
              type: boolean
          required:
            - hasChildren
      required:
        - label
    CPVCodes:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/CPVCodeNode'
      required:
        - codes
    SystemLanguage:
      description: The core languages used by the system
      type: string
      enum:
        - de
        - en
        - fr
        - it
    CPVCodesSearchResult:
      type: object
      properties:
        code:
          type: string
          example: '30192000'
        label:
          $ref: '#/components/schemas/Translation'
        codes:
          type: array
          items:
            $ref: '#/components/schemas/CPVCodesSearchResult'
      required:
        - code
        - label
        - codes
    CPVCodesSearchResults:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/CPVCodesSearchResult'
      required:
        - codes
    CPCCode:
      type: object
      properties:
        code:
          type: string
          format: uuid
        label:
          $ref: '#/components/schemas/Translation'
      required:
        - code
    CPCCodeNode:
      type: object
      allOf:
        - $ref: '#/components/schemas/CPCCode'
      required:
        - label
    CPCCodes:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/CPCCodeNode'
      required:
        - codes
    BKPCode:
      type: object
      properties:
        code:
          type: string
          format: bkpCode
          example: '512.5'
        label:
          $ref: '#/components/schemas/Translation'
      required:
        - code
    BKPCodeNode:
      type: object
      allOf:
        - $ref: '#/components/schemas/BKPCode'
        - type: object
          properties:
            hasChildren:
              type: boolean
          required:
            - hasChildren
      required:
        - label
    BKPCodes:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/BKPCodeNode'
      required:
        - codes
    BKPCodesSearchResult:
      type: object
      properties:
        code:
          type: string
          example: '003.4'
        label:
          $ref: '#/components/schemas/Translation'
        codes:
          type: array
          items:
            $ref: '#/components/schemas/BKPCodesSearchResult'
      required:
        - code
        - label
        - codes
    BKPCodesSearchResults:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/BKPCodesSearchResult'
      required:
        - codes
    NPKCode:
      type: object
      properties:
        code:
          type: string
          format: npkCode
          example: '100'
        label:
          $ref: '#/components/schemas/Translation'
      required:
        - code
    NPKCodeNode:
      type: object
      allOf:
        - $ref: '#/components/schemas/NPKCode'
        - type: object
          properties:
            hasChildren:
              type: boolean
          required:
            - hasChildren
      required:
        - label
    NPKCodes:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/NPKCodeNode'
      required:
        - codes
    NPKCodesSearchResult:
      type: object
      properties:
        code:
          type: string
          example: '782'
        label:
          $ref: '#/components/schemas/Translation'
        codes:
          type: array
          items:
            $ref: '#/components/schemas/NPKCodesSearchResult'
      required:
        - code
        - label
        - codes
    NPKCodesSearchResults:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/NPKCodesSearchResult'
      required:
        - codes
    EBKPTCode:
      type: object
      properties:
        code:
          type: string
          format: ebkptCode
          example: N 1.4
        label:
          $ref: '#/components/schemas/Translation'
      required:
        - code
    EBKPTCodeNode:
      type: object
      allOf:
        - $ref: '#/components/schemas/EBKPTCode'
        - type: object
          properties:
            hasChildren:
              type: boolean
          required:
            - hasChildren
      required:
        - label
    EBKPTCodes:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/EBKPTCodeNode'
      required:
        - codes
    EBKPTCodesSearchResult:
      type: object
      properties:
        code:
          type: string
          example: 'N'
        label:
          $ref: '#/components/schemas/Translation'
        codes:
          type: array
          items:
            $ref: '#/components/schemas/EBKPTCodesSearchResult'
      required:
        - code
        - label
        - codes
    EBKPTCodesSearchResults:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/EBKPTCodesSearchResult'
      required:
        - codes
    EBKPHCode:
      type: object
      properties:
        code:
          type: string
          format: ebkphCode
          example: A02.06
        label:
          $ref: '#/components/schemas/Translation'
      required:
        - code
    EBKPHCodeNode:
      type: object
      allOf:
        - $ref: '#/components/schemas/EBKPHCode'
        - type: object
          properties:
            hasChildren:
              type: boolean
          required:
            - hasChildren
      required:
        - label
    EBKPHCodes:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/EBKPHCodeNode'
      required:
        - codes
    EBKPHCodesSearchResult:
      type: object
      properties:
        code:
          type: string
          example: A
        label:
          $ref: '#/components/schemas/Translation'
        codes:
          type: array
          items:
            $ref: '#/components/schemas/EBKPHCodesSearchResult'
      required:
        - code
        - label
        - codes
    EBKPHCodesSearchResults:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/EBKPHCodesSearchResult'
      required:
        - codes
    OAGCode:
      type: object
      properties:
        code:
          type: string
          format: oagCode
          example: N 1.4
        label:
          $ref: '#/components/schemas/Translation'
      required:
        - code
    OAGCodeNode:
      type: object
      allOf:
        - $ref: '#/components/schemas/OAGCode'
        - type: object
          properties:
            hasChildren:
              type: boolean
          required:
            - hasChildren
      required:
        - label
    OAGCodes:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/OAGCodeNode'
      required:
        - codes
    OAGCodesSearchResult:
      type: object
      properties:
        code:
          type: string
          example: 'N'
        label:
          $ref: '#/components/schemas/Translation'
        codes:
          type: array
          items:
            $ref: '#/components/schemas/OAGCodesSearchResult'
      required:
        - code
        - label
        - codes
    OAGCodesSearchResults:
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/OAGCodesSearchResult'
      required:
        - codes
    ProcOfficeType:
      type: string
      enum:
        - central_federation
        - decentral_federation
        - other_federation
        - foreign
        - cantonal
        - other_cantonal
        - communal
        - other_communal
    InstitutionMinimal:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          $ref: '#/components/schemas/Translation'
        handlesProcOfficesTypes:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeType'
          description: The types of procurement offices that this institution supervises.
        userCanCreateProcOffice:
          type: boolean
          description: If true users can create new procurement offices under this institution.
      required:
        - id
        - name
    Institution:
      type: object
      allOf:
        - $ref: '#/components/schemas/InstitutionMinimal'
        - type: object
          properties:
            compCentreId:
              type: string
              format: uuid
              nullable: true
              description: The responsible competence centre, if not set see the parent institution.
            parentInstitutionId:
              type: string
              format: uuid
              description: The id of the parent institution in the hierarchy tree if the institution has a parent.
            path:
              type: string
              description: |
                The path in the institution hierarchy to this node, including the current node.
                The path consists of the UUIDs of the nodes separated by a dot `.`
              example: d33e7dbe-a1dc-4376-8019-602997a560f3.9ddd55c3-0db8-4d87-bb87-2609c71f8dc4.5d2f29a9-4e56-4dbc-936d-e493f42f4228
      required:
        - id
        - name
        - handlesProcOfficesTypes
        - userCanCreateProcOffice
        - path
    Institutions:
      type: object
      properties:
        institutions:
          type: array
          items:
            $ref: '#/components/schemas/Institution'
      required:
        - institutions
    UserLoginStatus:
      type: string
      enum:
        - no_login
        - active
        - temporarily_locked
        - locked
      description: |
        A users login status which can differ from the account status  

        - `no_login` - used for invited or deleted user accounts. The user has no login or has not finished setting it up. 
        - `active` - the user has an active login.
        - `temporarily_locked` - the user's login is temporarily locked (brute force detection)
        - `locked` - the user's login is permanently locked (brute force detection)
    User:
      type: object
      properties:
        id:
          type: string
          format: uuid
        email:
          type: string
          format: email
        phoneNumber:
          type: string
          description: The phoneNumber is in the international format (E.164)
        firstName:
          type: string
        lastName:
          type: string
        language:
          $ref: '#/components/schemas/SystemLanguage'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        active:
          type: boolean
        passwordLastChanged:
          type: string
          format: date
        loginStatus:
          $ref: '#/components/schemas/UserLoginStatus'
    RollingPagination:
      type: object
      properties:
        lastItem:
          type: string
        itemsPerPage:
          type: integer
      required:
        - lastItem
        - itemsPerPage
    UsersSearchResult:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - users
        - pagination
    MembershipType:
      type: string
      enum:
        - procurement_office
        - vendor
        - competence_centre
    OrganizationBase:
      type: object
      properties:
        membershipType:
          $ref: '#/components/schemas/MembershipType'
        orgId:
          type: string
          format: uuid
        organization:
          $ref: '#/components/schemas/Translation'
      required:
        - membershipType
        - orgId
        - organization
    UserDeletionResult:
      type: object
      properties:
        lastOrganizationsAdmin:
          description: |
            List with organizations the user is the last admin and can therefore not be deleted
          items:
            $ref: '#/components/schemas/OrganizationBase'
    UserDeletionResultResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserDeletionResult'
        - $ref: '#/components/schemas/ServerErrorAttributes'
    UserEditable:
      type: object
      properties:
        firstName:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.NullableButNotBlankOrEmpty'
          type: string
          pattern: ^[^<>&\"\v$%!#?§;*~/\\|^=\[\]{}()\p{Cntrl}]+$
        lastName:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.NullableButNotBlankOrEmpty'
          type: string
          pattern: ^[^<>&\"\v$%!#?§;*~/\\|^=\[\]{}()\p{Cntrl}]+$
        phoneNumber:
          type: string
          maxLength: 16
          pattern: ^(\+[0-9]{7,15})?$
          description: The phoneNumber in the international format (E.164) or an empty string in case you want to delete the phone number
        language:
          $ref: '#/components/schemas/SystemLanguage'
    ImpersonateTokens:
      type: object
      properties:
        access_token:
          type: string
        refresh_token:
          type: string
        id_token:
          type: string
        user_id:
          type: string
          format: uuid
    AuditOperation:
      type: string
      enum:
        - created
        - updated
        - deleted
    BaseHistory:
      type: object
      properties:
        hid:
          type: string
          format: uuid
        changedAt:
          type: string
          format: date-time
        changedBy:
          type: string
          format: email
        changedById:
          type: string
          format: uuid
        impersonatedBy:
          type: string
          format: email
        auditOperation:
          $ref: '#/components/schemas/AuditOperation'
      required:
        - hid
        - changedAt
        - changedBy
        - changedById
        - auditOperation
    UserHistoryMutation:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/User'
        - type: object
          properties:
            isOtpRequired:
              type: boolean
              description: is true, when One-Time Password should be enabled for this user.
            isOtpActive:
              type: boolean
              description: is true, when One-Time Password is enabled for this user.
    UserHistoryMutations:
      type: object
      properties:
        userHistoryMutations:
          type: array
          items:
            $ref: '#/components/schemas/UserHistoryMutation'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - userHistoryMutations
        - pagination
    AssignableRole:
      type: string
      description: list of all assignable roles, listed in expected sort ordering
      enum:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
    MembershipStatus:
      type: string
      enum:
        - requested
        - accepted
        - rejected
        - disabled
    OrganizationMembership:
      type: object
      allOf:
        - $ref: '#/components/schemas/OrganizationBase'
        - type: object
          properties:
            role:
              $ref: '#/components/schemas/AssignableRole'
            membershipStatus:
              $ref: '#/components/schemas/MembershipStatus'
      required:
        - membershipStatus
        - membershipType
        - role
    UserHistoryOrganizationMembership:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/OrganizationMembership'
    UserHistoryOrganizationMemberships:
      type: object
      properties:
        userHistoryOrganizationMemberships:
          type: array
          items:
            $ref: '#/components/schemas/UserHistoryOrganizationMembership'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - userHistoryOrganizationMemberships
        - pagination
    UserMinimal:
      type: object
      properties:
        id:
          type: string
          format: uuid
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
          format: email
    UserWithOrgAndRole:
      type: object
      description: User with organization and role
      allOf:
        - $ref: '#/components/schemas/UserMinimal'
        - type: object
          properties:
            organization:
              type: string
            role:
              $ref: '#/components/schemas/AssignableRole'
            active:
              type: boolean
              description: |
                - If an organization is defined: active displays if the user is an accepted member in that organization.
                - Otherwise: if the user is active
          required:
            - role
            - active
      required:
        - id
        - email
    UsersWithOrgAndRoleSearchResult:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/UserWithOrgAndRole'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - users
        - pagination
    OrganizationMemberships:
      type: object
      properties:
        memberships:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMembership'
      required:
        - memberships
    CompCentreType:
      type: string
      enum:
        - federation
        - canton
        - city
    CompCentre:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          $ref: '#/components/schemas/Translation'
        centreType:
          $ref: '#/components/schemas/CompCentreType'
      required:
        - id
        - name
        - centreType
    CompCentres:
      type: object
      properties:
        compCentres:
          type: array
          items:
            $ref: '#/components/schemas/CompCentre'
      required:
        - compCentres
    ProcOfficeStatus:
      type: string
      enum:
        - requested
        - confirmed
        - rejected
    ProcOfficeListEntry:
      type: object
      description: Procurement office with minimal information for the list view / selection.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        type:
          $ref: '#/components/schemas/ProcOfficeType'
        institutionNameHierarchy:
          type: array
          items:
            $ref: '#/components/schemas/Translation'
          description: |
            Each procurement office is assigned to an institution. 

            This list represents the institution hierarchy for this procurement office, 
            where the first entry is the top level institution and the last entry the institution that is assigned to the procurement office.
        createdBy:
          $ref: '#/components/schemas/UserMinimal'
        organizationInContract:
          type: boolean
        status:
          $ref: '#/components/schemas/ProcOfficeStatus'
      required:
        - id
        - name
        - type
        - institutionNameHierarchy
        - createdBy
        - organizationInContract
        - status
    ProcOfficeSearchResult:
      type: object
      properties:
        procOffices:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeListEntry'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOffices
        - pagination
    BaseAddress:
      type: object
      description: |
        The char limits follow the TED limits for that field as in some cases the address is part of the data sent to TED.
      properties:
        postalCode:
          type: string
          maxLength: 400
          description: |
            In general we only require swiss addresses to have a postal code as 
            we allow foreign addresses from places that do not use postal codes.

            In certain cases, e.g. for a procurement office, we require the postal code for an address in a country that has NUTS codes.
        countryId:
          type: string
          description: |
            The ISO 3166 two letter country code. The list with the ids / codes can be get from `GET /api/countries/v1`
        cantonId:
          type: string
          maxLength: 2
          description: |
            The two letter abbreviation of a swiss canton e.g `BE`.

            Not in every instance is this value required, and if it's a required value then only when the address is from switzerland.
    Address:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseAddress'
        - type: object
          properties:
            street:
              type: string
              maxLength: 400
            city:
              type: string
              maxLength: 400
          required:
            - street
            - city
      required:
        - countryId
    CompCentreContact:
      type: object
      description: |
        Note:

        The `cantonId` field is included due to the usage of the common address, 
        it's currently not actively required and enforced for the competence centre contact, can be used if desired.
      allOf:
        - $ref: '#/components/schemas/Address'
        - $ref: '#/components/schemas/UserMinimal'
        - type: object
          properties:
            compCentreId:
              type: string
              format: uuid
              description: |
                The competence centre id in which the contact is created.
                Only the competence centre id of the logged in competence centre admin is allowed.
            phone:
              type: string
            websiteUrl:
              x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
              type: string
              format: url
              maxLength: 400
            usedForSupport:
              type: boolean
              default: false
            usedForLegalInformation:
              type: boolean
              default: false
            description:
              $ref: '#/components/schemas/Translation'
            additionalInformation:
              $ref: '#/components/schemas/Translation'
      required:
        - id
        - firstName
        - lastName
        - street
        - postalCode
        - city
        - description
        - countryId
        - compCentreId
    TranslationURL:
      type: object
      properties:
        de:
          x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
          type: string
          format: url
          maxLength: 400
        en:
          x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
          type: string
          format: url
          maxLength: 400
        fr:
          x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
          type: string
          format: url
          maxLength: 400
        it:
          x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
          type: string
          format: url
          maxLength: 400
    CompCentreUrl:
      type: object
      properties:
        id:
          type: string
          format: uuid
        title:
          $ref: '#/components/schemas/Translation'
        url:
          $ref: '#/components/schemas/TranslationURL'
        description:
          $ref: '#/components/schemas/Translation'
        compCentreId:
          type: string
          format: uuid
      required:
        - id
        - title
        - url
        - compCentreId
    Weekdays:
      type: string
      enum:
        - sunday
        - monday
        - tuesday
        - wednesday
        - thursday
        - friday
        - saturday
    PublicationDateRule:
      type: object
      properties:
        id:
          type: string
          format: uuid
        weekday:
          $ref: '#/components/schemas/Weekdays'
        editorialDeadlineDaysBefore:
          type: integer
          minimum: 1
          maximum: 7
        editorialDeadlineAtTime:
          type: string
          format: time
          description: |
            Precision is hh:mm, meaning it is truncated to minutes. For instance, 12:05:01.001 will be treated as 12:05.
            The given time is always in timezone Europe/Zurich at the corresponding date.
      required:
        - id
        - weekday
        - editorialDeadlineDaysBefore
        - editorialDeadlineAtTime
    PublicationDateExceptionType:
      type: string
      enum:
        - cancellation
        - addition
    PublicationDateException:
      type: object
      properties:
        id:
          type: string
          format: uuid
        exceptionType:
          $ref: '#/components/schemas/PublicationDateExceptionType'
        exceptionDate:
          type: string
          format: date
          description: |
            Depending on the exceptionType, either the cancellation date (in case of cancellation) 
            or the additional publication date (in case of addition).
        note:
          type: string
          maxLength: 100
        editorialDeadlineDaysBefore:
          type: integer
          minimum: 1
          maximum: 7
          description: |
            Required if exceptionType is `addition`, otherwise it must be null.
        editorialDeadlineAtTime:
          type: string
          format: time
          description: |
            Required if exceptionType is `addition`, otherwise it must be null.
            Precision is hh:mm, meaning it is truncated to minutes. For instance, 12:05:01.001 will be treated as 12:05.
            The given time is always in timezone Europe/Zurich at the corresponding date. 
      required:
        - id
        - exceptionType
        - exceptionDate
        - note
    Publisher:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        publishesToOfficialJournal:
          type: boolean
          description: |
            Indicates whether this publisher publishes the official journal (Amtsblatt) or not
        publicationDateRules:
          type: array
          items:
            $ref: '#/components/schemas/PublicationDateRule'
        publicationDateExceptionsOfTodayOrFuture:
          type: array
          items:
            $ref: '#/components/schemas/PublicationDateException'
          description: A publisher can define exceptions to the above rules. On one hand a publisher can cancel a publication date and on the other additional publication dates can be defined (e.g. as replacement of a cancelled date). This list contains only exceptions for today or the future.
      required:
        - id
        - name
        - publishesToOfficialJournal
        - publicationDateRules
        - publicationDateExceptionsOfTodayOrFuture
    CompCentreDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/CompCentre'
        - type: object
          properties:
            contacts:
              type: array
              items:
                $ref: '#/components/schemas/CompCentreContact'
            urls:
              type: array
              items:
                $ref: '#/components/schemas/CompCentreUrl'
            publisher:
              $ref: '#/components/schemas/Publisher'
          required:
            - contacts
            - urls
            - publisher
    CompCentreRole:
      type: string
      enum:
        - competence_centre_admin
        - competence_centre_print_user
    CompCentreJoin:
      type: object
      description: |
        Either identify the user via userId (in case of an existing user) or via email but not both.
        The email is simply ignored if you provide an userId
      properties:
        userId:
          type: string
          format: uuid
        email:
          type: string
          format: email
        role:
          $ref: '#/components/schemas/CompCentreRole'
      required:
        - role
    CompCentreMembership:
      type: string
      enum:
        - accepted
    CompCentreMember:
      type: object
      allOf:
        - $ref: '#/components/schemas/User'
        - type: object
          properties:
            membership:
              $ref: '#/components/schemas/CompCentreMembership'
            role:
              $ref: '#/components/schemas/CompCentreRole'
    CompCentreMembers:
      type: object
      properties:
        compCentreMembers:
          type: array
          items:
            $ref: '#/components/schemas/CompCentreMember'
      required:
        - compCentreMembers
    AttachedUser:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserMinimal'
        - type: object
          properties:
            active:
              type: boolean
            organizationName:
              $ref: '#/components/schemas/Translation'
              description: The name of the procurement office or competence centre
            role:
              $ref: '#/components/schemas/AssignableRole'
      required:
        - organizationName
        - id
        - email
        - active
        - role
    AttachedUserSearchResult:
      type: object
      properties:
        attachedUsers:
          type: array
          items:
            $ref: '#/components/schemas/AttachedUser'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - attachedUsers
        - pagination
    RemediesNoticeType:
      type: string
      enum:
        - tender
        - competition
        - study_contract
        - tender_award
        - competition_award
        - study_contract_award
        - direct_award
        - abandonment
        - revocation
        - participant_selection
    RemediesNoticeTemplateRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
        compCentreId:
          type: string
          format: uuid
          description: The responsible competence centre
        name:
          type: string
          maxLength: 250
        remediesNoticeType:
          $ref: '#/components/schemas/RemediesNoticeType'
        notice:
          $ref: '#/components/schemas/Translation'
        stateContractArea:
          type: boolean
          default: true
      required:
        - id
        - compCentreId
        - name
        - remediesNoticeType
        - notice
    RemediesNoticeTemplate:
      type: object
      allOf:
        - $ref: '#/components/schemas/RemediesNoticeTemplateRequest'
        - type: object
          properties:
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
      required:
        - createdAt
        - updatedAt
    RemediesNoticeTemplatesSearchResult:
      type: object
      properties:
        remediesNoticeTemplates:
          type: array
          items:
            $ref: '#/components/schemas/RemediesNoticeTemplate'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - remediesNoticeTemplates
        - pagination
    PubDraftTemplatePubTypeFilter:
      type: string
      description: |
        This is a specific enumeration of publication types used in the extended filter parameters of the pub-draft templates project search and is a 
        sub-set of `ProjectSearchPubTypeFilter.yaml`, including only initial publications
        Values will technically be mapped to corresponding pubType, projectType and/or processType

        Note that:
        - award_tender only includes direct_award for an external publication if the project_type is tender as well
        - award_study_contract only includes direct_award for an external publication if the project_type is study_contract as well
        - award_competition only includes direct_award for an external publication if the project_type is competition as well
        - direct_award only includes direct_award publications created on the new simap.ch (i.e. not for an external publication).
      enum:
        - advance_notice
        - request_for_information
        - tender
        - competition
        - study_contract
        - award_tender
        - award_study_contract
        - award_competition
        - direct_award
    PubProjectType:
      type: string
      enum:
        - tender
        - competition
        - study_contract
        - request_for_information
    PubProcessType:
      type: string
      description: |
        - direct = currently only entails publications with type direct_award for direct award procedure (Freihändige Vergabe)
        - no_process = This process type is used to describe projects that are not a part of an official procurement process. Currently only entails publications/projects of type `request_for_information`
      enum:
        - open
        - selective
        - invitation
        - direct
        - no_process
    PubType:
      type: string
      description: |
        This type is a mix of types. Respective types can be found in PubType and ProjectType. 
        Following types also exist in PubType: request_for_information, advance_notice, abandonment, direct_award, award, 
        revocation, participant_selection and selective_offering_phase.
        Following types also exist in ProjectType: tender, competition and study_contract.
      enum:
        - request_for_information
        - advance_notice
        - abandonment
        - direct_award
        - award
        - revocation
        - participant_selection
        - selective_offering_phase
        - tender
        - competition
        - study_contract
    PubDraftTemplateSearchResultEntry:
      type: object
      description: Information used for a pub-draft template search/overview entry
      properties:
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        processType:
          $ref: '#/components/schemas/PubProcessType'
        pubType:
          $ref: '#/components/schemas/PubType'
        projectId:
          type: string
          format: uuid
        pubId:
          type: string
          format: uuid
        title:
          $ref: '#/components/schemas/Translation'
      required:
        - projectType
        - processType
        - pubType
        - projectId
        - pubId
        - title
    PubDraftTemplateSearchResult:
      type: object
      description: Result of pub-draft template search
      properties:
        templates:
          type: array
          items:
            $ref: '#/components/schemas/PubDraftTemplateSearchResultEntry'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - templates
        - pagination
    CompCentreUrls:
      type: object
      properties:
        urls:
          type: array
          items:
            $ref: '#/components/schemas/CompCentreUrl'
      required:
        - urls
    ProjectSubType:
      type: string
      enum:
        - construction
        - service
        - supply
        - project_competition
        - idea_competition
        - overall_performance_competition
        - project_study
        - idea_study
        - overall_performance_study
        - request_for_information
    PublicationNumber:
      type: string
      example: 123-01
      description: |
        Unique publication number aka "Meldungsnummer".
        Confluence: https://projects.unic.com/x/SAKMBg > Meldungsnummer
    BasePublicationData:
      type: object
      properties:
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        projectSubType:
          $ref: '#/components/schemas/ProjectSubType'
        processType:
          $ref: '#/components/schemas/PubProcessType'
        publicationNumber:
          $ref: '#/components/schemas/PublicationNumber'
        pubType:
          $ref: '#/components/schemas/PubType'
        corrected:
          type: boolean
          description: |
            True if this is pub draft is a correction
      required:
        - projectType
        - projectSubType
        - processType
        - publicationNumber
        - pubType
        - corrected
    PublicationToPublish:
      type: object
      allOf:
        - $ref: '#/components/schemas/BasePublicationData'
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: |
                id of the pub draft / publication
            projectId:
              type: string
              format: uuid
            projectTitle:
              $ref: '#/components/schemas/Translation'
            publicationDate:
              type: string
              format: date
            editorialDeadline:
              type: string
              format: date-time
              description: The editorial deadline for the selected publication date.
            procOfficeName:
              type: string
          required:
            - id
            - projectId
            - projectTitle
            - publicationDate
            - editorialDeadline
            - procOfficeName
    PublicationsToPublish:
      type: object
      properties:
        publicationsToPublish:
          type: array
          items:
            $ref: '#/components/schemas/PublicationToPublish'
    PubDraftPlannedForPublication:
      type: object
      properties:
        procOfficeName:
          type: string
        projectId:
          type: string
          format: uuid
        pubDraftId:
          type: string
          format: uuid
        publicationNumber:
          type: string
      required:
        - procOfficeName
        - projectId
        - pubDraftId
        - publicationNumber
    PubDraftsPlannedForPublication:
      type: object
      properties:
        pubDrafts:
          type: array
          items:
            $ref: '#/components/schemas/PubDraftPlannedForPublication'
      required:
        - pubDrafts
    ProcOfficePublicData:
      type: object
      description: Public available procurement office data.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 400
        type:
          $ref: '#/components/schemas/ProcOfficeType'
        institutionId:
          type: string
          format: uuid
        compCentreId:
          type: string
          format: uuid
      required:
        - id
        - name
        - type
        - institutionId
        - compCentreId
    ProcOfficesPublicData:
      type: object
      properties:
        procOffices:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficePublicData'
      required:
        - procOffices
    InternationalPhoneNumber:
      type: string
      maxLength: 16
      pattern: ^\+[0-9]{7,15}$
      description: Phone number in international format (E.164)
    BaseProcOffice:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProcOfficePublicData'
        - type: object
          properties:
            language:
              $ref: '#/components/schemas/SystemLanguage'
            mainActivity:
              $ref: '#/components/schemas/MainActivity'
            phone:
              $ref: '#/components/schemas/InternationalPhoneNumber'
            email:
              type: string
              format: email
              minLength: 1
              maxLength: 400
            url:
              x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
              type: string
              format: url
              maxLength: 400
            otherInfo:
              type: string
              maxLength: 255
            status:
              $ref: '#/components/schemas/ProcOfficeStatus'
            statusComment:
              type: string
      required:
        - id
    Contact:
      type: object
      properties:
        organization:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
          format: email
      required:
        - organization
        - firstName
        - lastName
    ProcOffice:
      type: object
      description: |
        If the procurement office is working as `organization in contract` then the `organizationInContractContact`
        is set and on a creation request should be filled out. This can not be changed at a later date

        The `organizationInContractContact` describes the contact of the organization that this office works for,
        contact to validate an organization in contract request.

        The char limits follow the TED limits for that field as for publications that are sent to TED require the name and 
        contact information of the office.
      allOf:
        - $ref: '#/components/schemas/BaseProcOffice'
        - type: object
          properties:
            organizationInContractContact:
              $ref: '#/components/schemas/Contact'
            address:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.TedSendableAddress'
              allOf:
                - $ref: '#/components/schemas/Address'
            institutionNameHierarchy:
              type: array
              items:
                $ref: '#/components/schemas/Translation'
              description: |
                Each procurement office is assigned to an institution. 

                This list represents the institution hierarchy for this procurement office,
                where the first entry is the top level institution and the last entry the institution that is assigned to the procurement office.
              readOnly: true
      required:
        - id
        - name
        - type
        - compCentreId
        - institutionId
        - language
        - mainActivity
        - address
        - phone
        - email
    ProcOfficeRejectMessage:
      type: object
      properties:
        comment:
          type: string
      required:
        - comment
    ProcOfficeJoinRequest:
      type: object
      properties:
        join:
          type: boolean
          description: true -> joinRequest, false -> revoke joinRequest / leave ProcOffice
      required:
        - join
    ProcOfficeMembership:
      type: string
      enum:
        - requested
        - accepted
        - rejected
    ProcOfficeRole:
      type: string
      description: |
        Roles a user can have in a procurement office.
        * procurement_admin - Administrator of the procurement office
        * procurement_user - User permissions to be able to work on all projects in the procurement office
        * procurement_project_contributor - User having only limited access to assigned projects in the procurement office
      enum:
        - procurement_admin
        - procurement_user
        - procurement_project_contributor
    MyProcOfficeMembership:
      allOf:
        - $ref: '#/components/schemas/ProcOfficePublicData'
        - type: object
          properties:
            membership:
              $ref: '#/components/schemas/ProcOfficeMembership'
            role:
              $ref: '#/components/schemas/ProcOfficeRole'
          required:
            - membership
            - role
    ProcOfficeMember:
      type: object
      allOf:
        - $ref: '#/components/schemas/User'
        - type: object
          properties:
            membership:
              $ref: '#/components/schemas/ProcOfficeMembership'
            role:
              $ref: '#/components/schemas/ProcOfficeRole'
      required:
        - email
        - id
        - membership
        - role
    ProcOfficeMembers:
      type: object
      properties:
        procOfficeMembers:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeMember'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOfficeMembers
    ProcOfficeJoinResponse:
      type: object
      properties:
        userId:
          type: string
          format: uuid
        isAllowed:
          type: boolean
          description: true -> request granted, false -> request denied / remove member
        justification:
          type: string
          description: if the join request has been declined, a justification has to be provided
      required:
        - userId
        - isAllowed
    PubDraftStatus:
      type: string
      enum:
        - draft
        - validated
        - submitted
        - to_publish
        - published
    ProjectSearchPubTypeFilter:
      type: string
      description: |
        This is a specific enumeration of publication types used in the extended filter parameters of the public project search and the proc-office project manager. 
        Values will technically be mapped to corresponding pubType, projectType and/or processType

        Note that:
        - award_tender includes also direct_award for an external publication if the project_type is tender as well
        - award_study_contract includes also direct_award for an external publication if the project_type is study_contract as well
        - award_competition includes also direct_award for an external publication if the project_type is competition as well
        - direct_award only includes publications created on the new simap.ch (i.e. not for an external publication whereby 
          the old simap is also regarded as an external system and hence an external publication).
      enum:
        - advance_notice
        - request_for_information
        - tender
        - competition
        - study_contract
        - award_tender
        - award_study_contract
        - award_competition
        - direct_award
        - participant_selection
        - revocation
        - abandonment
        - selective_offering_phase
    PubLotsType:
      type: string
      enum:
        - with
        - without
    BaseProjectsSearchEntry:
      type: object
      description: |
        Base project search entry used by the proc office and public models
      properties:
        id:
          type: string
          format: uuid
          description: The project id
        title:
          allOf:
            - $ref: '#/components/schemas/Translation'
          description: The project title
        projectNumber:
          type: string
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        projectSubType:
          $ref: '#/components/schemas/ProjectSubType'
        processType:
          $ref: '#/components/schemas/PubProcessType'
        lotsType:
          $ref: '#/components/schemas/PubLotsType'
      required:
        - id
        - title
        - projectNumber
        - projectType
        - projectSubType
        - processType
        - lotsType
    ProjectsSearchEntryLatestPub:
      type: object
      properties:
        publicationId:
          type: string
          format: uuid
          description: The publication id of the latest publication
        publicationDate:
          type: string
          format: date
          description: The publication date of the latest publication
        publicationNumber:
          allOf:
            - $ref: '#/components/schemas/PublicationNumber'
          description: The number of the latest publication.
        pubType:
          allOf:
            - $ref: '#/components/schemas/PubType'
          description: The type of the latest publication.
        corrected:
          type: boolean
          description: |
            If the latest publication is corrected.
      required:
        - publicationId
        - publicationNumber
        - pubType
        - corrected
    ProcOfficeProjectsOverviewEntryLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProjectsSearchEntryLatestPub'
        - type: object
          properties:
            lotId:
              type: string
              format: uuid
            lotNumber:
              type: integer
            lotTitle:
              $ref: '#/components/schemas/Translation'
            publicationStatus:
              allOf:
                - $ref: '#/components/schemas/PubDraftStatus'
              description: |
                Status of the latest referencing pub draft or publication like an award.
            editorialDeadline:
              type: string
              format: date-time
              description: |
                Editorial deadline of the latest referencing pub draft or publication like an award.
          required:
            - lotId
            - lotTitle
            - lotNumber
            - publicationStatus
    ProcOfficeProjectsOverviewEntry:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseProjectsSearchEntry'
        - $ref: '#/components/schemas/ProjectsSearchEntryLatestPub'
        - type: object
          properties:
            internalReference:
              type: string
            publicationStatus:
              allOf:
                - $ref: '#/components/schemas/PubDraftStatus'
              description: |
                Status of the latest pub draft of the project.
            editorialDeadline:
              type: string
              format: date-time
              description: |
                Editorial deadline of the latest pub draft of the project.
            lots:
              type: array
              items:
                $ref: '#/components/schemas/ProcOfficeProjectsOverviewEntryLot'
          required:
            - publicationStatus
            - lots
    ProcOfficeProjectsOverview:
      type: object
      properties:
        projects:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeProjectsOverviewEntry'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - projects
        - pagination
    PubOrderType:
      type: string
      enum:
        - construction
        - service
        - supply
    PubStudyType:
      type: string
      enum:
        - project_study
        - idea_study
        - overall_performance_study
    PubCompetitionType:
      type: string
      enum:
        - project_competition
        - idea_competition
        - overall_performance_competition
    ProjectTypeFields:
      type: object
      description: base project fields needed to identify type of project
      properties:
        projectNumber:
          type: string
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        projectSubType:
          $ref: '#/components/schemas/ProjectSubType'
        processType:
          $ref: '#/components/schemas/PubProcessType'
        orderType:
          deprecated: true
          description: Deprecated property, use the 'projectSubType'
          allOf:
            - $ref: '#/components/schemas/PubOrderType'
        studyType:
          deprecated: true
          description: Deprecated property, use the 'projectSubType'
          allOf:
            - $ref: '#/components/schemas/PubStudyType'
        competitionType:
          deprecated: true
          description: Deprecated property, use the 'projectSubType'
          allOf:
            - $ref: '#/components/schemas/PubCompetitionType'
        lotsType:
          $ref: '#/components/schemas/PubLotsType'
      required:
        - projectType
        - projectSubType
        - projectNumber
        - processType
        - lotsType
    BaseProjectData:
      type: object
      description: Base project data used by the proc office and public models
      allOf:
        - $ref: '#/components/schemas/ProjectTypeFields'
        - type: object
          properties:
            id:
              type: string
              format: uuid
          required:
            - id
    PubDraftLotId:
      type: object
      properties:
        id:
          type: string
          format: uuid
      required:
        - id
    PubDraftLotDescriptionCreate:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftLotId'
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
    PubDraftLotDescription:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftLotDescriptionCreate'
        - type: object
          properties:
            lotNumber:
              type: integer
            projectSubType:
              $ref: '#/components/schemas/ProjectSubType'
          required:
            - lotNumber
            - projectSubType
      required:
        - title
    ProcOfficeProjectHeaderDatesNonPublished:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesInterface'
        - type: object
          properties:
            editorialDeadline:
              type: string
              format: date-time
            publicationDate:
              type: string
              format: date
    ProcOfficeProjectHeaderDatesPublishedAdditionalDefault:
      type: object
      description: Represents the default header dates model for pub-drafts with additional header date properties.
      allOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalInterface'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesBase'
        - type: object
          properties:
            qnas:
              type: array
              items:
                $ref: '#/components/schemas/PublicationQna'
              description: |
                QNA round dates. 
                Only available if vendor of logged in user is eligible to see qna rounds or the user belongs to a procurement_office.
            offerDeadline:
              type: string
              format: date-time
              description: |
                Can be `null` when the only publication in the project is of type `advanced_notice` as there the value is optional.
            offerOpening:
              $ref: '#/components/schemas/DateOptionalTime'
              description: |
                Offer opening datetime. Only available for projects with projectType `tender`.
    ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveInterface'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesBase'
        - type: object
          properties:
            qnas:
              type: array
              items:
                $ref: '#/components/schemas/PublicationQna'
              description: |
                QNA round dates. 
                Only available if vendor of logged in user showed interest in the project or the user belongs to a procurement_office.
            participationRequestDeadline:
              type: string
              format: date-time
              description: |
                Contains the date until which vendors can submit requests to participate at the offer.

                Can be `null` when the only publication in the project is of type `advanced_notice` as there the value is optional.
            participationRequestOpening:
              $ref: '#/components/schemas/DateOptionalTime'
            offerSubmissionDeadline:
              $ref: '#/components/schemas/DateOptionalTime'
    ProcOfficeProjectHeaderDatesPublishedAdditionalInterface:
      type: object
      description: Helper used for code generation, see ProcOfficeProjectHeaderDatesPublishedAdditional for the actual definition
      allOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedInterface'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
          required:
            - processType
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
          selective: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelective'
          invitation: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
          no_process: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
    ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveInterface:
      type: object
      description: Helper used for code generation, see ProcOfficeProjectHeaderDatesPublishedAdditionalSelective for the actual definition
      allOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalInterface'
      discriminator:
        propertyName: pubType
        mapping:
          advance_notice: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
          tender: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
          competition: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
          study_contract: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
          selective_offering_phase: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
    PublicProjectHeaderDatesBase:
      type: object
      properties:
        publicationDate:
          type: string
          format: date
      required:
        - publicationDate
    PubBaseQna:
      type: object
      properties:
        id:
          type: string
          format: uuid
        date:
          type: string
          format: date
          description: |
            - Required in case publication is a call-for-bids
            - Optional in case publication is an advance-notice
        note:
          $ref: '#/components/schemas/Translation'
        externalLink:
          x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
          type: string
          format: url
          maxLength: 400
          description: |
            Link to external system where the qna rounds are executed. Optional field and only available if qna_round_source_type is defined as 'external_system'
      required:
        - id
    PublicationQna:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseQna'
    DateOptionalTime:
      type: object
      properties:
        dateTime:
          type: string
          format: date-time
        ignoreTime:
          type: boolean
          nullable: false
      required:
        - dateTime
        - ignoreTime
    ProcOfficeProjectHeaderDatesPublishedAdditionalSelective:
      type: object
      description: |
        Header dates model for pub-drafts in the selective process are again split into two categories based on their 
        `pubType`. Not all pub-types are listed here because some do not have additional header date properties
        (see ProcOfficeProjectHeaderDatesPublished).
      oneOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
      discriminator:
        propertyName: pubType
        mapping:
          advance_notice: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
          tender: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
          competition: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
          study_contract: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelectiveNotOfferingPhase'
          selective_offering_phase: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
    ProcOfficeProjectHeaderDatesPublishedAdditional:
      type: object
      description: |
        Header dates for pub-types which have additional date properties (see ProcOfficeProjectHeaderDatesPublished) are split
        again into two categories, this time based on their `processType`.
      oneOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelective'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
          selective: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalSelective'
          invitation: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
          no_process: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditionalDefault'
    ProcOfficeProjectHeaderDatesPublishedInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesInterface'
        - type: object
          properties:
            pubType:
              $ref: '#/components/schemas/PubType'
          required:
            - pubType
      discriminator:
        propertyName: pubType
        mapping:
          advance_notice: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          tender: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          competition: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          study_contract: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          selective_offering_phase: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          request_for_information: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          abandonment: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          direct_award: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          award: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          revocation: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          participant_selection: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
    ProcOfficeProjectHeaderDatesPublishedDefault:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedInterface'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesBase'
    ProcOfficeProjectHeaderDatesInterface:
      type: object
      description: Helper used for code generation, see ProcOfficeProjectHeaderDates for the actual definition
      properties:
        status:
          $ref: '#/components/schemas/PubDraftStatus'
      required:
        - status
      discriminator:
        propertyName: status
        mapping:
          draft: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
          validated: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
          submitted: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
          to_publish: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
          published: '#/components/schemas/ProcOfficeProjectHeaderDatesPublished'
    ProcOfficeProjectHeaderDatesPublished:
      type: object
      description: |
        Header dates for published pub-drafts are discriminated further based on their `pubType` because for some
        additional date properties are provided.
      oneOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
      discriminator:
        propertyName: pubType
        mapping:
          advance_notice: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          tender: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          competition: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          study_contract: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          selective_offering_phase: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedAdditional'
          request_for_information: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          abandonment: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          direct_award: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          award: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          revocation: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
          participant_selection: '#/components/schemas/ProcOfficeProjectHeaderDatesPublishedDefault'
    ProcOfficeProjectHeaderDates:
      type: object
      description: |
        Different header date models are used for pub-drafts discriminated by several properties, starting with its `status`, 
        splitting them into two categories: non-published and published pub-drafts.
      oneOf:
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
        - $ref: '#/components/schemas/ProcOfficeProjectHeaderDatesPublished'
      discriminator:
        propertyName: status
        mapping:
          draft: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
          validated: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
          submitted: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
          to_publish: '#/components/schemas/ProcOfficeProjectHeaderDatesNonPublished'
          published: '#/components/schemas/ProcOfficeProjectHeaderDatesPublished'
    ProcOfficeProjectHeaderPubDraft:
      type: object
      allOf:
        - $ref: '#/components/schemas/BasePublicationData'
          description: |
            Base information of the latest referring publication within the lot
        - type: object
          properties:
            id:
              type: string
              format: uuid
            title:
              $ref: '#/components/schemas/Translation'
            status:
              $ref: '#/components/schemas/PubDraftStatus'
            dates:
              $ref: '#/components/schemas/ProcOfficeProjectHeaderDates'
          required:
            - id
            - status
            - dates
    ProcOfficeProjectHeaderLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftLotDescription'
        - type: object
          properties:
            latestPubDraft:
              $ref: '#/components/schemas/ProcOfficeProjectHeaderPubDraft'
              description: latest pubdraft within this lot.
          required:
            - latestPubDraft
    ProcOfficeProjectOtherActions:
      type: string
      enum:
        - create_abandonment
        - edit_internal_reference
        - share
      description: |
        ## possible actions
        - `create_abandonment`      abandon a lot or the project (consult canProjectBeAbandoned on projectOther)
        - `edit_internal_reference` edit internal-reference of project at any state and at any time in the process
        - `share`                   general action, copy a share-link of the current project, implemented in the frontend only
    ProcOfficeProjectOther:
      type: object
      description: |
        Model that holds the current possible actions for a project which apply on a project level.
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeProjectOtherActions'
        canProjectBeAbandoned:
          type: boolean
          nullable: true
          description: |
            Only defined if action create_abandonment is defined in actions and the project has lots.
            In such a case it indicates whether the whole project can be abandoned or not, i.e. all lots have the same status
            and can be abandoned. 

            For instance, if a project has two lots A and B and lot A was already awarded and then revoked, i.e. can now be
            abandoned again and lot B was not awarded yet, then both can be abandoned, but since they have a different status
            (lot A has status revoked_published and lot B has status call_for_bids_published) then project cannot be 
            abandoned as a whole. Instead, the lots have to be abandoned individually.
      required:
        - actions
    ProcOfficePubPrimaryActions:
      type: string
      enum:
        - edit
        - submit
        - create_call_for_bids
        - create_award
        - create_participant_selection
        - create_selective_offering_phase
      description: |
        ## possible actions on drafts
        - `edit`  
        - `submit`    submit the validated draft

        ## possible actions on publications

        ### advance_notice
        - `create_call_for_bids`

        ### call_for_bids
        - `create_award` 

        ### award in case of a selective process
        - `create_participant_selection`  

        ### participant_selection  
        - `create_selective_offering_phase`

        ### selective_offering_phase
        - `create_award`
    ProcOfficePubSecondaryActions:
      type: string
      enum:
        - edit
        - withdraw
      description: |
        ## possible actions on drafts
        - `edit` - pub draft in status `draft`, `validated` status can be edited directly.
        - `withdraw` - draft is `submitted`, to edit it must be withdrawn first - only possible if draft has not yet past the `editorial_deadline` yet.
    ProcOfficePubOtherActions:
      type: string
      enum:
        - delete_project
        - delete_draft
        - pdf_export
        - create_correction
        - create_abandonment
        - create_revocation
        - copy
        - update_award_statistics
      description: |
        ## possible actions on drafts
        - `delete_project`        delete draft and project - only possible if the draft is the only pub in the project
        - `delete_draft`          delete only the draft

        ## possible actions on publications
        - `create_correction`     correct an advance_notice, call_for_bids, selective_offering_phase
        - `create_abandonment`    abandon the lot (or the project in case of project without lots)
        - `create_revocation`     revoke an advance_notice, award, participant_selection publication
        - `copy`                  create a copy of the current publication into a new project. Only available for initial publications

        ## possible actions on published awards/direct_awards
        - 'update_award_statistics'   update award statistics for already published awards

        ## general
        - `pdf_export`            general action, possible after a draft is `to_publish`, implemented in the frontend only
    ProcOfficePubActions:
      type: object
      description: |
        Model with primary, secondary and other actions for a data driven navigation on the public and draft projects
      properties:
        primary:
          $ref: '#/components/schemas/ProcOfficePubPrimaryActions'
          nullable: true
        secondary:
          $ref: '#/components/schemas/ProcOfficePubSecondaryActions'
          nullable: true
        other:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficePubOtherActions'
      required:
        - other
    ProcOfficeProjectActions:
      type: object
      description: |
        Model that holds the current possible actions for a project.

        Actions which are defined on a project level, are stored in the `projectOther` property (e.g. create_abandonment). 

        In case the project is without lots, then the `withoutLots` property holds the `primary` and/or `secondary` action
        for the project as well as `other` actions.

        Otherwise (i.e. project is with lots), then the `lots` property (of type object) contains per lot a property (where
        the lot id is the property name) the  `primary` and/or `secondary` action
        for the project as well as `other` actions.

        examples:
          submitted_tender_without_lots:
            description: structure example for project without lots, values are not correct
            value:
              withoutLots:
                primary: "create_award"
                secondary: "withdraw"
                other:
                  - "delete_project"
              lots: {}
          with_lots:
            description: structure example for project with lots, values are not correct
            value:
              withoutLots: null
              lots:
                "62ba2164-ab44-4f53-bb55-da7813529b05":
                  primary: null,
                  secondary: null,
                  other:
                    - "clone_project"
                "ec217972-51fe-4f63-b007-f60c1a7e6dda":
                  primary: null,
                  secondary: null,
                  other:
                    - "clone_project"
      properties:
        projectOther:
          $ref: '#/components/schemas/ProcOfficeProjectOther'
        withoutLots:
          $ref: '#/components/schemas/ProcOfficePubActions'
          description: |
            Only defined if the project is without lots
          nullable: true
        lots:
          type: object
          description: |
            Only defined if the project is with lots where the property names are the lot ids
          additionalProperties:
            $ref: '#/components/schemas/ProcOfficePubActions'
          nullable: true
      required:
        - projectOther
    ProcOfficeProjectHeader:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseProjectData'
        - type: object
          properties:
            internalReference:
              type: string
            lots:
              type: array
              description: Lots information of this project. Only provided if project was created with lotsType 'with'
              items:
                $ref: '#/components/schemas/ProcOfficeProjectHeaderLot'
            latestPubDraft:
              $ref: '#/components/schemas/ProcOfficeProjectHeaderPubDraft'
              description: latest publication. Only provided if project was created with lotsType 'without'
            actions:
              $ref: '#/components/schemas/ProcOfficeProjectActions'
      required:
        - actions
    ProcOfficeUserNotificationSettings:
      type: object
      properties:
        notifyOnNewQnaQuestions:
          type: boolean
      required:
        - notifyOnNewQnaQuestions
    UpdateArchiveStatus:
      type: object
      properties:
        archive:
          type: boolean
          description: true will archive the project, false will unarchive it.
      required:
        - archive
    ProcOfficePubDraftTemplateOrgTypeFilter:
      type: string
      enum:
        - comp_centre
        - proc_office
    InvolvedVendorStatus:
      type: string
      enum:
        - interest_shown
        - interest_withdrawn
        - offer_digital_submission
        - offer_external_submission
        - offer_opened
        - awarded
        - participation_request_digital_submission
        - participation_request_external_submission
        - participation_request_opened
        - qualified
        - request_for_information_submission_opened
        - request_for_information_external_submission
        - request_for_information_digital_submission
        - invited
        - invitation_declined
    ProcOfficeProjectVendorActionType:
      type: string
      enum:
        - mark_vendor_invited
        - mark_vendor_interest_shown
        - send_message
        - export_participation_protocol
        - export_offer_protocol
        - export_vendor_list
      description: |
        Type of action a proc-office member can perform in a project which is related to vendors.
        These actions aren't vendor-specific.
        ## Following actions are available:
        - `mark_vendor_invited`           Mark vendor as invited to the project
        - `mark_vendor_interest_shown`    Mark vendor as interest_shown in the project
        - `send_message`                  Send an e-mail to vendors which are at least interested or invited
        - `export_participation_protocol` Receive all the necessary data to generate an participation protocol
        - `export_offer_protocol`         Receive all the necessary data to generate an offer protocol
        - `export_vendor_list`            Export all vendors which are related to the project (interest_withdraw or invitation_declined) included
    ProcOfficeProjectVendorActions:
      type: object
      description: |
        Model that holds the current possible proc-office actions for vendors of a project.
        Either per lot or without lots
      properties:
        withoutLots:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeProjectVendorActionType'
          description: |
            Only defined if the project is without lots
          nullable: true
        lots:
          type: object
          description: |
            Only defined if the project is with lots where the property names are the lot ids
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ProcOfficeProjectVendorActionType'
          nullable: true
    VendorMinimal:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
      required:
        - id
        - name
    InvolvedVendor:
      type: object
      allOf:
        - $ref: '#/components/schemas/VendorMinimal'
        - type: object
          properties:
            active:
              type: boolean
              description: |
                If the vendor is active, disabled vendors can appeare in the list if they where deactivated after showing interest / were invited.
            lotId:
              type: string
              format: uuid
              description: Reference to lot in case status is per lot
            status:
              $ref: '#/components/schemas/InvolvedVendorStatus'
            statusChangedAt:
              allOf:
                - $ref: '#/components/schemas/DateOptionalTime'
              description: |
                DateTime when the status changed, when the vendor changed to this status. e.g 
                * when the status is `interest_shown` it's the date-time the vendor showed interest
                * when the status is `offer_external_submission` it's the date-time when the proc office marked an external submission for the vendor
                * when the status is `awarded` it's the date the award publication was published.
            user:
              $ref: '#/components/schemas/UserMinimal'
              description: The vendor user that is involved in the project, can be empty if the po has added the vendor or is the awarded entry
              nullable: true
            address:
              $ref: '#/components/schemas/Address'
              description: The address of the vendor
            offerExternalSubmissionDateTime:
              $ref: '#/components/schemas/DateOptionalTime'
              nullable: true
              description: |
                Date and time when the offer documents externally arrived at the procurement office or 
                null in case no documents arrived so far or an offer was submitted digitally.
            offerDigitalSubmissionDateTime:
              $ref: '#/components/schemas/DateOptionalTime'
              nullable: true
              description: |
                Date and time when the offer documents where digitally submitted on simap or
                null in case no documents was digitally submitted.
            participationExternalSubmissionDateTime:
              $ref: '#/components/schemas/DateOptionalTime'
              nullable: true
              description: |
                Date and time when the participation documents externally arrived at the procurement office 
                for the first round of a selective process or null in case:
                - no documents arrived so far
                - participation documents where digitally submitted on simap
                - the process type of the project is not a selective
            participationDigitalSubmissionDateTime:
              $ref: '#/components/schemas/DateOptionalTime'
              nullable: true
              description: |
                Date and time when the participation documents where digitally submitted on simap
                for the first round of a selective process or null in case:
                - no documents where digitally submitted
                - the process type of the project is not a selective
            rfiExternalSubmissionDateTime:
              $ref: '#/components/schemas/DateOptionalTime'
              nullable: true
              description: |
                Date and time when the rfi documents externally arrived at the procurement office or 
                null in case no documents arrived so far or an offer was submitted digitally.
            rfiDigitalSubmissionDateTime:
              $ref: '#/components/schemas/DateOptionalTime'
              nullable: true
              description: |
                Date and time when the rfi documents where digitally submitted on simap or
                null in case no documents was digitally submitted.
      required:
        - status
        - statusChangedAt
        - address
        - active
    ProcOfficeVendorActionType:
      type: string
      enum:
        - show_vendor_digital_submissions
        - mark_offer_external_submission
        - mark_participation_external_submission
        - mark_request_for_information_external_submission
      description: |
        Type of action a proc-office member can perform with an involved vendor in a project.
        These actions are vendor-specific.
        ## Following actions are available:
        - `show_vendor_digital_submissions`                  Navigate to the vendor digital submissions page
        - `mark_offer_external_submission`                   Mark and set the offer submission date (and time) for a vendor which sent there offer externally (e.g via Swiss Post)
        - `mark_participation_external_submission`           Mark and set the participation submission date (and time) for a vendor which sent there participation request externally (e.g via Swiss Post)
        - `mark_request_for_information_external_submission` Mark and set the rfi submission date (and time) for a vendor which sent there rfi response externally (e.g via Swiss Post)
    InvolvedVendorWithActions:
      type: object
      allOf:
        - $ref: '#/components/schemas/InvolvedVendor'
        - type: object
          properties:
            vendorProjectActions:
              type: array
              items:
                $ref: '#/components/schemas/ProcOfficeVendorActionType'
          required:
            - vendorProjectActions
    InvolvedVendorSearchResult:
      type: object
      properties:
        projectActions:
          $ref: '#/components/schemas/ProcOfficeProjectVendorActions'
        involvedVendors:
          type: array
          items:
            $ref: '#/components/schemas/InvolvedVendorWithActions'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - involvedVendors
        - projectActions
        - pagination
    ExternalDocumentSubmission:
      type: object
      properties:
        documentArrivalDateTime:
          $ref: '#/components/schemas/DateOptionalTime'
          description: |
            Date and time when the (first) documents externally arrived at the procurement office
        lotIds:
          type: array
          items:
            type: string
            format: uuid
          description: List of lotId's this submission is assigned to. If null, submission will be assigned to all lots in the project
      required:
        - documentArrivalDateTime
    InvolvedVendorSubmissionResult:
      type: object
      properties:
        involvedVendors:
          type: array
          items:
            $ref: '#/components/schemas/InvolvedVendorWithActions'
      required:
        - involvedVendors
    BaseMessage:
      type: object
      properties:
        subject:
          type: string
          minLength: 1
          maxLength: 100
          description: |
            subject of the message
        body:
          type: string
          format: html
          minLength: 1
        language:
          $ref: '#/components/schemas/SystemLanguage'
          description: |
            The language which shall be used to render the e-mail template (i.e. header, footer etc. will be in this language)
        additionalEmails:
          type: array
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.EmailList'
          items:
            type: string
            format: email
          description: |
            Optional: further emails can be specified which shall receive this message in addition, next to the involved
            vendors which have a specified contact.
      required:
        - subject
        - body
        - language
    SendMessageRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
      properties:
        search:
          description: |
            Optional: search involved vendors by `vendorName` (requires at least 3 characters)
            Note, that the message cannot be sent to the involved vendor in case it has not defined a contact
          type: string
          pattern: (^$)|.{3,}
        status:
          $ref: '#/components/schemas/InvolvedVendorStatus'
          description: |
            Optional: filter involved vendors by status
            Note that involved vendors with status interest_withdrawn are excluded in any case
    QnaRoundState:
      type: string
      enum:
        - created
        - open
        - closed
    QnaRound:
      type: object
      description: The question round
      properties:
        id:
          type: string
          format: uuid
          description: |
            The id of the qna round.
        projectId:
          type: string
          format: uuid
          description: |
            The project-id where this qna-round shall be attached.
        qnaRoundNumber:
          type: integer
          format: int64
          description: |
            The number of the qna round.
        qnaRoundState:
          $ref: '#/components/schemas/QnaRoundState'
          description: |
            The state the qna round is in.
        qnaRoundEndDate:
          type: string
          format: date
          description: |
            The question round is open until midnight of this date.
        lotId:
          type: string
          format: uuid
          description: |
            Lot id to which this qna round is assigned, null if qna round is assigned to whole project
        restricted:
          type: boolean
          description: |
            True if access to qna round is restricted to a subset of vendors showing interest.
            True in process `invitation`.
      required:
        - id
        - qnaRoundNumber
        - qnaRoundState
        - projectId
        - qnaRoundEndDate
    Question:
      type: object
      properties:
        id:
          type: string
          format: uuid
        question:
          type: string
        lotId:
          type: string
          format: uuid
          description: |
            The lot id to which the question belongs to or empty if all lots are concerned.
      required:
        - id
        - question
    QnaAnswerState:
      type: string
      enum:
        - draft
        - published
        - changed
        - unanswered
    Qna:
      type: object
      allOf:
        - $ref: '#/components/schemas/Question'
        - type: object
          properties:
            questionAskedAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            questionAnsweredAt:
              type: string
              format: date-time
            questionNumber:
              type: integer
              format: int64
              description: |
                The number which was been assigned to the question
            answer:
              type: string
            answerState:
              $ref: '#/components/schemas/QnaAnswerState'
            userAskedQuestion:
              allOf:
                - $ref: '#/components/schemas/UserMinimal'
              description: Only added if visible to the current user
            vendorAskedQuestion:
              allOf:
                - $ref: '#/components/schemas/VendorMinimal'
              description: Only added if visible to the current user
      required:
        - questionAskedAt
        - questionNumber
        - answerState
    Qnas:
      type: object
      description: List of qna's (question answer pair)
      properties:
        qnas:
          type: array
          items:
            $ref: '#/components/schemas/Qna'
    QnaRoundWithQnas:
      type: object
      description: The question round
      allOf:
        - $ref: '#/components/schemas/QnaRound'
        - $ref: '#/components/schemas/Qnas'
      required:
        - qnas
    QnaRoundsWithQnas:
      title: QnaRoundsWithQnas
      type: object
      properties:
        qnaRounds:
          type: array
          items:
            $ref: '#/components/schemas/QnaRoundWithQnas'
      required:
        - qnaRounds
    InvolvedVendorProtocolResult:
      type: object
      properties:
        involvedVendors:
          type: array
          items:
            $ref: '#/components/schemas/InvolvedVendor'
        offerDeadline:
          type: string
          format: date-time
        participationDeadline:
          type: string
          format: date-time
      required:
        - involvedVendors
    ProjectDocumentSourceType:
      type: string
      enum:
        - advance_notice
        - request_for_information
        - tender
        - competition
        - study_contract
        - correction
        - direct_award
        - tender_award
        - competition_award
        - study_contract_award
        - selective_offering_phase
        - qna
      description: |
        The following values relate to a publication, are uploaded for the given publication of the type:
        * advance_notice
        * request_for_information
        * tender
        * competition
        * study_contract
        * selective_offering_phase

        The following values relate to an award publication, we differentiate the `award` type, include the project type in the name:  
        * tender_award
        * competition_award
        * study_contract_award

        For direct awards, there is a special case, `direct_award` in a process other than `direct`("Direkter Zuschlag") can have documents,
        not allowed for `direct_award` in process `direct` ("Freihändige Vergabe")
        * direct_award 

        Source type for publications that are corrected, irrelevant of their type. 
        * correction

        When the source of the document is the QNA rounds
        * qna

        I.e. an upload is not allowed for publication types not mentioned here (at the time of writing: 
        abandonment, participant_selection)
    DocumentContentType:
      type: string
      enum:
        - application/zip
        - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
        - text/plain
        - application/vnd.openxmlformats-officedocument.presentationml.presentation
        - image/png
        - application/pdf
        - application/vnd.ms-outlook
        - video/mpeg
        - video/mp4
        - image/jpeg
        - application/gzip
        - image/gif
        - application/vnd.openxmlformats-officedocument.wordprocessingml.template
        - application/vnd.openxmlformats-officedocument.wordprocessingml.document
        - text/csv
        - application/x-7z-compressed
        - application/acad
        - image/vnd.dwg
        - application/octet-stream
    BaseDocument:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: id of the document
        fileName:
          type: string
          format: fileName
        fileSize:
          type: integer
          description: file size in bytes
          format: int64
        contentType:
          $ref: '#/components/schemas/DocumentContentType'
        createdAt:
          type: string
          format: date-time
          description: |
            Date and time of the document created and upload.
      required:
        - id
        - fileName
        - fileSize
        - contentType
        - createdAt
    BaseProjectDocument:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseDocument'
        - type: object
          properties:
            projectId:
              type: string
              format: uuid
              description: id of the associated project
            sourceType:
              $ref: '#/components/schemas/ProjectDocumentSourceType'
            languages:
              type: array
              items:
                $ref: '#/components/schemas/SystemLanguage'
            note:
              type: string
            qnaRoundId:
              type: string
              format: uuid
              description: The id of the qna round if document is associated to a qna round
            qnaRoundNumber:
              type: integer
              format: int64
              description: |
                The number of the qna round if document is associated to a qna round
            deletedAfterPublishingAt:
              type: string
              format: date-time
              description: |
                Date and time of the document deletion if document was associated to a published publication.
            uploadedAfterPublishingAt:
              type: string
              format: date-time
              description: |
                Date and time of the document upload if document is associated to a publication and was uploaded
                after publishing it.
          required:
            - projectId
            - languages
    ProjectDocument:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseProjectDocument'
        - type: object
          properties:
            pubDraftId:
              type: string
              format: uuid
            lotDescription:
              $ref: '#/components/schemas/PubDraftLotDescription'
    ProjectDocuments:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/ProjectDocument'
      required:
        - documents
    DownloadToken:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    ProjectDocumentUpdate:
      type: object
      properties:
        languages:
          type: array
          items:
            $ref: '#/components/schemas/SystemLanguage'
        lotId:
          type: string
          format: uuid
          description: optional reference to a lot
        note:
          type: string
      required:
        - languages
    BaseDocumentUploadMeta:
      type: object
      properties:
        fileName:
          type: string
          format: fileNamePathStripped
          description: |
            Name of the file including the file extension -- if a path is provided e.g. foo/bar.txt then foo is ignored
            and only bar.txt is considered as file name.
      required:
        - fileName
    ProjectDocumentUploadMeta:
      type: object
      description: |
        either pubDraftId or qnaRoundId has to be specified (not both at the same time)
      allOf:
        - $ref: '#/components/schemas/BaseDocumentUploadMeta'
        - $ref: '#/components/schemas/ProjectDocumentUpdate'
        - type: object
          properties:
            pubDraftId:
              type: string
              format: uuid
              description: if document is assigned to a publication
            qnaRoundId:
              type: string
              format: uuid
              description: if document is assigned to qna round
    ProjectDocumentUploadMultipart:
      type: object
      description: |
        Payload of a multipart project document file upload strictly relying on the order of the parts. 
        Part 1 must be `meta` following by the part `file` to be able to process the request stream based.
      properties:
        meta:
          $ref: '#/components/schemas/ProjectDocumentUploadMeta'
        file:
          type: string
          format: binary
      required:
        - meta
        - file
    ProcOfficeProjectContributor:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/UserMinimal'
        projectId:
          type: string
          format: uuid
      required:
        - projectId
        - user
    ProcOfficeProjectContributors:
      type: object
      properties:
        projectContributors:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeProjectContributor'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - projectContributors
    ProcOfficeProjectInternalReference:
      type: object
      properties:
        internalReference:
          type: string
          nullable: true
          maxLength: 70
    ProcOfficeProjectHistoryPublicationStatus:
      type: string
      enum:
        - submitted
        - withdrawn
    ProcOfficeProjectHistoryPublication:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/BasePublicationData'
      properties:
        status:
          $ref: '#/components/schemas/ProcOfficeProjectHistoryPublicationStatus'
    ProcOfficeProjectHistoryPublications:
      type: object
      properties:
        procOfficeProjectHistoryPublications:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeProjectHistoryPublication'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOfficeProjectHistoryPublications
        - pagination
    ProcOfficeProjectHistoryQna:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/Qna'
    ProcOfficeProjectHistoryQnas:
      type: object
      properties:
        procOfficeProjectHistoryQnas:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeProjectHistoryQna'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOfficeProjectHistoryQnas
        - pagination
    ProcOfficeProjectHistoryQnaWithPrevious:
      type: object
      properties:
        current:
          $ref: '#/components/schemas/ProcOfficeProjectHistoryQna'
        previous:
          $ref: '#/components/schemas/ProcOfficeProjectHistoryQna'
      required:
        - current
        - previous
    ProjectHistoryInvolvement:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/VendorMinimal'
        - type: object
          properties:
            status:
              $ref: '#/components/schemas/InvolvedVendorStatus'
    ProjectHistoryInvolvements:
      type: object
      properties:
        projectHistoryInvolvements:
          type: array
          items:
            $ref: '#/components/schemas/ProjectHistoryInvolvement'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - projectHistoryInvolvements
        - pagination
    ProcOfficeProjectHistoryVendorMessage:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/BaseMessage'
        - type: object
          properties:
            vendorEmails:
              type: array
              items:
                type: string
                format: email
    ProcOfficeProjectHistoryVendorMessages:
      type: object
      properties:
        procOfficeProjectHistoryVendorMessages:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeProjectHistoryVendorMessage'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOfficeProjectHistoryVendorMessages
        - pagination
    ProcOfficeProjectHistoryProjectContributor:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - type: object
          properties:
            email:
              type: string
              format: email
    ProcOfficeProjectHistoryProjectContributors:
      type: object
      properties:
        procOfficeProjectHistoryProjectContributors:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeProjectHistoryProjectContributor'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOfficeProjectHistoryProjectContributors
        - pagination
    ProjectHistoryDocumentDownload:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - type: object
          properties:
            fileName:
              type: string
              format: fileName
    ProjectHistoryDocumentDownloads:
      type: object
      properties:
        projectHistoryDocumentDownloads:
          type: array
          items:
            $ref: '#/components/schemas/ProjectHistoryDocumentDownload'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - projectHistoryDocumentDownloads
        - pagination
    ProcOfficeHistoryMembership:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/ProcOfficeMember'
        - type: object
          properties:
            justification:
              type: string
    ProcOfficeHistoryMemberships:
      type: object
      properties:
        procOfficeHistoryMemberships:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeHistoryMembership'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOfficeHistoryMemberships
        - pagination
    ProcOfficeHistoryBaseDataEntry:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/BaseProcOffice'
        - type: object
          properties:
            deleted:
              type: boolean
    ProcOfficeHistoryBaseDataEntries:
      type: object
      properties:
        procOfficeHistoryBaseDataEntries:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeHistoryBaseDataEntry'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOfficeHistoryBaseDataEntries
        - pagination
    ProcOfficeHistoryAddressDataEntry:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/Address'
    ProcOfficeHistoryAddressDataEntries:
      type: object
      properties:
        procOfficeHistoryAddressDataEntries:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeHistoryAddressDataEntry'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - procOfficeHistoryAddressDataEntries
        - pagination
    BaseProjectInfo:
      type: object
      description: Base project info to be able to identify project
      allOf:
        - $ref: '#/components/schemas/ProjectTypeFields'
        - type: object
          properties:
            projectId:
              type: string
              format: uuid
          required:
            - projectId
    VendorDigitalSubmissionType:
      type: string
      enum:
        - offer_digital_submission
        - participation_request_digital_submission
        - request_for_information_digital_submission
    ProcOfficeVendorDigitalSubmissionActionType:
      type: string
      enum:
        - open
    VendorDigitalSubmissionInfo:
      type: object
      properties:
        submissionDate:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
          description: Provided if the digital vendor submission, along with all documents, was deleted due to exceeding the maximum storage duration.
    PdfSignatureValidationStatus:
      description: The status of the validation process of the document
      type: string
      enum:
        - no_signatures
        - processing_error
        - unchecked
        - invalid
        - valid
    PdfSignatures:
      type: object
      description: |
        Object containing the validation status of the signature validation for the given pdf.

        A pdf is only correctly signed, `valid`, 
        when the document has at least one signature and only contains valid signatures that are signed with a QES / ZertES compliant certificate.

        When the pdf contains at least one signature that is not QES / ZertES compliant, 
        the pdf is also considered `invalid` even when that signature itself is valid.

        A pdf can only contain valid QES / ZertES compliant signatures.
      properties:
        validationStatus:
          $ref: '#/components/schemas/PdfSignatureValidationStatus'
        validationDateTime:
          type: string
          format: date-time
          description: date and time when the document was checked / the signatures where validated.
      required:
        - validationStatus
    VendorDigitalSubmissionDocument:
      type: object
      description: |
        Submission Document

        The `signature` property is a read-only field that is used for PDF files. 
        It will contain the validation status and result of the signature validation of the pdf.  
        If the document is of another `contentType` than pdf the `signature` property will be `null`.
      allOf:
        - $ref: '#/components/schemas/BaseDocument'
        - type: object
          properties:
            vendorDigitalSubmissionId:
              type: string
              format: uuid
              description: Id of the vendor digital submission
            lotId:
              type: string
              format: uuid
              description: Id of lotId, the submissions is related to or null, if document is for the whole submission.
            createdByUser:
              type: string
              format: email
            signature:
              $ref: '#/components/schemas/PdfSignatures'
          required:
            - vendorDigitalSubmissionId
            - createdByUser
    VendorDigitalSubmissionDocuments:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/VendorDigitalSubmissionDocument'
      required:
        - documents
    PublicationLotDescription:
      type: object
      properties:
        id:
          type: string
          format: uuid
        lotNumber:
          type: integer
        title:
          $ref: '#/components/schemas/Translation'
        projectSubType:
          $ref: '#/components/schemas/ProjectSubType'
      required:
        - id
        - lotNumber
        - title
        - projectSubType
    VendorDigitalSubmissionLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationLotDescription'
        - $ref: '#/components/schemas/VendorDigitalSubmissionDocuments'
          description: list of documents assigned to the specific lot or empty if no lot specific document was uploaded to this submission
      required:
        - id
        - title
        - lotNumber
    VendorDigitalSubmissionDetailInfo:
      type: object
      allOf:
        - $ref: '#/components/schemas/VendorDigitalSubmissionInfo'
        - type: object
          properties:
            documents:
              $ref: '#/components/schemas/VendorDigitalSubmissionDocuments'
              description: documents assigned the whole submission or 'null', if only lot specific documents are available
            lots:
              type: array
              items:
                $ref: '#/components/schemas/VendorDigitalSubmissionLot'
              description: lot specific information to the submission. Only provided if project has lotsType 'with'.
            submissionDeadline:
              type: string
              format: date-time
              description: Deadline until when the current submission can be submitted
          required:
            - lots
            - submissionDeadline
    ProcOfficeVendorDigitalSubmission:
      type: object
      properties:
        vendorDigitalSubmissionId:
          type: string
          format: uuid
        vendorDigitalSubmissionType:
          $ref: '#/components/schemas/VendorDigitalSubmissionType'
        submissionOpenedAt:
          type: string
          format: date-time
        submissionOpenedBy:
          $ref: '#/components/schemas/UserMinimal'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ProcOfficeVendorDigitalSubmissionActionType'
        detail:
          $ref: '#/components/schemas/VendorDigitalSubmissionDetailInfo'
          description: Detail of vendor digital submission. Only provided if submission was opened
      required:
        - vendorDigitalSubmissionId
        - vendorDigitalSubmissionType
        - actions
    ProcOfficeVendorDigitalSubmissions:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseProjectInfo'
        - type: object
          properties:
            involvedVendor:
              $ref: '#/components/schemas/InvolvedVendor'
            submissions:
              type: array
              items:
                $ref: '#/components/schemas/ProcOfficeVendorDigitalSubmission'
          required:
            - submissions
            - involvedVendor
    ProcOfficeVendorDigitalSubmissionOpenResult:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProcOfficeVendorDigitalSubmission'
        - type: object
          properties:
            involvedVendor:
              $ref: '#/components/schemas/InvolvedVendor'
          required:
            - involvedVendor
    VendorSearchResult:
      type: object
      properties:
        id:
          type: string
          format: uuid
        uidNo:
          type: string
        dunsNo:
          type: string
        name:
          type: string
        isBiddingConsortium:
          type: boolean
        address:
          $ref: '#/components/schemas/Address'
        active:
          type: boolean
      required:
        - id
        - name
        - address
        - active
        - isBiddingConsortium
    VendorSearchResults:
      type: object
      properties:
        vendors:
          type: array
          items:
            $ref: '#/components/schemas/VendorSearchResult'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - vendors
        - pagination
    CompanySize:
      type: string
      description: Defines the size of the company, micro (1-10), small (11-50), medium (51-250), large (>250)
      enum:
        - micro
        - small
        - medium
        - large
    LegalFormCode:
      type: string
      description: |
        Defines the legal form of the company. 
        List defined by https://www.ech.ch/sites/default/files/imce/eCH-Dossier/eCH-Dossier_PDF_Publikationen/Hauptdokument/STAN_d_NUL_2021-07-02_eCH-0097_V5.2.0_Datenstandard%20Unternehmensidentifikation.pdf
        chapter 2.7:
          - 0101 Einzelunternehmen
          - 0103 Kollektivgesellschaft
          - 0104 Kommanditgesellschaft
          - 0105 Kommanditaktiengesellschaft
          - 0106 Aktiengesellschaft
          - 0107 Gesellschaft mit beschränkter Haftung GMBH / SARL
          - 0108 Genossenschaft
          - 0109 Verein
          - 0110 Stiftung
          - 0111 Ausländische Niederlassung im Handelsregister eingetragen
          - 0113 Besondere Rechtsform
          - 0114 Kommanditgesellschaft für kollektive Kapitalanlagen
          - 0115 Investmentgesellschaft mit variablem Kapital (SICAV)
          - 0116 Investmentgesellschaft mit festem Kapital (SICAF)
          - 0117 Institut des öffentlichen Rechts
          - 0118 Nichtkaufmännische Prokuren
          - 0119 Haupt von Gemeinderschaften
          - 0151 Schweizerische Zweigniederlassung im Handelsregister eingetragen
          - 0220 Verwaltung des Bundes
          - 0221 Verwaltung des Kantons
          - 0222 Verwaltung des Bezirks
          - 0223 Verwaltung der Gemeinde
          - 0224 öffentlich-rechtliche Körperschaft (Verwaltung)
          - 0230 Unternehmen des Bundes
          - 0231 Unternehmen des Kantons
          - 0232 Unternehmen des Bezirks
          - 0233 Unternehmen der Gemeinde
          - 0234 öffentlich-rechtliche Körperschaft (Unternehmen)
          - 0302 Einfache Gesellschaft
          - 0312 Ausländische Niederlassung nicht im Handelsregister eingetragen
          - 0327 Ausländisches öffentliches Unternehmen
          - 0328 Ausländische öffentliche Verwaltung
          - 0329 Internationale Organisation
          - 0355 Übrige Genossenschaften
          - 0361 Trust
          - 0362 Fonds
          - 0441 Ausländische Unternehmen
          - 0571 Rechtsform unbestimmt oder unbekannt
      enum:
        - '0101'
        - '0103'
        - '0104'
        - '0105'
        - '0106'
        - '0107'
        - '0108'
        - '0109'
        - '0110'
        - '0111'
        - '0113'
        - '0114'
        - '0115'
        - '0116'
        - '0117'
        - '0118'
        - '0119'
        - '0151'
        - '0220'
        - '0221'
        - '0222'
        - '0223'
        - '0224'
        - '0230'
        - '0231'
        - '0232'
        - '0233'
        - '0234'
        - '0302'
        - '0312'
        - '0327'
        - '0328'
        - '0329'
        - '0355'
        - '0361'
        - '0362'
        - '0441'
        - '0571'
    BaseVendor:
      type: object
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
            uidNo:
              type: string
              nullable: true
            dunsNo:
              type: string
              nullable: true
            companySize:
              $ref: '#/components/schemas/CompanySize'
            name:
              type: string
            additionalName:
              type: string
              nullable: true
            careOf:
              type: string
              description: c/o
              nullable: true
            phone:
              $ref: '#/components/schemas/InternationalPhoneNumber'
            email:
              type: string
              format: email
              minLength: 1
              maxLength: 400
            url:
              x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
              type: string
              format: url
              maxLength: 400
              nullable: true
            legalFormCode:
              $ref: '#/components/schemas/LegalFormCode'
              nullable: true
            legalFormSinceDate:
              type: string
              format: date
              nullable: true
            businessPurpose:
              type: string
              nullable: true
            businessDomicile:
              type: string
              nullable: true
            isBiddingConsortium:
              type: boolean
            leadingVendor:
              type: string
              nullable: true
      required:
        - id
        - name
    VendorUserPublic:
      type: object
      properties:
        id:
          type: string
          format: uuid
        firstName:
          type: string
        lastName:
          type: string
        organizationUnit:
          type: string
          nullable: true
    VendorUser:
      type: object
      allOf:
        - $ref: '#/components/schemas/VendorUserPublic'
        - type: object
          properties:
            email:
              type: string
              format: email
    Vendor:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseVendor'
        - type: object
          properties:
            address:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.TedSendableAddress'
              allOf:
                - $ref: '#/components/schemas/Address'
            publicVendorAdmins:
              type: array
              description: The publicly visible vendor admins.
              items:
                $ref: '#/components/schemas/VendorUser'
      required:
        - address
    BaseVendorDetail:
      type: object
      allOf:
        - type: object
          properties:
            typeOfServices:
              type: array
              default: []
              items:
                uniqueItems: true
                $ref: '#/components/schemas/PubOrderType'
            cpvCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/CPVCode'
            bkpCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapBkpCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/BKPCode'
            ebkphCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapEbkphCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/EBKPHCode'
            ebkptCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapEbkptCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/EBKPTCode'
            npkCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapNpkCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/NPKCode'
            oagCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
    VendorDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/Vendor'
        - $ref: '#/components/schemas/BaseVendorDetail'
        - type: object
      required:
        - phone
        - email
        - isBiddingConsortium
    VendorCreate:
      type: object
      allOf:
        - $ref: '#/components/schemas/Vendor'
      description: |
        Specialised model for creating new vendors where email, phone and isBiddingConsortium are required
      required:
        - email
        - phone
        - isBiddingConsortium
    VendorPublic:
      type: object
      allOf:
        - $ref: '#/components/schemas/VendorMinimal'
        - type: object
          properties:
            uidNo:
              type: string
            dunsNo:
              type: string
            additionalName:
              type: string
              nullable: true
            url:
              x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
              type: string
              format: url
              maxLength: 400
              nullable: true
            address:
              $ref: '#/components/schemas/Address'
            vendorContacts:
              type: array
              items:
                $ref: '#/components/schemas/VendorUserPublic'
            companySize:
              $ref: '#/components/schemas/CompanySize'
            typeOfServices:
              type: array
              default: []
              items:
                uniqueItems: true
                $ref: '#/components/schemas/PubOrderType'
            cpvCodes:
              type: array
              items:
                $ref: '#/components/schemas/CPVCode'
            bkpCodes:
              type: array
              items:
                $ref: '#/components/schemas/BKPCode'
            ebkphCodes:
              type: array
              items:
                $ref: '#/components/schemas/EBKPHCode'
            ebkptCodes:
              type: array
              items:
                $ref: '#/components/schemas/EBKPTCode'
            npkCodes:
              type: array
              items:
                $ref: '#/components/schemas/NPKCode'
            oagCodes:
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            businessPurpose:
              type: string
            isBiddingConsortium:
              type: boolean
            leadingVendor:
              type: string
    VerifyVendorUid:
      type: object
      properties:
        id:
          type: string
          format: uuid
        uidNo:
          type: string
          description: |
            format: (CHE|ADM)-ZZZ.ZZZ.ZZZ
            * The first three letters represent the category, either CHE or ADM.
            * The nine numbers represent the id, every "Z" is a single digit 0-9
            * Example: CHE-123.456.789
      required:
        - id
        - uidNo
    VerifyVendorDuns:
      type: object
      properties:
        id:
          type: string
          format: uuid
        dunsNo:
          type: string
          description: |
            format: ZZ-ZZZ-ZZZZ or without dashes
            * The nine numbers represent the id, every "Z" is a single digit 0-9
            * Example: "15-048-3782"
      required:
        - id
        - dunsNo
    VendorMissingVerification:
      type: object
      properties:
        firstReminder:
          type: string
          format: date
          description: |
            The date when the first reminder is sent, normally when half of the available time has expired.
        secondReminder:
          type: string
          format: date
          description: |
            The date when the second reminder is sent, normally 30 days remain.
        deactivateAfter:
          type: string
          format: date
          description: |
            After this date the deactivation process will be started.
        daysUntilDeactivation:
          type: integer
          format: int64
          description: |
            The days can be zero or negative if the `deactivateAfter` date is passed but the deactivation process is not yet compleated.
      required:
        - firstReminder
        - secondReminder
        - deactivateAfter
        - daysUntilDeactivation
    MyVendor:
      allOf:
        - $ref: '#/components/schemas/Vendor'
        - type: object
          properties:
            missingVerification:
              $ref: '#/components/schemas/VendorMissingVerification'
              description: |
                If a vendor is not verified (no DUNS or UID number),
                this object will contain the notification / cutoff dates and days until the vendor is deactivated.
              default: null
    VendorMembership:
      type: string
      enum:
        - requested
        - accepted
        - rejected
    VendorMemberRole:
      type: string
      enum:
        - vendor_admin
        - vendor_user
    VendorMember:
      type: object
      allOf:
        - $ref: '#/components/schemas/VendorUser'
        - type: object
          properties:
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            membership:
              $ref: '#/components/schemas/VendorMembership'
            role:
              $ref: '#/components/schemas/VendorMemberRole'
            isPublic:
              type: boolean
              description: if this member can be seen in the public register, only admins can be publicly visible.
      required:
        - id
        - email
        - createdAt
        - updatedAt
        - membership
        - role
        - isPublic
    VendorHistoryMembership:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/VendorMember'
    VendorHistoryMemberships:
      type: object
      properties:
        vendorHistoryMemberships:
          type: array
          items:
            $ref: '#/components/schemas/VendorHistoryMembership'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - vendorHistoryMemberships
        - pagination
    VendorHistoryBaseDataEntry:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/BaseVendor'
        - $ref: '#/components/schemas/BaseVendorDetail'
        - type: object
          properties:
            deleted:
              type: boolean
    VendorHistoryBaseDataEntries:
      type: object
      properties:
        vendorHistoryBaseDataEntries:
          type: array
          items:
            $ref: '#/components/schemas/VendorHistoryBaseDataEntry'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - vendorHistoryBaseDataEntries
        - pagination
    VendorHistoryAddressDataEntry:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseHistory'
        - $ref: '#/components/schemas/Address'
    VendorHistoryAddressDataEntries:
      type: object
      properties:
        vendorHistoryAddressDataEntries:
          type: array
          items:
            $ref: '#/components/schemas/VendorHistoryAddressDataEntry'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - vendorHistoryAddressDataEntries
        - pagination
    VendorJoinRequest:
      type: object
      properties:
        join:
          type: boolean
          description: true -> request to join, false -> revoke join Request / leave vendor
      required:
        - join
    MyVendorMembership:
      allOf:
        - $ref: '#/components/schemas/VendorMinimal'
        - type: object
          properties:
            membership:
              $ref: '#/components/schemas/VendorMembership'
            role:
              $ref: '#/components/schemas/VendorMemberRole'
          required:
            - membership
            - role
    VendorMembers:
      type: object
      properties:
        vendorMembers:
          type: array
          items:
            $ref: '#/components/schemas/VendorMember'
      required:
        - vendorMembers
    VendorJoinResponse:
      type: object
      properties:
        userId:
          type: string
          format: uuid
        isAllowed:
          type: boolean
          description: true -> request granted, false -> request denied / remove member
        justification:
          type: string
          description: if the join request has been declined, a justification has to be provided
      required:
        - userId
        - isAllowed
    VendorUsers:
      type: object
      properties:
        vendorUsers:
          type: array
          items:
            $ref: '#/components/schemas/VendorUser'
      required:
        - vendorUsers
    ThreeValuedSelection:
      type: string
      enum:
        - 'yes'
        - 'no'
        - not_specified
    PubProcurementAddress:
      type: object
      properties:
        countryId:
          type: string
        cantonId:
          type: string
          description: |
            The cantonId is only a required field when the country is switzerland otherwise it's optional
        postalCode:
          type: string
          description: |
            The postalcode is only a required field when the country is switzerland otherwise it's optional
        city:
          $ref: '#/components/schemas/Translation'
    ProjectsSearchEntryLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProjectsSearchEntryLatestPub'
        - type: object
          properties:
            lotId:
              type: string
              format: uuid
            lotNumber:
              type: integer
            lotTitle:
              $ref: '#/components/schemas/Translation'
            orderAddressOnlyDescription:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
              description: |
                If the latest recorded `orderAddress` was unstructured, if there is only the address description.
            orderAddress:
              allOf:
                - $ref: '#/components/schemas/PubProcurementAddress'
              description: |
                The latest recorded `orderAddress`.
          required:
            - lotId
            - lotTitle
            - lotNumber
            - publicationDate
    ProjectsSearchEntry:
      type: object
      description: |
        Search result entry of a project search that contains the information about the project and the latest publications.

        Note:

        The `publicationId`, `publicationDate`, `publicationNumber`, `pubType`, `corrected` ist the information of the latest
        publication in the project. In a project with lots, check the lot in `lots` to get the latest publication for a given lot.
      allOf:
        - $ref: '#/components/schemas/BaseProjectsSearchEntry'
        - $ref: '#/components/schemas/ProjectsSearchEntryLatestPub'
        - type: object
          properties:
            procOfficeName:
              $ref: '#/components/schemas/Translation'
            orderAddressOnlyDescription:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
              description: |
                If the latest recorded `orderAddress` in the project was unstructured, then there is only a address description.

                This `orderAddressOnlyDescription` is only set for a project `without` lots.
                For a project `with` lots the order address is per lot, see the `lots` property.
                Projects in the `direct` process and `direct_award` publications don't contain a `orderAddress`.
            orderAddress:
              allOf:
                - $ref: '#/components/schemas/PubProcurementAddress'
              description: |
                The latest recorded `orderAddress`.

                This `oderAddress` is only set for a project `without` lots.
                For a project `with` lots the order address is per lot, see the `lots` property.
                Projects in the `direct` process and `direct_award` publications don't contain a `orderAddress`.
            lots:
              type: array
              items:
                $ref: '#/components/schemas/ProjectsSearchEntryLot'
          required:
            - procOfficeName
            - lots
      required:
        - publicationDate
    ProjectsSearch:
      type: object
      description: Public project overview
      properties:
        projects:
          type: array
          items:
            $ref: '#/components/schemas/ProjectsSearchEntry'
        pagination:
          $ref: '#/components/schemas/RollingPagination'
      required:
        - projects
        - pagination
    PublicationProjectDocument:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseProjectDocument'
        - type: object
          properties:
            publicationId:
              type: string
              format: uuid
            lotDescription:
              $ref: '#/components/schemas/PublicationLotDescription'
    PublicationProjectDocuments:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/PublicationProjectDocument'
      required:
        - documents
    VendorUserNotificationSettings:
      type: object
      properties:
        notifyOnNewPublications:
          type: boolean
        notifyOnQnaChanges:
          type: boolean
        notifyOnDocumentChanges:
          type: boolean
        notificationsForDigitalSubmissions:
          type: boolean
          description: |
            Receive notifications for the following cases:
            * When a digital submission is submitted for the project.
            * When the projects allows digital submission and the submission deadline is in the next 24 hours an there is no submitted submission for the project.
      required:
        - notifyOnNewPublications
        - notifyOnQnaChanges
        - notifyOnDocumentChanges
        - notificationsForDigitalSubmissions
    VendorDocument:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseDocument'
        - type: object
          properties:
            vendorId:
              type: string
              format: uuid
              description: Id of the vendor, can be obtained by `GET /vendor/v1` or has to be provided on creation of the vendor
          required:
            - vendorId
    VendorDocuments:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/VendorDocument'
      required:
        - documents
    VendorDocumentUploadMeta:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseDocumentUploadMeta'
    VendorDocumentUploadMultipart:
      type: object
      description: |
        Payload of a multipart vendor document file upload strictly relying on the order of the parts. 
        Part 1 must be `meta` following by the part `file` to be able to process the request stream based.
      properties:
        meta:
          $ref: '#/components/schemas/VendorDocumentUploadMeta'
        file:
          type: string
          format: binary
      required:
        - meta
        - file
    ProjectInterestStatus:
      type: string
      description: |
        The interest states are used in the context of a project where the `processType` is **not** `invitation`.
        - `interest_shown` - The vendor has shown interest in the project
        - `interest_withdrawn` - The vendor has withdrawn the interest in the project
      enum:
        - interest_shown
        - interest_withdrawn
    ProjectInterestRequest:
      type: object
      properties:
        interest:
          $ref: '#/components/schemas/ProjectInterestStatus'
          description: |
            Indicate if the user, in the name of his vendor, shows interest or not in the project.
      required:
        - interest
    PublicationAwardDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardDetailInterface'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - type: object
          properties:
            procurement:
              $ref: '#/components/schemas/PublicationAwardProcurement'
          required:
            - procurement
    PublicationAwardDetailInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - $ref: '#/components/schemas/PublicationDetailWithLotReference'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PublicationAwardProjectInfo'
            decision:
              $ref: '#/components/schemas/PublicationAwardDecision'
          required:
            - project-info
            - decision
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PublicationAwardDetail'
          direct_award: '#/components/schemas/PublicationDirectAwardDetail'
    PublicationDirectAwardTenderProcurementService:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDirectAwardTenderProcurementInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            cpcCode:
              $ref: '#/components/schemas/CPCCode'
    PublicationDirectAwardTenderProcurementInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PublicationDirectAwardTenderProcurement* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationDirectAwardProcurementInterface'
      required:
        - orderType
      discriminator:
        propertyName: orderType
        mapping:
          service: '#/components/schemas/PublicationDirectAwardTenderProcurementService'
          construction: '#/components/schemas/PublicationDirectAwardTenderProcurementConstruction'
          supply: '#/components/schemas/PublicationDirectAwardTenderProcurementSupply'
    PubBaseCodes:
      type: object
      properties:
        additionalCpvCodes:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
          type: array
          items:
            $ref: '#/components/schemas/CPVCode'
        bkpCodes:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapBkpCodeValidation'
          type: array
          items:
            $ref: '#/components/schemas/BKPCode'
        ebkphCodes:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapEbkphCodeValidation'
          type: array
          items:
            $ref: '#/components/schemas/EBKPHCode'
        ebkptCodes:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapEbkptCodeValidation'
          type: array
          items:
            $ref: '#/components/schemas/EBKPTCode'
        npkCodes:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapNpkCodeValidation'
          type: array
          items:
            $ref: '#/components/schemas/NPKCode'
    PublicationBaseCodes:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseCodes'
    PubConstructionType:
      type: string
      enum:
        - execution
        - planning_and_execution
    PubConstructionCategoryOptional:
      type: string
      enum:
        - structural_engineering
        - civil_engineering
        - not_specified
    PublicationDirectAwardTenderProcurementConstruction:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDirectAwardTenderProcurementInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            oagCodes:
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            cpcCode:
              $ref: '#/components/schemas/CPCCode'
            constructionType:
              $ref: '#/components/schemas/PubConstructionType'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
          required:
            - oagCodes
    PubSupplyType:
      type: string
      enum:
        - buy
        - rent
        - leasing
        - lease_purchase
        - work_contract
    PublicationDirectAwardTenderProcurementSupply:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDirectAwardTenderProcurementInterface'
        - type: object
          properties:
            additionalCpvCodes:
              type: array
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              $ref: '#/components/schemas/PubSupplyType'
          required:
            - additionalCpvCodes
    PublicationDirectAwardProcurementInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDirectAwardProcurement'
        - type: object
          properties:
            externalReference:
              $ref: '#/components/schemas/PubAndLotReference'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PublicationDirectAwardTenderProcurementInterface'
          competition: '#/components/schemas/PublicationDirectAwardGeneralProcurement'
          study_contract: '#/components/schemas/PublicationDirectAwardGeneralProcurement'
      required:
        - projectType
        - orderDescription
    PubProcurementTopic:
      type: string
      enum:
        - architecture
        - engineering
        - other
    PublicationDirectAwardGeneralProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDirectAwardProcurementInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            oagCodes:
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
          required:
            - oagCodes
    PubDirectAwardProcurement:
      type: object
      properties:
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        processType:
          $ref: '#/components/schemas/PubProcessType'
        pubType:
          $ref: '#/components/schemas/PubType'
        orderType:
          $ref: '#/components/schemas/PubOrderType'
        orderDescription:
          $ref: '#/components/schemas/Translation'
        cpvCode:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
          allOf:
            - $ref: '#/components/schemas/CPVCode'
      required:
        - pubType
        - projectType
        - processType
    PublisherReference:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          readOnly: true
      required:
        - id
        - name
    PubReference:
      type: object
      properties:
        publicationId:
          type: string
          format: uuid
          description: Reference to publicationId. Null in case of a reference to an external publication.
        pubType:
          $ref: '#/components/schemas/PubType'
          description: Publication type of referenced publication. Null in case of a reference to an external publication.
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        processType:
          $ref: '#/components/schemas/PubProcessType'
        corrected:
          type: boolean
          description: True if referenced publication was a correction. Null in case of a reference to an external publication.
        publicationNumber:
          type: string
          example: 123-01
          description: |
            Unique publication number aka "Meldungsnummer".
            Confluence: https://projects.unic.com/x/SAKMBg > Meldungsnummer
        publicationDate:
          type: string
          format: date
        publishers:
          type: array
          items:
            $ref: '#/components/schemas/PublisherReference'
      required:
        - publishers
    LotReference:
      type: object
      properties:
        lotId:
          type: string
          format: uuid
          description: Reference to lotId. Null in case of a reference to an external publication.
        lotNumber:
          type: integer
          maximum: 99
          minimum: 1
        lotTitle:
          $ref: '#/components/schemas/Translation'
          maxLength: 250
    PubAndLotReference:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubReference'
        - $ref: '#/components/schemas/LotReference'
        - type: object
          properties:
            lotsType:
              $ref: '#/components/schemas/PubLotsType'
          required:
            - lotsType
    PublicationDirectAwardTenderProcurement:
      title: PublicationDirectAwardTenderProcurement
      type: object
      oneOf:
        - $ref: '#/components/schemas/PublicationDirectAwardTenderProcurementService'
        - $ref: '#/components/schemas/PublicationDirectAwardTenderProcurementConstruction'
        - $ref: '#/components/schemas/PublicationDirectAwardTenderProcurementSupply'
      discriminator:
        propertyName: orderType
        mapping:
          service: '#/components/schemas/PublicationDirectAwardTenderProcurementService'
          construction: '#/components/schemas/PublicationDirectAwardTenderProcurementConstruction'
          supply: '#/components/schemas/PublicationDirectAwardTenderProcurementSupply'
    PublicationDirectAwardProcurement:
      title: PublicationDirectAwardProcurement
      type: object
      oneOf:
        - $ref: '#/components/schemas/PublicationDirectAwardTenderProcurement'
        - $ref: '#/components/schemas/PublicationDirectAwardGeneralProcurement'
        - $ref: '#/components/schemas/PublicationDirectAwardGeneralProcurement'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PublicationDirectAwardTenderProcurement'
          competition: '#/components/schemas/PublicationDirectAwardGeneralProcurement'
          study_contract: '#/components/schemas/PublicationDirectAwardGeneralProcurement'
    PublicationDirectAwardDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardDetailInterface'
        - type: object
          properties:
            procurement:
              $ref: '#/components/schemas/PublicationDirectAwardProcurement'
          required:
            - procurement
    PublicationDetailInterface:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/PubType'
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        base:
          $ref: '#/components/schemas/PublicationBase'
        hasProjectDocuments:
          type: boolean
          readOnly: true
        ted:
          allOf:
            - $ref: '#/components/schemas/PubTedReference'
          description: |
            Reference to the TED publication, set when the publication is published on TED. 
            For published publications, the ted data is only present when the publication was successfully published on TED.
            Else the property is `null`.
        publishers:
          type: array
          description: List of publishers of this publication
          items:
            $ref: '#/components/schemas/PublisherReference'
      required:
        - id
        - type
        - projectType
        - detail
        - publishers
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PublicationAwardDetail'
          direct_award: '#/components/schemas/PublicationDirectAwardDetail'
          tender: '#/components/schemas/PublicationTenderDetail'
          competition: '#/components/schemas/PublicationCompetitionDetail'
          study_contract: '#/components/schemas/PublicationStudyContractDetail'
          participant_selection: '#/components/schemas/PublicationParticipantSelectionDetail'
          selective_offering_phase: '#/components/schemas/PublicationSelectiveOfferingPhaseDetail'
          revocation: '#/components/schemas/PublicationRevocationDetail'
          abandonment: '#/components/schemas/PublicationAbandonmentDetail'
          advance_notice: '#/components/schemas/PublicationAdvanceNoticeDetailDiscriminator'
          request_for_information: '#/components/schemas/PublicationRfiDetail'
    PublicationDetailBaseDescription:
      type: object
      description: |
        Full Publication detail for tender, study_contract or competition publication. All details consist of the 
        following structure:
          - project-info
          - lots
          - procurement
          - terms
          - dates
          - criteria

        Where `lots` is only provided if `lotsType` of the publication is set to `with` and `criteria` is only provided in case of 
        `lotsType` set to `without`. All other sections are provided but depend on `pubType`,  `procesType` and `lotsType` of the publication.
    PubCorrectionDetailData:
      type: object
      properties:
        correctedPubId:
          type: string
          format: uuid
        initialPublicationDate:
          type: string
          format: date
        remarks:
          $ref: '#/components/schemas/Translation'
        correctionDiffKeys:
          type: array
          items:
            type: string
          description: |
            Array of jsonpath pointing to nodes that have changed values in the detail result
          example:
            - procurement.orderDescription.de
            - procurement.orderAddressDescription.de
            - procurement.executionDeadlineType
            - procurement.variants
            - procurement.partialOffers
            - procurement.canContractBeExtended
            - procurement.orderAddress.city
            - procurement.additionalCpvCodes
            - procurement.bkpCodes
            - procurement.ebkphCodes
            - procurement.ebkptCodes
            - procurement.npkCodes
      required:
        - correctedPubId
        - initialPublicationDate
        - correctionDiffKeys
    PublicationCorrectionDetailData:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubCorrectionDetailData'
    PublicationDetailWithCorrection:
      type: object
      properties:
        correction:
          $ref: '#/components/schemas/PublicationCorrectionDetailData'
    DetailWithOptionalPubReference:
      type: object
      properties:
        referencingPub:
          $ref: '#/components/schemas/PubReference'
    PubVendorWithAddressData:
      type: object
      properties:
        vendorId:
          type: string
          format: uuid
        vendorName:
          type: string
          readOnly: true
        vendorAddress:
          $ref: '#/components/schemas/Address'
          readOnly: true
      required:
        - vendorId
        - vendorName
    PubInvitedVendor:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubVendorWithAddressData'
    PubInvitedVendorsPatch:
      type: object
      properties:
        publishInvitedVendors:
          type: boolean
          description: |
            true if invited vendors should get published together with the call_for_bids publication. 
            This means the invited vendors would be visible to the other invited vendors but not publicly visible,
            as the publication itself is only visible to the invited vendors and the proc_office itself.
        vendors:
          type: array
          items:
            $ref: '#/components/schemas/PubInvitedVendor'
    PubInvitedVendors:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubInvitedVendorsPatch'
      required:
        - publishInvitedVendors
        - vendors
    DetailWithInvitedVendors:
      type: object
      description: |
        InvitedVendors are only available for call_for_bids in invitation process.
      properties:
        invitedVendors:
          $ref: '#/components/schemas/PubInvitedVendors'
    PublicationTenderProjectInfoOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderProjectInfoInterface'
        - $ref: '#/components/schemas/PublicationBaseProjectInfoOpen'
        - type: object
          properties:
            publicationTed:
              type: boolean
      required:
        - publicationTed
    PublicationTenderProjectInfoInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PublicationTenderProjectInfo* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseProjectInfo'
        - $ref: '#/components/schemas/PubBaseProjectInfoPublicationLanguageProperties'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            orderType:
              $ref: '#/components/schemas/PubOrderType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTenderProjectInfoOpen'
          selective: '#/components/schemas/PublicationTenderProjectInfoSelective'
          invitation: '#/components/schemas/PublicationTenderProjectInfoInvitation'
      required:
        - processType
        - orderType
        - publicationLanguages
    PubLotLimitationData:
      type: object
      properties:
        participantLotsLimitation:
          type: integer
          description: |
            Indicator if there is a limitation for vendors, for how many lots in the project a vendor can make an offer. 
            `null` means no limitation.

            Only used when the project's `lotsType` is `with`.
        participantLotsLimitationNote:
          $ref: '#/components/schemas/Translation'
          description: |
            Only used when the pub's `lotsType` is `with`.
    Currency:
      type: string
      enum:
        - chf
        - eur
        - usd
    Price:
      type: object
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        price:
          type: number
          format: price
          minimum: 0
          maximum: 9999999999.99
    PubBaseProjectInfoOpenSelectiveBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubLotLimitationData'
        - type: object
          properties:
            stateContractArea:
              type: boolean
            dialog:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
              description: |
                - Needs to be `yes` or `no` in case of a call-for-bids pub-draft
                - Can be `not_specified` in case of an advance-notice pub-draft
            dialogNote:
              allOf:
                - $ref: '#/components/schemas/Translation'
              description: |
                - Required in case dialog = yes and pub-draft/publication is a call-for-bids
                - Optional in case pub-draft/publication is an advance-notice
            documentsWithCosts:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
              description: |
                - Needs to be `yes` or `no` in case of a call-for-bids pub-draft
                - Can be `not_specified` in case of an advance-notice pub-draft
            documentsCosts:
              allOf:
                - $ref: '#/components/schemas/Price'
              description: |
                - Required in case documentsWithCosts = yes and pub-draft/publication is a call-for-bids
                - Optional in case pub-draft/publication is an advance-notice
            documentsCostsNote:
              $ref: '#/components/schemas/Translation'
    PublicationBaseProjectInfoOpenSelectiveBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseProjectInfoOpenSelectiveBase'
      required:
        - stateContractArea
        - dialog
        - documentsWithCosts
    PubBaseProjectInfoSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseProjectInfoOpenSelectiveBase'
        - type: object
          properties:
            participantLimitation:
              type: integer
              description: |
                Number of maximal selectable participants in the "participant selection phase" (followup publication)   

                Set `null` for no limitation else if set must be a positive number
    PublicationBaseProjectInfoSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseProjectInfoOpenSelectiveBase'
        - $ref: '#/components/schemas/PubBaseProjectInfoSelective'
    PublicationTenderProjectInfoSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderProjectInfoInterface'
        - $ref: '#/components/schemas/PublicationBaseProjectInfoSelective'
        - type: object
          properties:
            publicationTed:
              type: boolean
      required:
        - publicationTed
    PublicationTenderProjectInfoInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderProjectInfoInterface'
    PubAddress:
      type: object
      description: |
        The char limits follow the TED limits for that field as in some cases the address is part of the data sent to TED.
      allOf:
        - $ref: '#/components/schemas/BaseAddress'
        - type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              maxLength: 400
              allOf:
                - $ref: '#/components/schemas/Translation'
            contactPerson:
              $ref: '#/components/schemas/Translation'
            phone:
              $ref: '#/components/schemas/InternationalPhoneNumber'
            email:
              type: string
              format: email
              maxLength: 400
            url:
              $ref: '#/components/schemas/TranslationURL'
            reference:
              type: string
            street:
              maxLength: 400
              allOf:
                - $ref: '#/components/schemas/Translation'
            city:
              maxLength: 400
              allOf:
                - $ref: '#/components/schemas/Translation'
    PubBaseProjectInfoAddress:
      type: object
      properties:
        procOfficeAddress:
          $ref: '#/components/schemas/PubAddress'
        procurementRecipientAddress:
          $ref: '#/components/schemas/PubAddress'
    PubDocumentsSourceType:
      type: string
      enum:
        - documents_source_simap
        - documents_source_address
        - documents_source_email
        - documents_source_url
    PubOfferType:
      type: string
      enum:
        - offer_digital_simap
        - offer_digital_external_platform
        - offer_external
        - offer_specific
    PubBaseProjectInfo:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseProjectInfoAddress'
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
            documentsLanguages:
              type: array
              items:
                type: string
            documentsLanguagesNote:
              $ref: '#/components/schemas/Translation'
            documentsSourceType:
              $ref: '#/components/schemas/PubDocumentsSourceType'
            documentsSourceEmail:
              type: string
              format: email
            documentsSourceUrl:
              x-extra-annotation: '@get:com.unic.simap.common.domain.Url'
              type: string
              format: url
              maxLength: 400
            documentsSourceNote:
              $ref: '#/components/schemas/Translation'
            offerLanguages:
              type: array
              items:
                type: string
            offerSpecificNote:
              $ref: '#/components/schemas/TranslationSanitizedHtml'
            offerTypes:
              type: array
              items:
                $ref: '#/components/schemas/PubOfferType'
              uniqueItems: true
            offerDigitalExternalPlatformUrl:
              $ref: '#/components/schemas/TranslationURL'
            documentsSourceAddress:
              $ref: '#/components/schemas/PubAddress'
            offerAddress:
              $ref: '#/components/schemas/PubAddress'
    PublicationBaseProjectInfo:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseProjectInfo'
      required:
        - title
        - documentsLanguages
        - offerLanguages
        - documentsSourceType
        - offerTypes
        - procOfficeAddress
        - procurementRecipientAddress
    PubBaseProjectInfoPublicationLanguageProperties:
      type: object
      properties:
        publicationLanguages:
          type: array
          items:
            type: string
        publicationLanguagesComment:
          $ref: '#/components/schemas/Translation'
    PublicationBaseProjectInfoOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseProjectInfoOpenSelectiveBase'
    PublicationTenderProjectInfo:
      title: PublicationTenderProjectInfo
      type: object
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PublicationTenderProjectInfoOpen'
        - $ref: '#/components/schemas/PublicationTenderProjectInfoSelective'
        - $ref: '#/components/schemas/PublicationTenderProjectInfoInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTenderProjectInfoOpen'
          selective: '#/components/schemas/PublicationTenderProjectInfoSelective'
          invitation: '#/components/schemas/PublicationTenderProjectInfoInvitation'
    PublicationTenderConstructionLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderLotInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - $ref: '#/components/schemas/PubTenderConstructionFields'
      required:
        - additionalCpvCodes
        - bkpCodes
        - ebkphCodes
        - ebkptCodes
        - npkCodes
        - oagCodes
        - constructionType
        - constructionCategory
    PublicationTenderLotInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PublicationTenderLot* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseLot'
        - $ref: '#/components/schemas/PubTenderSpecificProcurementFields'
      discriminator:
        propertyName: orderType
        mapping:
          construction: '#/components/schemas/PublicationTenderConstructionLot'
          supply: '#/components/schemas/PublicationTenderSupplyLot'
          service: '#/components/schemas/PublicationTenderServiceLot'
    PublicationTenderSupplyLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderLotInterface'
        - type: object
          properties:
            additionalCpvCodes:
              type: array
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              $ref: '#/components/schemas/PubSupplyType'
          required:
            - additionalCpvCodes
            - supplyType
    PublicationTenderServiceLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderLotInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
      required:
        - additionalCpvCodes
        - bkpCodes
        - ebkphCodes
        - ebkptCodes
        - npkCodes
    PubProcurementOrderDescription:
      type: object
      properties:
        orderDescription:
          $ref: '#/components/schemas/TranslationSanitizedHtml'
    PubDeadlineTypeOptional:
      type: string
      enum:
        - date_time
        - days_after
        - not_specified
      description: |
        Selection for an optional set of date/time or days fields.
        This field group is optional, the enum shows which value is to be used.  

        - If `date_time` is selected then the associated date/time field must be set and used.
        - If `days_after` is selected then associated days field must be set and used.
        - If `not_specified` both associated fields must be not set i.e. `null` neither is to be used.
    DateRange:
      type: object
      properties:
        dateRange:
          type: array
          items:
            type: string
            format: date
          minItems: 2
          maxItems: 2
      required:
        - dateRange
    PubBaseProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubProcurementOrderDescription'
        - type: object
          properties:
            orderAddressOnlyDescription:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
              description: |
                - Needs to be `yes` or `no` in case of a call-for-bids pub-draft/publication
                - Can be `not_specified` in case of an advance-notice pub-draft/publication

                If this field is `yes` then the `orderAddressDescription` is a required field and only the `countryId` in the `orderAddress` must be set. 
                Else the description is optional.
            orderAddressDescription:
              $ref: '#/components/schemas/Translation'
            executionDeadlineType:
              allOf:
                - $ref: '#/components/schemas/PubDeadlineTypeOptional'
              description: |
                If `date_time` is selected then the `executionPeriod` must be set.
                If `days_after` is selected then `executionDays` must be set.
                Else `not_specified` both `executionPeriod` and `executionDays` must be null.
            executionPeriod:
              $ref: '#/components/schemas/DateRange'
            executionDays:
              type: integer
            executionNote:
              $ref: '#/components/schemas/Translation'
    PubBaseProcurementVariantsAndPartialOfferProperties:
      type: object
      properties:
        variants:
          allOf:
            - $ref: '#/components/schemas/ThreeValuedSelection'
        variantsNote:
          $ref: '#/components/schemas/Translation'
        partialOffers:
          allOf:
            - $ref: '#/components/schemas/ThreeValuedSelection'
        partialOffersNote:
          $ref: '#/components/schemas/Translation'
    PublicationBaseProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseProcurement'
        - $ref: '#/components/schemas/PubBaseProcurementVariantsAndPartialOfferProperties'
        - type: object
          properties:
            orderAddress:
              $ref: '#/components/schemas/PubProcurementAddress'
      required:
        - orderDescription
    PubBaseQualificationCriteria:
      type: object
      properties:
        qualificationCriteriaInDocuments:
          allOf:
            - $ref: '#/components/schemas/ThreeValuedSelection'
          description: |
            - Needs to be `yes` or `no` in case of a call-for-bids pub-draft/publication
            - Can be `not_specified` in case of an advance-notice pub-draft/publication

            If this field is `yes` then the `qualificationCriteria` and `qualificationCreateCriteriaPDF` can be
            omitted because the criteria are found in the provided documents.
        qualificationCriteriaNote:
          $ref: '#/components/schemas/Translation'
        qualificationCriteriaAsPDF:
          type: boolean
          default: false
          description: |
            If true, will generate a downloadable PDF with the defined criteria of `qualificationCriteria`.
    QualificationCriterion:
      type: object
      allOf:
        - $ref: '#/components/schemas/Criterion'
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
      required:
        - title
    PublicationBaseQualificationCriteria:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseQualificationCriteria'
        - type: object
          properties:
            qualificationCriteria:
              type: array
              items:
                $ref: '#/components/schemas/QualificationCriterion'
      required:
        - qualificationCriteriaInDocuments
        - qualificationCriteriaAsPDF
        - qualificationCriteria
    AwardCriteriaSelection:
      type: string
      enum:
        - criteria_defined
        - total_price
        - criteria_in_documents
        - not_specified
    AwardCriterion:
      type: object
      allOf:
        - $ref: '#/components/schemas/QualificationCriterion'
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
            weighting:
              type: integer
              description: |
                The wight of the criterion in percent
            maxPoints:
              type: integer
            isPriceCriterion:
              type: boolean
              description: |
                ONE criterion of the `awardCriteria` can be the criterion for the price.

                This is optional, there can be no price criterion for a publication. 

                By default, false.
      required:
        - title
        - isPriceCriterion
    PublicationBaseAwardCriteria:
      type: object
      properties:
        awardCriteriaSelection:
          $ref: '#/components/schemas/AwardCriteriaSelection'
          default: criteria_defined
        awardCriteriaNote:
          $ref: '#/components/schemas/Translation'
        awardCriteria:
          type: array
          items:
            $ref: '#/components/schemas/AwardCriterion'
      required:
        - awardCriteriaSelection
        - awardCriteria
    PublicationBaseCriteria:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseQualificationCriteria'
        - $ref: '#/components/schemas/PublicationBaseAwardCriteria'
    PubBaseCriteriaSelective:
      type: object
      properties:
        weightedQualificationCriteriaInDocuments:
          allOf:
            - $ref: '#/components/schemas/ThreeValuedSelection'
          description: |
            - Needs to be `yes` or `no` in case of a call-for-bids pub-draft/publication
            - Can be `not_specified` in case of an advance-notice pub-draft/publication

            If this field is `yes` then the `weightedQualificationCriteria` can be omitted because
            the criteria are found in the provided documents.
        weightedQualificationCriteriaNote:
          $ref: '#/components/schemas/Translation'
    WeightedQualificationCriterion:
      type: object
      allOf:
        - $ref: '#/components/schemas/QualificationCriterion'
        - type: object
          properties:
            weighting:
              type: integer
              description: |
                The weight of the criterion in percent
            maxPoints:
              type: integer
    PublicationBaseCriteriaSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseCriteriaSelective'
        - type: object
          properties:
            weightedQualificationCriteria:
              type: array
              items:
                $ref: '#/components/schemas/WeightedQualificationCriterion'
      required:
        - weightedQualificationCriteriaInDocuments
        - weightedQualificationCriteria
    PublicationBaseLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationLotDescription'
        - $ref: '#/components/schemas/PublicationBaseProcurement'
        - $ref: '#/components/schemas/PublicationBaseCriteria'
        - $ref: '#/components/schemas/PublicationBaseCriteriaSelective'
    PubTenderSpecificProcurementFields:
      type: object
      properties:
        processType:
          $ref: '#/components/schemas/PubProcessType'
        orderType:
          $ref: '#/components/schemas/PubOrderType'
        contractDeadlineType:
          allOf:
            - $ref: '#/components/schemas/PubDeadlineTypeOptional'
          description: |
            - If `date_time` is selected then the `contractPeriod` is relevant.
            - If `days_after` is selected then `contractDays` is relevant.
            - If `not_specified` is selected then `contractDays` and `contractPeriod` must be null
        contractPeriod:
          allOf:
            - $ref: '#/components/schemas/DateRange'
          description: |
            - Required in case contractDeadlineType = days_time
        contractDays:
          type: integer
          description: |
            - Required in case contractDeadlineType = days_after
        canContractBeExtended:
          allOf:
            - $ref: '#/components/schemas/ThreeValuedSelection'
          description: |
            - Needs to be `yes` or `no` in case of a call-for-bids pub-draft/publication
            - Can be `not_specified` in case of an advance-notice pub-draft/publication

            If `yes` then `canContractBeExtendedNote` is relevant, otherwise must be null
        canContractBeExtendedNote:
          allOf:
            - $ref: '#/components/schemas/Translation'
          description: |
            When `canContractBeExtended` is `yes` then `canContractBeExtendedNote` can be considered but is still optional 
            and can still be empty. If it `canContractBeExtended` is `no` or `not_specified` then this field must be null.
        options:
          $ref: '#/components/schemas/ThreeValuedSelection'
        optionsNote:
          $ref: '#/components/schemas/Translation'
      required:
        - processType
        - orderType
    PubTenderConstructionFields:
      type: object
      properties:
        oagCodes:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
          type: array
          items:
            $ref: '#/components/schemas/OAGCode'
        constructionType:
          $ref: '#/components/schemas/PubConstructionType'
        constructionCategory:
          $ref: '#/components/schemas/PubConstructionCategoryOptional'
          description: |
            Can be `not_specified` in case of an advance-notice pub-draft/publication.
    PublicationTenderLot:
      title: PublicationTenderLot
      type: object
      description: |
        Uses the `orderType` to discriminate between the models of the service, supply or construction type.
      oneOf:
        - $ref: '#/components/schemas/PublicationTenderConstructionLot'
        - $ref: '#/components/schemas/PublicationTenderSupplyLot'
        - $ref: '#/components/schemas/PublicationTenderServiceLot'
      discriminator:
        propertyName: orderType
        mapping:
          construction: '#/components/schemas/PublicationTenderConstructionLot'
          supply: '#/components/schemas/PublicationTenderSupplyLot'
          service: '#/components/schemas/PublicationTenderServiceLot'
    PublicationTenderProcurementConstruction:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderProcurementInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - $ref: '#/components/schemas/PubTenderConstructionFields'
        - type: object
          properties:
            cpcCode:
              $ref: '#/components/schemas/CPCCode'
    PublicationTenderProcurementInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PublicationTenderProcurement* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseProcurement'
        - $ref: '#/components/schemas/PubTenderSpecificProcurementFields'
        - type: object
          properties:
            cpvCode:
              $ref: '#/components/schemas/CPVCode'
      discriminator:
        propertyName: orderType
        mapping:
          construction: '#/components/schemas/PublicationTenderProcurementConstruction'
          supply: '#/components/schemas/PublicationTenderProcurementSupply'
          service: '#/components/schemas/PublicationTenderProcurementService'
    PublicationTenderProcurementSupply:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderProcurementInterface'
        - type: object
          properties:
            additionalCpvCodes:
              type: array
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              $ref: '#/components/schemas/PubSupplyType'
    PublicationTenderProcurementService:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderProcurementInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            cpcCode:
              $ref: '#/components/schemas/CPCCode'
    PublicationTenderProcurement:
      title: PublicationTenderProcurement
      type: object
      description: |
        Uses the `orderType` to discriminate between the models of the service, supply or construction type.
      oneOf:
        - $ref: '#/components/schemas/PublicationTenderProcurementConstruction'
        - $ref: '#/components/schemas/PublicationTenderProcurementSupply'
        - $ref: '#/components/schemas/PublicationTenderProcurementService'
      discriminator:
        propertyName: orderType
        mapping:
          construction: '#/components/schemas/PublicationTenderProcurementConstruction'
          supply: '#/components/schemas/PublicationTenderProcurementSupply'
          service: '#/components/schemas/PublicationTenderProcurementService'
    PublicationTenderTermsOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderTermsInterface'
        - $ref: '#/components/schemas/PubBaseTermsOpenSelective'
        - $ref: '#/components/schemas/PubBaseTermsWalkthrough'
    PublicationTenderTermsInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PublicationTenderTerms* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseTerms'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            orderType:
              $ref: '#/components/schemas/PubOrderType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTenderTermsOpen'
          selective: '#/components/schemas/PublicationTenderTermsSelective'
          invitation: '#/components/schemas/PublicationTenderTermsInvitation'
      required:
        - processType
        - orderType
    PubBaseTermsOpenSelective:
      type: object
      properties:
        preInvolvedVendor:
          $ref: '#/components/schemas/Translation'
        termsOfBusiness:
          $ref: '#/components/schemas/Translation'
        termsOfPayment:
          $ref: '#/components/schemas/Translation'
        includedCosts:
          $ref: '#/components/schemas/Translation'
        securityDeposits:
          $ref: '#/components/schemas/Translation'
        nonWTORequirements:
          $ref: '#/components/schemas/Translation'
    PubBaseTermsWalkthrough:
      type: object
      properties:
        walkThroughNotes:
          $ref: '#/components/schemas/Translation'
    PublicationTenderTermsSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderTermsInterface'
        - $ref: '#/components/schemas/PubBaseTermsOpenSelective'
        - $ref: '#/components/schemas/PubBaseTermsWalkthrough'
    PublicationTenderTermsInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderTermsInterface'
        - $ref: '#/components/schemas/PubBaseTermsWalkthrough'
    PubBaseMinimalTerms:
      type: object
      properties:
        termsNote:
          $ref: '#/components/schemas/Translation'
        otherRequirements:
          $ref: '#/components/schemas/Translation'
    PubTermsType:
      type: string
      enum:
        - defined
        - in_documents
        - none
        - not_specified
    PubTermCriterion:
      type: object
      allOf:
        - $ref: '#/components/schemas/Criterion'
    PubBaseTerms:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseMinimalTerms'
        - type: object
          properties:
            termsType:
              $ref: '#/components/schemas/PubTermsType'
            termsCriteria:
              type: array
              items:
                $ref: '#/components/schemas/PubTermCriterion'
            termsCriteriaAsPDF:
              type: boolean
            consortiumAllowed:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
            consortiumMultiApplicationAllowed:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
            consortiumNote:
              $ref: '#/components/schemas/Translation'
            subContractorAllowed:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
            subContractorMultiApplicationAllowed:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
            subContractorNote:
              $ref: '#/components/schemas/Translation'
            remediesNotice:
              $ref: '#/components/schemas/Translation'
    PublicationBaseTerms:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseTerms'
      required:
        - consortiumAllowed
        - consortiumMultiApplicationAllowed
        - subContractorAllowed
        - subContractorMultiApplicationAllowed
        - termsType
        - termsCriteria
        - termsCriteriaAsPDF
    PublicationTenderTerms:
      title: PublicationTenderTerms
      type: object
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PublicationTenderTermsOpen'
        - $ref: '#/components/schemas/PublicationTenderTermsSelective'
        - $ref: '#/components/schemas/PublicationTenderTermsInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTenderTermsOpen'
          selective: '#/components/schemas/PublicationTenderTermsSelective'
          invitation: '#/components/schemas/PublicationTenderTermsInvitation'
    PublicationTenderDatesOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderDatesInterface'
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PublicationBaseDatesOpen'
        - $ref: '#/components/schemas/PubTenderDatesOpen'
      required:
        - publicOfferOpening
    PublicationTenderDatesInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PublicationTenderDates* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseDatesAppointments'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            orderType:
              $ref: '#/components/schemas/PubOrderType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTenderDatesOpen'
          selective: '#/components/schemas/PublicationTenderDatesSelective'
          invitation: '#/components/schemas/PublicationTenderDatesInvitation'
      required:
        - processType
        - orderType
    PubQnaRoundSourceType:
      type: string
      enum:
        - simap
        - external_system
        - no_qna_rounds
    PubBaseDates:
      type: object
      properties:
        publicationDate:
          type: string
          format: date
          description: |
            Publication date of the current publication
        initialPublicationDate:
          type: string
          format: date
          description: |
            In case of a correction, the publication date of the initially published publication. If provided use this field to validate other fields against it.
        publicationDateForecast:
          type: string
          format: date
          nullable: true
          description: |
            Only relevant in case of an advance-notice pub-draft/publication where it denotes the predicted publication date 
            of the call-for-bids publication which will be based on this advance-notice
        offerDeadline:
          type: string
          format: date-time
        specificDeadlinesAndFormalRequirements:
          $ref: '#/components/schemas/Translation'
        qnaRoundSourceType:
          $ref: '#/components/schemas/PubQnaRoundSourceType'
      required:
        - qnaRoundSourceType
    PubBaseCallForBidsDates:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseDates'
        - type: object
          properties:
            documentsAvailable:
              $ref: '#/components/schemas/DateRange'
            expressionOfInterestUntil:
              type: string
              format: date
              description: This date is exclusive, meaning that a vendor needs to show interest before the provided date.
    PubBaseDatesSelective:
      type: object
      properties:
        participationRequestOpening:
          $ref: '#/components/schemas/DateOptionalTime'
        participationRequestOpeningNotes:
          $ref: '#/components/schemas/Translation'
        selectParticipants:
          $ref: '#/components/schemas/DateOptionalTime'
        selectParticipantsNotes:
          $ref: '#/components/schemas/Translation'
        offerSubmission:
          $ref: '#/components/schemas/DateOptionalTime'
        offerSubmissionNotes:
          $ref: '#/components/schemas/Translation'
        offerValidityDeadlineType:
          $ref: '#/components/schemas/PubDeadlineTypeOptional'
        offerValidityDeadlineDate:
          type: string
          format: date
        offerValidityDeadlineDays:
          type: integer
        offerValidityNotes:
          $ref: '#/components/schemas/Translation'
      required:
        - offerValidityDeadlineType
    PublicationBaseDatesSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseDatesSelective'
      required:
        - participationRequestOpeningNotes
        - offerParticipantSelectionNotes
        - offerSubmissionNotes
        - offerValidityNotes
    PublicationTenderDatesSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderDatesInterface'
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PublicationBaseDatesSelective'
    PubTenderDates:
      type: object
      properties:
        offerOpening:
          allOf:
            - $ref: '#/components/schemas/DateOptionalTime'
          description: |
            - Required in case of a call-for-bids pub-draft/publication
            - Optional in case of an advance-notice pub-draft/publication
        offerOpeningNotes:
          $ref: '#/components/schemas/Translation'
    PubBaseDatesOfferValidity:
      properties:
        offerValidityDeadlineType:
          $ref: '#/components/schemas/PubDeadlineTypeOptional'
        offerValidityDeadlineDate:
          type: string
          format: date
        offerValidityDeadlineDays:
          type: integer
        offerValidityNotes:
          $ref: '#/components/schemas/Translation'
      required:
        - offerValidityDeadlineType
    PubBaseDatesInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseDates'
        - $ref: '#/components/schemas/PubBaseDatesOfferValidity'
        - type: object
          properties:
            declineInvitationUntil:
              type: string
              format: date
              description: This date is exclusive, meaning that a vendor need to declined the invitation before the provided date.
    PublicationBaseDatesInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseDatesInvitation'
      required:
        - qnas
        - offerValidityDeadlineType
        - otherAppointments
        - offerDeadline
        - specificDeadlinesAndFormalRequirements
        - offerOpeningNotes
        - offerValidityNotes
    PublicationTenderDatesInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderDatesInterface'
        - $ref: '#/components/schemas/PubTenderDates'
        - $ref: '#/components/schemas/PublicationBaseDatesInvitation'
    PublicationAppointment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          $ref: '#/components/schemas/Translation'
        date:
          type: string
          format: date
        note:
          $ref: '#/components/schemas/Translation'
      required:
        - id
        - name
        - date
        - note
    PublicationBaseDatesAppointments:
      type: object
      properties:
        qnas:
          type: array
          items:
            $ref: '#/components/schemas/PublicationQna'
          minItems: 1
        otherAppointments:
          type: array
          items:
            $ref: '#/components/schemas/PublicationAppointment'
      required:
        - qnas
        - otherAppointments
    PubBaseDatesOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseDatesOfferValidity'
        - type: object
          properties:
            reductionMinimumOfferDeadline:
              type: boolean
          required:
            - reductionMinimumOfferDeadline
    PublicationBaseDatesOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseDatesOpen'
      required:
        - reductionMinimumOfferDeadline
        - offerValidityDeadlineType
        - offerValidityNotes
    PubTenderDatesOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubTenderDates'
        - type: object
          properties:
            publicOfferOpening:
              allOf:
                - $ref: '#/components/schemas/ThreeValuedSelection'
              description: |
                - Needs to be `yes` or `no` in case of a call-for-bids pub-draft/publication
                - Can be `not_specified` in case of an advance-notice pub-draft/publication
            offerOpeningPostalCode:
              type: string
            offerOpeningCity:
              $ref: '#/components/schemas/Translation'
    PublicationTenderDates:
      title: PublicationTenderDates
      type: object
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PublicationTenderDatesOpen'
        - $ref: '#/components/schemas/PublicationTenderDatesSelective'
        - $ref: '#/components/schemas/PublicationTenderDatesInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTenderDatesOpen'
          selective: '#/components/schemas/PublicationTenderDatesSelective'
          invitation: '#/components/schemas/PublicationTenderDatesInvitation'
    PublicationTenderCriteriaOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderCriteriaInterface'
    PublicationTenderCriteriaInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PublicationTenderCriteria* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseCriteria'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            orderType:
              $ref: '#/components/schemas/PubOrderType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTenderCriteriaOpen'
          selective: '#/components/schemas/PublicationTenderCriteriaSelective'
          invitation: '#/components/schemas/PublicationTenderCriteriaInvitation'
      required:
        - processType
        - orderType
    PublicationTenderCriteriaSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderCriteriaInterface'
        - $ref: '#/components/schemas/PublicationBaseCriteriaSelective'
    PublicationTenderCriteriaInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTenderCriteriaInterface'
    PublicationTenderCriteria:
      title: PublicationTenderCriteria
      type: object
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PublicationTenderCriteriaOpen'
        - $ref: '#/components/schemas/PublicationTenderCriteriaSelective'
        - $ref: '#/components/schemas/PublicationTenderCriteriaInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTenderCriteriaOpen'
          selective: '#/components/schemas/PublicationTenderCriteriaSelective'
          invitation: '#/components/schemas/PublicationTenderCriteriaInvitation'
    PublicationTenderDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - $ref: '#/components/schemas/PublicationDetailBaseDescription'
        - $ref: '#/components/schemas/PublicationDetailWithCorrection'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - $ref: '#/components/schemas/DetailWithInvitedVendors'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PublicationTenderProjectInfo'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PublicationTenderLot'
            procurement:
              $ref: '#/components/schemas/PublicationTenderProcurement'
            terms:
              $ref: '#/components/schemas/PublicationTenderTerms'
            dates:
              $ref: '#/components/schemas/PublicationTenderDates'
            criteria:
              $ref: '#/components/schemas/PublicationTenderCriteria'
          required:
            - project-info
            - procurement
            - terms
            - dates
    PublicationProjectInfoOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationProjectInfoInterface'
        - $ref: '#/components/schemas/PublicationBaseProjectInfoOpen'
    PublicationProjectInfoInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PublicationProjectInfo* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseProjectInfo'
        - $ref: '#/components/schemas/PubBaseProjectInfoPublicationLanguageProperties'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationProjectInfoOpen'
          selective: '#/components/schemas/PublicationProjectInfoSelective'
          invitation: '#/components/schemas/PublicationProjectInfoInvitation'
      required:
        - processType
        - publicationLanguages
    PublicationProjectInfoSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationProjectInfoInterface'
        - $ref: '#/components/schemas/PublicationBaseProjectInfoSelective'
    PublicationProjectInfoInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationProjectInfoInterface'
    PublicationProjectInfo:
      title: PublicationProjectInfo
      type: object
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PublicationProjectInfoOpen'
        - $ref: '#/components/schemas/PublicationProjectInfoSelective'
        - $ref: '#/components/schemas/PublicationProjectInfoInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationProjectInfoOpen'
          selective: '#/components/schemas/PublicationProjectInfoSelective'
          invitation: '#/components/schemas/PublicationProjectInfoInvitation'
    PublicationCompetitionLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseLot'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            oagCodes:
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
      required:
        - processType
        - procurementTopic
        - constructionCategory
        - additionalCpvCodes
        - oagCodes
        - bkpCodes
        - ebkphCodes
        - ebkptCodes
        - npkCodes
    PublicationOagCodes:
      type: object
      properties:
        oagCodes:
          type: array
          items:
            $ref: '#/components/schemas/OAGCode'
    PublicationCpvCode:
      type: object
      properties:
        cpvCode:
          allOf:
            - $ref: '#/components/schemas/CPVCode'
    PublicationCpcCode:
      type: object
      properties:
        cpcCode:
          allOf:
            - $ref: '#/components/schemas/CPCCode'
    PublicationProcurement:
      type: object
      description: |
        The general procurement of a publication with `lots` has only the `cpvCode`.
        The following fields are part of the individual lots:
        - `additionalCpvCodes`
        - `bkpCodes`
        - `ebkphCodes`
        - `ebkptCodes`
        - `npkCodes`
        - `oagCodes`
        - `procurementTopic`
        - `constructionCategory`
      allOf:
        - $ref: '#/components/schemas/PublicationBaseProcurement'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - $ref: '#/components/schemas/PublicationOagCodes'
        - $ref: '#/components/schemas/PublicationCpvCode'
        - $ref: '#/components/schemas/PublicationCpcCode'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
      required:
        - cpvCode
        - processType
    PublicationTermsExtendedOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTermsExtendedInterface'
        - $ref: '#/components/schemas/PubBaseTermsOpenSelective'
    PublicationTermsExtendedInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PublicationTermsExtended* models, used for code generation.
        Used for types study and competition.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseTerms'
        - $ref: '#/components/schemas/PublicationBaseTermsExtended'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTermsExtendedOpen'
          selective: '#/components/schemas/PublicationTermsExtendedSelective'
          invitation: '#/components/schemas/PublicationTermsExtendedInvitation'
      required:
        - processType
    PublicationTermsExtendedSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTermsExtendedInterface'
        - $ref: '#/components/schemas/PubBaseTermsOpenSelective'
    PublicationTermsExtendedInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTermsExtendedInterface'
    VatType:
      type: string
      enum:
        - no_vat
        - full
        - special
        - reduced
        - foreign_vat
    PriceWithVat:
      type: object
      allOf:
        - $ref: '#/components/schemas/Price'
        - type: object
          properties:
            vatType:
              $ref: '#/components/schemas/VatType'
    PubBaseTermsExtended:
      type: object
      properties:
        totalPrice:
          $ref: '#/components/schemas/PriceWithVat'
        totalPriceNote:
          $ref: '#/components/schemas/Translation'
        purchasesAllowed:
          allOf:
            - $ref: '#/components/schemas/ThreeValuedSelection'
          description: |
            - Needs to be `yes` or `no` in case of a call-for-bids pub-draft/publication
            - Can be `not_specified` in case of an advance-notice pub-draft/publication
        purchaseMaxShareOfTotalPrice:
          type: integer
        purchaseNote:
          $ref: '#/components/schemas/Translation'
        compensation:
          $ref: '#/components/schemas/Price'
        compensationNote:
          $ref: '#/components/schemas/Translation'
        independentExperts:
          $ref: '#/components/schemas/Translation'
        bindingJuryDecision:
          $ref: '#/components/schemas/Translation'
        anonymity:
          $ref: '#/components/schemas/Translation'
    PublicationBaseTermsExtended:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseTermsExtended'
      required:
        - purchasesAllowed
        - purchaseNote
        - compensationNote
        - independentExperts
        - bindingJuryDecision
        - anonymity
    PublicationTermsExtended:
      title: PublicationTermsExtended
      type: object
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process.

        Used for types study and competition.
      oneOf:
        - $ref: '#/components/schemas/PublicationTermsExtendedOpen'
        - $ref: '#/components/schemas/PublicationTermsExtendedSelective'
        - $ref: '#/components/schemas/PublicationTermsExtendedInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationTermsExtendedOpen'
          selective: '#/components/schemas/PublicationTermsExtendedSelective'
          invitation: '#/components/schemas/PublicationTermsExtendedInvitation'
    PublicationDatesOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDatesInterface'
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PublicationBaseDatesOpen'
    PublicationDatesInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PublicationDates* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseDatesAppointments'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationDatesOpen'
          selective: '#/components/schemas/PublicationDatesSelective'
          invitation: '#/components/schemas/PublicationDatesInvitation'
      required:
        - processType
    PublicationDatesSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDatesInterface'
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PublicationBaseDatesSelective'
    PublicationDatesInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDatesInterface'
        - $ref: '#/components/schemas/PublicationBaseDatesInvitation'
    PublicationDates:
      title: PublicationDates
      type: object
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PublicationDatesOpen'
        - $ref: '#/components/schemas/PublicationDatesSelective'
        - $ref: '#/components/schemas/PublicationDatesInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationDatesOpen'
          selective: '#/components/schemas/PublicationDatesSelective'
          invitation: '#/components/schemas/PublicationDatesInvitation'
    PublicationCriteriaOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationCriteriaInterface'
    PublicationCriteriaInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PublicationCriteria* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationBaseCriteria'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationCriteriaOpen'
          selective: '#/components/schemas/PublicationCriteriaSelective'
          invitation: '#/components/schemas/PublicationCriteriaInvitation'
      required:
        - processType
        - orderType
    PublicationCriteriaSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationCriteriaInterface'
        - $ref: '#/components/schemas/PublicationBaseCriteriaSelective'
    PublicationCriteriaInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationCriteriaInterface'
    PublicationCriteria:
      title: PublicationCriteria
      type: object
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PublicationCriteriaOpen'
        - $ref: '#/components/schemas/PublicationCriteriaSelective'
        - $ref: '#/components/schemas/PublicationCriteriaInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicationCriteriaOpen'
          selective: '#/components/schemas/PublicationCriteriaSelective'
          invitation: '#/components/schemas/PublicationCriteriaInvitation'
    PublicationCompetitionDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - $ref: '#/components/schemas/PublicationDetailBaseDescription'
        - $ref: '#/components/schemas/PublicationDetailWithCorrection'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - $ref: '#/components/schemas/DetailWithInvitedVendors'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PublicationProjectInfo'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PublicationCompetitionLot'
            procurement:
              $ref: '#/components/schemas/PublicationProcurement'
            terms:
              $ref: '#/components/schemas/PublicationTermsExtended'
            dates:
              $ref: '#/components/schemas/PublicationDates'
            criteria:
              $ref: '#/components/schemas/PublicationCriteria'
          required:
            - project-info
            - procurement
            - terms
            - dates
    PublicationStudyContractLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseLot'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            oagCodes:
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
      required:
        - processType
        - procurementTopic
        - constructionCategory
        - additionalCpvCodes
        - oagCodes
        - bkpCodes
        - ebkphCodes
        - ebkptCodes
        - npkCodes
    PublicationStudyContractDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - $ref: '#/components/schemas/PublicationDetailBaseDescription'
        - $ref: '#/components/schemas/PublicationDetailWithCorrection'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - $ref: '#/components/schemas/DetailWithInvitedVendors'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PublicationProjectInfo'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PublicationStudyContractLot'
            procurement:
              $ref: '#/components/schemas/PublicationProcurement'
            terms:
              $ref: '#/components/schemas/PublicationTermsExtended'
            dates:
              $ref: '#/components/schemas/PublicationDates'
            criteria:
              $ref: '#/components/schemas/PublicationCriteria'
          required:
            - project-info
            - procurement
            - terms
            - dates
    PublicationDetailWithLotReference:
      type: object
      properties:
        lot:
          allOf:
            - $ref: '#/components/schemas/PublicationLotDescription'
          description: |
            Lot information if this publication referred to a lot or null if the project was created without lots
    DetailWithPubReference:
      type: object
      allOf:
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
      required:
        - referencingPub
    ParticipantSelectionCommunication:
      type: string
      enum:
        - individual
        - simap
    PublicationAwardedVendorBase:
      type: object
      properties:
        vendorId:
          type: string
          format: uuid
        vendorName:
          type: string
          readOnly: true
        vendorAddress:
          $ref: '#/components/schemas/Address'
          readOnly: true
      required:
        - vendorId
        - vendorName
    PublicationParticipantSelectionQualifiedVendor:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardedVendorBase'
    PublicationParticipantSelectionInfo:
      type: object
      properties:
        participantSelectionLimitation:
          $ref: '#/components/schemas/ThreeValuedSelection'
        participantSelectionNote:
          $ref: '#/components/schemas/Translation'
        participantSelectionCommunication:
          $ref: '#/components/schemas/ParticipantSelectionCommunication'
        remediesNotice:
          $ref: '#/components/schemas/Translation'
        vendors:
          type: array
          items:
            $ref: '#/components/schemas/PublicationParticipantSelectionQualifiedVendor'
          description: |
            List of vendors which selected to be able to provide an offer for this publication
      required:
        - participantSelectionLimitation
        - participantSelectionCommunication
        - vendors
    PublicationParticipantSelectionDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - $ref: '#/components/schemas/PublicationDetailWithLotReference'
        - $ref: '#/components/schemas/DetailWithPubReference'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
            procurement:
              $ref: '#/components/schemas/PublicationDirectAwardProcurement'
            participant-selection:
              $ref: '#/components/schemas/PublicationParticipantSelectionInfo'
          required:
            - project-info
            - procurement
            - participant-selection
    PublicationSelectiveOfferingPhaseNotice:
      type: object
      properties:
        notice:
          $ref: '#/components/schemas/TranslationSanitizedHtml'
    PublicationBaseDates:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseDates'
      required:
        - qnas
        - otherAppointments
    PublicationSelectiveOfferingPhaseDates:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseDatesAppointments'
        - $ref: '#/components/schemas/PublicationBaseDates'
        - $ref: '#/components/schemas/PublicationBaseDatesOpen'
    PublicationSelectiveOfferingPhaseCriteria:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseAwardCriteria'
    PublicationSelectiveOfferingPhaseDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - $ref: '#/components/schemas/PublicationDetailWithLotReference'
        - $ref: '#/components/schemas/PublicationDetailWithCorrection'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
            notice:
              $ref: '#/components/schemas/PublicationSelectiveOfferingPhaseNotice'
            dates:
              $ref: '#/components/schemas/PublicationSelectiveOfferingPhaseDates'
            criteria:
              $ref: '#/components/schemas/PublicationSelectiveOfferingPhaseCriteria'
          required:
            - notice
            - dates
            - criteria
    PubLotProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftLotDescription'
        - $ref: '#/components/schemas/PubProcurementOrderDescription'
    PubRevocationDetail:
      type: object
      properties:
        procurement:
          $ref: '#/components/schemas/PubProcurementOrderDescription'
          description: |
            General order description information.
        lots:
          type: array
          items:
            $ref: '#/components/schemas/PubLotProcurement'
          description: |
            Lot specific procurement and lot information of the revoked publication. Only provided in case of projects
            with lotsType `with` and either an array of all lot infomrations of the revoked 
            publication (advance_mnotice) or an array of a single lot in case the publication references a specific lot (award, participant_selection).
      required:
        - procurement
        - lots
    PublicationTermsRemedies:
      type: object
      properties:
        remediesNotice:
          $ref: '#/components/schemas/Translation'
    PublicationRevocationInfo:
      type: object
      description: |
        Note that in the case the revokation is for a rfi, the `remediesNotice` fields are not used, in a rfi this information doesn't exist.
        For a patch, the fields are ignored in a rfi project.
      allOf:
        - $ref: '#/components/schemas/PublicationTermsRemedies'
        - type: object
          properties:
            publicationDate:
              type: string
              format: date
            reason:
              $ref: '#/components/schemas/Translation'
              description: |
                The reason why the publication was revoked
            remarks:
              $ref: '#/components/schemas/Translation'
              description: |
                Optional remarks for the revocation
          required:
            - publicationDate
            - reason
    PublicationRevocationDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - $ref: '#/components/schemas/DetailWithPubReference'
        - $ref: '#/components/schemas/PubRevocationDetail'
        - type: object
          properties:
            revocation:
              $ref: '#/components/schemas/PublicationRevocationInfo'
            project-info:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
          required:
            - revocation
            - revokedPub
            - project-info
    AbandonmentReason:
      type: string
      enum:
        - a_abandon_due_to_valid_reason
        - b_no_offer_fulfills_requirements
        - c_due_to_changed_framework_conditions
        - d_offers_do_not_allow_economical_procurement
        - e_unlawful_competition_agreements
        - f_due_to_changed_requirements
        - g_other
      description: |
        Abandonment reasons according to the swiss federal PPA law.

        Plus the additional `g_other` for custom or more detailed reasons that must be entered.  

        [Art. 43 Abandonment](https://www.fedlex.admin.ch/eli/cc/2020/126/de#art_43)
    PubAbandonmentInfo:
      type: object
      allOf:
        - type: object
          properties:
            publicationDate:
              type: string
              format: date
            reasons:
              type: array
              items:
                $ref: '#/components/schemas/AbandonmentReason'
              description: |
                The reason why the pub-draft/publication is abandoned.
                If the value for reason is `g_other` then the field `otherReason` has to contain additional text with details about the abandonment.
            otherReason:
              allOf:
                - $ref: '#/components/schemas/Translation'
              description: |
                Additional text detailing why the  pub-draft/publication is abandoned.
                This field is required when in the field `reason` the value `g_other` was selected.
            remarks:
              $ref: '#/components/schemas/Translation'
              description: |
                Optional remarks for the abandonment
    PublicationAbandonmentInfo:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationTermsRemedies'
        - $ref: '#/components/schemas/PubAbandonmentInfo'
      required:
        - publicationDate
        - reasons
    PublicationAbandonmentDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - type: object
          properties:
            abandonment:
              $ref: '#/components/schemas/PublicationAbandonmentInfo'
            abandonedLot:
              allOf:
                - $ref: '#/components/schemas/PublicationLotDescription'
              description: |
                The lot which was abandoned or null in case the whole project was abandoned which is always the case if
                the project was created without lots
            project-info:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
          required:
            - abandonment
            - project-info
    PublicationAdvanceNoticeDetailDiscriminator:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PublicationCompetitionDetail'
        - $ref: '#/components/schemas/PublicationStudyContractDetail'
        - $ref: '#/components/schemas/PublicationTenderDetail'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PublicationTenderDetail'
          competition: '#/components/schemas/PublicationCompetitionDetail'
          study_contract: '#/components/schemas/PublicationStudyContractDetail'
    PublicationRfiProjectInfo:
      type: object
      description: Model for the rfi project information
      allOf:
        - $ref: '#/components/schemas/PublicationBaseProjectInfo'
    PublicationRfiDates:
      type: object
      description: Model for the rfi dates
      allOf:
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PublicationBaseDatesAppointments'
    PublicationRfiProcurement:
      type: object
      description: Model for the rfi procurement information
      allOf:
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - $ref: '#/components/schemas/PublicationOagCodes'
        - $ref: '#/components/schemas/PublicationCpvCode'
        - $ref: '#/components/schemas/PublicationCpcCode'
        - $ref: '#/components/schemas/PubBaseProcurement'
        - type: object
          properties:
            orderAddress:
              $ref: '#/components/schemas/PubProcurementAddress'
      required:
        - cpvCode
        - orderDescription
        - orderAddressOnlyDescription
        - orderAddress
        - executionDeadlineType
    PublicationRfiTerms:
      type: object
      description: Model for the rfi terms
      allOf:
        - $ref: '#/components/schemas/PubBaseMinimalTerms'
    PublicationRfiDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationDetailInterface'
        - $ref: '#/components/schemas/PublicationDetailWithCorrection'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PublicationRfiProjectInfo'
            dates:
              $ref: '#/components/schemas/PublicationRfiDates'
            procurement:
              $ref: '#/components/schemas/PublicationRfiProcurement'
            terms:
              $ref: '#/components/schemas/PublicationRfiTerms'
          required:
            - project-info
            - dates
            - procurement
            - terms
    PublicationAwardBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardBaseInterface'
        - $ref: '#/components/schemas/PubAwardBase'
    PublicationAwardBaseInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/PubAwardBaseInterface'
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PublicationAwardBase'
          direct_award: '#/components/schemas/PublicationDirectAwardBase'
    PubDirectAwardBase:
      type: object
      allOf:
        - type: object
          properties:
            followupAward:
              type: boolean
              description: |
                True if the direct award was created as a followup of an existing award, is loosely coupled.
          required:
            - followupAward
    AllSubKinds:
      type: object
      properties:
        orderType:
          $ref: '#/components/schemas/PubOrderType'
          nullable: true
          description: |
            Only present for publications in `tender` or `direct_award` projects
        competitionType:
          $ref: '#/components/schemas/PubCompetitionType'
          nullable: true
          description: |
            Only present for publications in `competition` projects
        studyType:
          $ref: '#/components/schemas/PubStudyType'
          nullable: true
          description: |
            Only present for publications in `study_contract` projects
    PublicationDirectAwardBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardBaseInterface'
        - $ref: '#/components/schemas/PubDirectAwardBase'
        - $ref: '#/components/schemas/AllSubKinds'
    PublicationBaseInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubData'
        - type: object
          properties:
            publishers:
              type: array
              items:
                type: string
                format: uuid
              description: list of publishers this publication was published to.
          required:
            - publishers
      required:
        - publicationDate
        - procOfficeId
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PublicationAwardBase'
          tender: '#/components/schemas/PublicationTenderBase'
          competition: '#/components/schemas/PublicationCompetitionBase'
          study_contract: '#/components/schemas/PublicationStudyContractBase'
          direct_award: '#/components/schemas/PublicationDirectAwardBase'
          advance_notice: '#/components/schemas/PublicationAdvanceNoticeDiscriminator'
          request_for_information: '#/components/schemas/PublicationRfiBase'
          abandonment: '#/components/schemas/PublicationAbandonmentBase'
          revocation: '#/components/schemas/PublicationRevocationBase'
          participant_selection: '#/components/schemas/PublicationParticipantSelectionBase'
          selective_offering_phase: '#/components/schemas/PublicationSelectiveOfferingPhaseBase'
    PublicationLotLimitationData:
      type: object
      properties:
        participantLotsLimitation:
          type: integer
          description: |
            Indicator if there is a limitation for vendors, for how many lots in the project a vendor can make an offer. 

            Only used when the pub's `lotsType` is `with`.

            Set to `null` for no limitation.
        participantLotsLimitationNote:
          $ref: '#/components/schemas/Translation'
          description: |
            Only used when the pub's `lotsType` is `with`.
    PubCorrectionBase:
      type: object
      properties:
        corrected:
          type: boolean
          description: |
            True if this pub draft is a correction
        correctedPubId:
          type: string
          format: uuid
        initialPublicationDate:
          type: string
          format: date
          description: |
            The publication date of the initially published publication. If provided use this field to validate other fields against it.
      required:
        - corrected
    PublicationCorrectionBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubCorrectionBase'
    ReferencingPub:
      type: object
      properties:
        referencingPubId:
          type: string
          format: uuid
          description: |
            Reference to publication this follow-up publication was created for.
    PublicationTenderBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/PublicationLotLimitationData'
        - $ref: '#/components/schemas/PublicationCorrectionBase'
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/PublicationCpvCode'
        - type: object
          properties:
            orderType:
              $ref: '#/components/schemas/PubOrderType'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PublicationLotDescription'
            publicationTed:
              type: boolean
            cpcCode:
              allOf:
                - $ref: '#/components/schemas/CPCCode'
              description: |
                Only provided when the `orderType` is `service`, value is optional.
          required:
            - orderType
            - lots
            - publicationTed
      required:
        - cpvCode
    PublicationCompetitionBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/PublicationLotLimitationData'
        - $ref: '#/components/schemas/PublicationCorrectionBase'
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/PublicationCpvCode'
        - type: object
          properties:
            competitionType:
              $ref: '#/components/schemas/PubCompetitionType'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PublicationLotDescription'
          required:
            - competitionType
            - lots
      required:
        - cpvCode
    PublicationStudyContractBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/PublicationLotLimitationData'
        - $ref: '#/components/schemas/PublicationCorrectionBase'
        - $ref: '#/components/schemas/PublicationCpvCode'
        - $ref: '#/components/schemas/ReferencingPub'
        - type: object
          properties:
            studyType:
              $ref: '#/components/schemas/PubStudyType'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PublicationLotDescription'
          required:
            - studyType
            - lots
      required:
        - cpvCode
    PublicationAdvanceNoticeDiscriminator:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PublicationCompetitionBase'
        - $ref: '#/components/schemas/PublicationStudyContractBase'
        - $ref: '#/components/schemas/PublicationTenderBase'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PublicationTenderBase'
          competition: '#/components/schemas/PublicationCompetitionBase'
          study_contract: '#/components/schemas/PublicationStudyContractBase'
    PublicationRfiBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/PublicationCorrectionBase'
        - $ref: '#/components/schemas/PublicationCpvCode'
        - $ref: '#/components/schemas/PublicationCpcCode'
      required:
        - cpvCode
    ReferencingLot:
      type: object
      properties:
        referencingLotId:
          type: string
          format: uuid
          description: |
            If the referencing publication is with lots, then this is the id of the lot for which this follow-up publication was created for.
    PublicationAbandonmentBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/ReferencingLot'
        - type: object
          properties:
            publicationTed:
              type: boolean
      required:
        - publicationTed
        - referencingPubId
    PublicationRevocationBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/ReferencingPub'
        - type: object
          properties:
            publicationTed:
              type: boolean
      required:
        - publicationTed
        - referencingPubId
    PublicationParticipantSelectionBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/ReferencingLot'
      required:
        - referencingPubId
    PublicationSelectiveOfferingPhaseBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationBaseInterface'
        - $ref: '#/components/schemas/PublicationCorrectionBase'
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/ReferencingLot'
    TranslationType:
      type: string
      enum:
        - summary
        - complete
    TranslationLanguage:
      type: object
      properties:
        language:
          $ref: '#/components/schemas/SystemLanguage'
        type:
          $ref: '#/components/schemas/TranslationType'
      required:
        - language
        - type
    PubData:
      type: object
      properties:
        id:
          type: string
          format: uuid
        title:
          $ref: '#/components/schemas/Translation'
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        processType:
          $ref: '#/components/schemas/PubProcessType'
        lotsType:
          $ref: '#/components/schemas/PubLotsType'
        stateContractArea:
          type: boolean
        type:
          $ref: '#/components/schemas/PubType'
        publicationNumber:
          type: string
          example: 123-01
          description: |
            Unique publication number aka "Meldungsnummer".
        projectId:
          type: string
          format: uuid
        projectNumber:
          type: string
          example: '123'
        publicationDate:
          type: string
          format: date
        creationLanguage:
          $ref: '#/components/schemas/SystemLanguage'
        translationLanguages:
          type: array
          items:
            $ref: '#/components/schemas/TranslationLanguage'
          description: |
            the localization languages besides the `creationLanguage`
        procOfficeId:
          type: string
          format: uuid
      required:
        - id
        - title
        - projectType
        - processType
        - lotsType
        - stateContractArea
        - type
        - projectId
        - publicationNumber
        - creationLanguage
        - translationLanguages
    PubAwardBaseInterface:
      type: object
      description: |
        The type of award is defined by processType, projectType and pubType field value accordingly to:  
        | Type of award         | ProjectType                            | ProcessType                   | PublicationType |
        |------------------------------------------------------------------------------------------------------------------|
        | 'Freihändige Vergabe' | tender                                 | direct                        | direct_award    |
        | 'Direkter Zuschlag'   | tender, competition or study_constract | open, selective or invitation | direct_award    |
        | 'Zuschlag'            | tender, competition or study_constract | open, selective or invitation | award           |
      allOf:
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/ReferencingLot'
    PubAwardBase:
      type: object
      allOf:
        - type: object
          properties:
            publicationTed:
              type: boolean
              description: |
                Only `tender` publication can be sent to TED, can be true when `pub_type` of publication referred by `referencingPubId`? is `tender`
                else false
      required:
        - publicationTed
    PublicationBase:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PublicationAwardBase'
        - $ref: '#/components/schemas/PublicationTenderBase'
        - $ref: '#/components/schemas/PublicationCompetitionBase'
        - $ref: '#/components/schemas/PublicationStudyContractBase'
        - $ref: '#/components/schemas/PublicationDirectAwardBase'
        - $ref: '#/components/schemas/PublicationAdvanceNoticeDiscriminator'
        - $ref: '#/components/schemas/PublicationRfiBase'
        - $ref: '#/components/schemas/PublicationAbandonmentBase'
        - $ref: '#/components/schemas/PublicationRevocationBase'
        - $ref: '#/components/schemas/PublicationParticipantSelectionBase'
        - $ref: '#/components/schemas/PublicationSelectiveOfferingPhaseBase'
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PublicationAwardBase'
          tender: '#/components/schemas/PublicationTenderBase'
          competition: '#/components/schemas/PublicationCompetitionBase'
          study_contract: '#/components/schemas/PublicationStudyContractBase'
          direct_award: '#/components/schemas/PublicationDirectAwardBase'
          advance_notice: '#/components/schemas/PublicationAdvanceNoticeDiscriminator'
          request_for_information: '#/components/schemas/PublicationRfiBase'
          abandonment: '#/components/schemas/PublicationAbandonmentBase'
          revocation: '#/components/schemas/PublicationRevocationBase'
          participant_selection: '#/components/schemas/PublicationParticipantSelectionBase'
          selective_offering_phase: '#/components/schemas/PublicationSelectiveOfferingPhaseBase'
    PubTedStatus:
      type: string
      enum:
        - created
        - submitted
        - published
        - rejected
        - failed
    PubTedReference:
      type: object
      description: |
        Reference to the related TED(Tenders Electronic Daily) publication, used when the publication is sent to and published on TED.
      properties:
        status:
          $ref: '#/components/schemas/PubTedStatus'
        url:
          type: string
          format: url
          description: |
            Direct link to the publication on the TED plattform(https://ted.europa.eu), available once it was successfully published on TED.
      required:
        - status
    PublicationAwardProjectInfo:
      type: object
      allOf:
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
            stateContractArea:
              type: boolean
            publicationTed:
              type: boolean
              description: |
                Only `tender` publication can be sent to TED, can be true when `referencing_pub_type` is `tender`
                else false
        - $ref: '#/components/schemas/PubBaseProjectInfoAddress'
    TotalPriceSelection:
      type: string
      enum:
        - price_of_selected_offers
        - price_range_of_selected_offers
        - no_specification_according_to_ppa_law
    PriceInformation:
      type: object
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        vatType:
          $ref: '#/components/schemas/VatType'
    NumberRange:
      type: object
      properties:
        from:
          type: number
        to:
          type: number
    PriceRangeWithVat:
      type: object
      allOf:
        - $ref: '#/components/schemas/PriceInformation'
        - type: object
          properties:
            range:
              $ref: '#/components/schemas/NumberRange'
    PubAwardDecision:
      type: object
      properties:
        numberOfSubmissions:
          type: number
          description: |
            used in publications of type `award`.
            required value for awards of projectType `tender`.
        totalPriceSelection:
          $ref: '#/components/schemas/TotalPriceSelection'
          description: |
            Depending on the publication type, `award` or `direct_award`,
            the process type `open`, `direct`, `selective` or `invitation` and 
            project type `tender`, `competition` or `study_contract`, the selection is limited.
            Check the following table to see when which selections are valid:  

            | pubType         | processType                 |projectType                          | available selections                                                                            |
            |-----------------|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
            | award           | open, selective, invitation | tender                              | price_of_selected_offers, price_range_of_selected_offers, no_specification_according_to_ppa_law |
            | award           | open, selective, invitation | study_contract, competition         | price_of_selected_offers                                                                        |
            | award           | open, selective, invitation | direct_award                        | INVALID COMBINATION DOES NOT EXIST                                                              |
            | direct_award    | open, selective, invitation | tender                              | price_of_selected_offers, price_range_of_selected_offers, no_specification_according_to_ppa_law |
            | direct_award    | open, selective, invitation | study_contract, competition         | price_of_selected_offers                                                                        |
            | direct_award    | direct                      | tender, study_contract, competition | price_of_selected_offers, no_specification_according_to_ppa_law                                 |

            Also note, for `award` of project type `tender`, when the publication is sent to TED, only `price_of_selected_offers`
            is a valid choice, one must define a price for TED.
        totalPriceSelectionNote:
          $ref: '#/components/schemas/Translation'
          description: |
            Optional note for the selection.
        totalPriceRange:
          $ref: '#/components/schemas/PriceRangeWithVat'
          description: |
            Used when the `totalPriceSelection` is `price_range_of_selected_offers`
            else `null`
        awardDecisionDate:
          type: string
          format: date
        awardDecisionWithJustification:
          type: boolean
        awardDecisionJustification:
          $ref: '#/components/schemas/Translation'
        awardDecisionJuryDescription:
          $ref: '#/components/schemas/Translation'
        awardDecisionNote:
          $ref: '#/components/schemas/Translation'
      required:
        - awardDecisionWithJustification
    PublicationAwardVendorSubmission:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardedVendorBase'
        - type: object
          properties:
            price:
              $ref: '#/components/schemas/PriceWithVat'
            note:
              $ref: '#/components/schemas/Translation'
            rank:
              type: integer
    PublicationAwardDecision:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubAwardDecision'
        - type: object
          properties:
            remediesNotice:
              $ref: '#/components/schemas/Translation'
            vendors:
              type: array
              items:
                $ref: '#/components/schemas/PublicationAwardVendorSubmission'
              description: |
                List of vendors which have been awarded for this publication
          required:
            - vendors
    PublicationAwardTenderProcurementService:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardTenderProcurementInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            cpcCode:
              $ref: '#/components/schemas/CPCCode'
    PublicationAwardTenderProcurementInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PublicationAwardTenderProcurement* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PublicationAwardProcurementInterface'
      required:
        - orderType
      discriminator:
        propertyName: orderType
        mapping:
          service: '#/components/schemas/PublicationAwardTenderProcurementService'
          construction: '#/components/schemas/PublicationAwardTenderProcurementConstruction'
          supply: '#/components/schemas/PublicationAwardTenderProcurementSupply'
    PublicationAwardTenderProcurementConstruction:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardTenderProcurementInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            oagCodes:
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            cpcCode:
              $ref: '#/components/schemas/CPCCode'
            constructionType:
              $ref: '#/components/schemas/PubConstructionType'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
          required:
            - oagCodes
    PublicationAwardTenderProcurementSupply:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardTenderProcurementInterface'
        - type: object
          properties:
            additionalCpvCodes:
              type: array
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              $ref: '#/components/schemas/PubSupplyType'
          required:
            - additionalCpvCodes
    PublicationAwardProcurementInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubAwardProcurement'
        - type: object
          properties:
            externalReference:
              $ref: '#/components/schemas/PubAndLotReference'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PublicationAwardTenderProcurementInterface'
          competition: '#/components/schemas/PublicationAwardGeneralProcurement'
          study_contract: '#/components/schemas/PublicationAwardGeneralProcurement'
      required:
        - projectType
        - orderDescription
    PublicationAwardGeneralProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationAwardProcurementInterface'
        - $ref: '#/components/schemas/PublicationBaseCodes'
        - type: object
          properties:
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            oagCodes:
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
          required:
            - oagCodes
    PubAwardProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDirectAwardProcurement'
        - type: object
          properties:
            projectOrderDescription:
              $ref: '#/components/schemas/Translation'
              description: |
                The `projectOrderDescription` is only set when the project is `with` lots. 
                Else it's null.

                The field contains the general, for the whole project applicable order description. 
                It describes the project's order context, additionally each lot has their own `orderDescription`.
    PublicationAwardTenderProcurement:
      title: PublicationAwardTenderProcurement
      type: object
      oneOf:
        - $ref: '#/components/schemas/PublicationAwardTenderProcurementService'
        - $ref: '#/components/schemas/PublicationAwardTenderProcurementConstruction'
        - $ref: '#/components/schemas/PublicationAwardTenderProcurementSupply'
      discriminator:
        propertyName: orderType
        mapping:
          service: '#/components/schemas/PublicationAwardTenderProcurementService'
          construction: '#/components/schemas/PublicationAwardTenderProcurementConstruction'
          supply: '#/components/schemas/PublicationAwardTenderProcurementSupply'
    PublicationAwardProcurement:
      title: PublicationAwardProcurement
      type: object
      oneOf:
        - $ref: '#/components/schemas/PublicationAwardTenderProcurement'
        - $ref: '#/components/schemas/PublicationAwardGeneralProcurement'
        - $ref: '#/components/schemas/PublicationAwardGeneralProcurement'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PublicationAwardTenderProcurement'
          competition: '#/components/schemas/PublicationAwardGeneralProcurement'
          study_contract: '#/components/schemas/PublicationAwardGeneralProcurement'
    PublicationDetail:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PublicationTenderDetail'
        - $ref: '#/components/schemas/PublicationCompetitionDetail'
        - $ref: '#/components/schemas/PublicationStudyContractDetail'
        - $ref: '#/components/schemas/PublicationAwardDetail'
        - $ref: '#/components/schemas/PublicationDirectAwardDetail'
        - $ref: '#/components/schemas/PublicationParticipantSelectionDetail'
        - $ref: '#/components/schemas/PublicationSelectiveOfferingPhaseDetail'
        - $ref: '#/components/schemas/PublicationRevocationDetail'
        - $ref: '#/components/schemas/PublicationAbandonmentDetail'
        - $ref: '#/components/schemas/PublicationAdvanceNoticeDetailDiscriminator'
        - $ref: '#/components/schemas/PublicationRfiDetail'
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PublicationAwardDetail'
          direct_award: '#/components/schemas/PublicationDirectAwardDetail'
          tender: '#/components/schemas/PublicationTenderDetail'
          competition: '#/components/schemas/PublicationCompetitionDetail'
          study_contract: '#/components/schemas/PublicationStudyContractDetail'
          participant_selection: '#/components/schemas/PublicationParticipantSelectionDetail'
          selective_offering_phase: '#/components/schemas/PublicationSelectiveOfferingPhaseDetail'
          revocation: '#/components/schemas/PublicationRevocationDetail'
          abandonment: '#/components/schemas/PublicationAbandonmentDetail'
          advance_notice: '#/components/schemas/PublicationAdvanceNoticeDetailDiscriminator'
          request_for_information: '#/components/schemas/PublicationRfiDetail'
    PublicProjectHeaderDatesAdditionalDefault:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicProjectHeaderDatesAdditionalInterface'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesBase'
        - type: object
          properties:
            qnas:
              type: array
              items:
                $ref: '#/components/schemas/PublicationQna'
              description: |
                QNA round dates. 
                Only available if vendor of logged in user is eligible to see qna rounds or the user belongs to a procurement_office.
            offerDeadline:
              type: string
              format: date-time
              description: |
                Can be `null` when the only publication in the project is of type `advanced_notice` as there the value is optional.
            offerOpening:
              $ref: '#/components/schemas/DateOptionalTime'
              description: |
                Offer opening datetime. Only available for projects with projectType `tender`.
    PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase:
      type: object
      description: |
        additional dates relevant for publications in the selective process which have additional dates except for 
        selective_offering_phase which uses the default additional dates.
      allOf:
        - $ref: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveInterface'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesBase'
        - type: object
          properties:
            qnas:
              type: array
              items:
                $ref: '#/components/schemas/PublicationQna'
              description: |
                QNA round dates. 
                Only available if vendor of logged in user showed interest in the project or the user belongs to a procurement_office.
            participationRequestDeadline:
              type: string
              format: date-time
              description: |
                Contains the date until which vendors can submit requests to participate at the offer.

                Can be `null` when the only publication in the project is of type `advanced_notice` as there the value is optional.
            participationRequestOpening:
              $ref: '#/components/schemas/DateOptionalTime'
            offerSubmissionDeadline:
              $ref: '#/components/schemas/DateOptionalTime'
    PublicProjectHeaderDatesAdditionalInterface:
      type: object
      description: Helper used for code generation, see PublicProjectHeaderDatesAdditional for the actual definition
      allOf:
        - $ref: '#/components/schemas/PublicProjectHeaderDatesInterface'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
          required:
            - processType
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
          selective: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelective'
          invitation: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
          no_process: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
    PublicProjectHeaderDatesAdditionalSelectiveInterface:
      type: object
      description: Helper used for code generation, see PublicProjectHeaderDatesAdditionalSelective for the actual definition
      allOf:
        - $ref: '#/components/schemas/PublicProjectHeaderDatesAdditionalInterface'
      discriminator:
        propertyName: pubType
        mapping:
          advance_notice: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
          tender: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
          competition: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
          study_contract: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
          selective_offering_phase: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
    PublicProjectHeaderDatesAdditionalSelective:
      type: object
      description: |
        Header dates model for publications in the selective process are again split into two categories based on their 
        `pubType`. Not all pub-types are listed here because some do not have additional header date properties
        (see PublicProjectHeaderDates).
      oneOf:
        - $ref: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
      discriminator:
        propertyName: pubType
        mapping:
          advance_notice: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
          tender: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
          competition: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
          study_contract: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelectiveNotOfferingPhase'
          selective_offering_phase: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
    PublicProjectHeaderDatesAdditional:
      type: object
      description: |
        Header dates for publications which have additional date properties (see PublicProjectHeaderDates) are split
        again into two categories, this time based on their `processType`.
      oneOf:
        - $ref: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelective'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
          selective: '#/components/schemas/PublicProjectHeaderDatesAdditionalSelective'
          invitation: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
          no_process: '#/components/schemas/PublicProjectHeaderDatesAdditionalDefault'
    PublicProjectHeaderDatesInterface:
      type: object
      properties:
        pubType:
          $ref: '#/components/schemas/PubType'
      required:
        - pubType
      discriminator:
        propertyName: pubType
        mapping:
          advance_notice: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          tender: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          competition: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          study_contract: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          selective_offering_phase: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          request_for_information: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          abandonment: '#/components/schemas/PublicProjectHeaderDatesDefault'
          direct_award: '#/components/schemas/PublicProjectHeaderDatesDefault'
          award: '#/components/schemas/PublicProjectHeaderDatesDefault'
          revocation: '#/components/schemas/PublicProjectHeaderDatesDefault'
          participant_selection: '#/components/schemas/PublicProjectHeaderDatesDefault'
    PublicProjectHeaderDatesDefault:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicProjectHeaderDatesInterface'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesBase'
    PublicProjectHeaderDates:
      type: object
      description: |
        Different header date models are used for publications discriminated by several properties, starting with its 
        `pubType`  because for some additional dates are provided.
      oneOf:
        - $ref: '#/components/schemas/PublicProjectHeaderDatesDefault'
        - $ref: '#/components/schemas/PublicProjectHeaderDatesAdditional'
      discriminator:
        propertyName: pubType
        mapping:
          advance_notice: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          tender: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          competition: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          study_contract: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          selective_offering_phase: '#/components/schemas/PublicProjectHeaderDatesAdditional'
          request_for_information: '#/components/schemas/PublicProjectHeaderDatesDefault'
          abandonment: '#/components/schemas/PublicProjectHeaderDatesDefault'
          direct_award: '#/components/schemas/PublicProjectHeaderDatesDefault'
          award: '#/components/schemas/PublicProjectHeaderDatesDefault'
          revocation: '#/components/schemas/PublicProjectHeaderDatesDefault'
          participant_selection: '#/components/schemas/PublicProjectHeaderDatesDefault'
    PublicProjectHeaderPublication:
      type: object
      allOf:
        - $ref: '#/components/schemas/BasePublicationData'
        - type: object
          properties:
            id:
              type: string
              format: uuid
            title:
              $ref: '#/components/schemas/Translation'
            dates:
              $ref: '#/components/schemas/PublicProjectHeaderDates'
            hasProjectDocuments:
              type: boolean
              description: Hint if this publication has project documents attached to it.
          required:
            - id
            - dates
            - hasProjectDocuments
    VendorDigitalSubmissionStatus:
      type: string
      enum:
        - draft
        - submitted
    PublicProjectHeaderVendorDigitalSubmissionInfo:
      type: object
      properties:
        id:
          type: string
          format: uuid
        submissionType:
          $ref: '#/components/schemas/VendorDigitalSubmissionType'
        submissionStatus:
          $ref: '#/components/schemas/VendorDigitalSubmissionStatus'
        hasDocuments:
          type: boolean
          description: |
            If `true` the submission contains at least one document, can be submitted.
             
            If `false` the submission contains no documents, is empty. Can not be submitted.
      required:
        - id
        - submissionType
        - submissionStatus
        - hasDocuments
    PublicProjectHeaderLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PublicationLotDescription'
        - type: object
          properties:
            latestPublication:
              $ref: '#/components/schemas/PublicProjectHeaderPublication'
              description: latest publication within this lot.
            latestVendorDigitalSubmission:
              $ref: '#/components/schemas/PublicProjectHeaderVendorDigitalSubmissionInfo'
              description: |
                reference to the latest digital submission of the current vendor created in this project and relevant to the current lot.
                Only provided if the current user is assigned to a vendor and the vendor has created a submission in this project.
          required:
            - latestPublication
    ProjectInvitedOrInterestedVendorStatus:
      type: string
      description: |
        - This enum consists of status in enum `ProjectInterestStatus` plus the corresponding equivalent in processType invitation
      enum:
        - invited
        - invitation_declined
        - interest_shown
        - interest_withdrawn
    PublicProjectOtherActionType:
      type: string
      enum:
        - share
      description: |
        ## share
        copy a share-link of the current project, implemented in the frontend only
    VendorPrimaryProjectActionType:
      type: string
      enum:
        - show_interest
        - create_digital_offer
        - create_digital_participation_request
        - create_digital_rfi_response
        - submit_digital_submission
      description: |
        ## show_interest
        A vendor-user can show interest in projects if:
            - the process-type is "open" or "selective"
            - the project is not closed
            - the offer-deadline and interest-deadline have not yet been reached
            - the vendor is active

        ## create_digital_offer
        A vendor-user can create an offer for a project with process-type "open", "invitation" or 
        during the offering phase of "selective" process.

        ## create_digital_participation_request
        A vendor-user can create a participation request for the first phase of a project in the selective process. 

        ## create_digital_rfi_response
        A vendor-user can create a response to an RFI-project.

        ## submit_digital_submission
        Any of the digital offers, participation requests or RFI-responses must be submitted to participate in the project.

        ## common for offer-actions
        An offer can only be created, when:
            - the project is not closed
            - the offer-deadline has not yet been reached
            - the vendor is active and has shown interest in the project
    VendorSecondaryProjectActionType:
      type: string
      enum:
        - withdraw_interest
        - edit_digital_submission
        - decline_invitation
      description: |
        ## Following actions are available:
        - `withdraw_interest`       A vendor-user can withdraw previously shown interest in a project.
        - `edit_digital_submission` Edit a not yet submitted digital vendor submission
        - `decline_invitation`      Decline an invitation to a project from a procurement office
    PublicProjectActionType:
      type: string
      enum:
        - pdf_export
        - delete_digital_submission
      description: |
        - `pdf_export`                Create a PDF export of the selected project, implemented in the frontend only.
        - `delete_digital_submission` Delete a not yet submitted vendor digital submission
    VendorPubActions:
      type: object
      description: |
        Model with primary, secondary and other actions for a data driven navigation on public projects
      properties:
        primary:
          description: Holds the primary actions available for authenticated vendor-user
          $ref: '#/components/schemas/VendorPrimaryProjectActionType'
          nullable: true
          readOnly: true
        secondary:
          description: Holds the secondary actions available for authenticated vendor-user
          $ref: '#/components/schemas/VendorSecondaryProjectActionType'
          nullable: true
          readOnly: true
        other:
          type: array
          description: Contains the actions available for the public on level publication
          readOnly: true
          items:
            $ref: '#/components/schemas/PublicProjectActionType'
      required:
        - other
    PublicProjectActions:
      type: object
      properties:
        projectOther:
          type: array
          description: Contains the actions available for the public on level project
          readOnly: true
          items:
            $ref: '#/components/schemas/PublicProjectOtherActionType'
        withoutLots:
          $ref: '#/components/schemas/VendorPubActions'
          description: |
            Only defined if the project is without lots
          nullable: true
        lots:
          type: object
          description: |
            Only defined if the project is with lots where the property names are the lot ids
          additionalProperties:
            $ref: '#/components/schemas/VendorPubActions'
          nullable: true
      required:
        - other
        - projectOther
    PublicProjectHeader:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseProjectData'
        - type: object
          properties:
            lots:
              type: array
              description: Lots information of this project. Only provided if project was created with lotsType 'with'
              items:
                $ref: '#/components/schemas/PublicProjectHeaderLot'
            latestPublication:
              $ref: '#/components/schemas/PublicProjectHeaderPublication'
              description: latest publication. Only provided if project was created with lotsType 'without'
            latestVendorDigitalSubmission:
              $ref: '#/components/schemas/PublicProjectHeaderVendorDigitalSubmissionInfo'
              description: |
                reference to the latest digital submission of the current vendor created in this project.
                Only provided if project was created with lotsType 'without' and the current user is assigned to a vendor 
                which has created a digital submission in this project.
            vendorStatus:
              $ref: '#/components/schemas/ProjectInvitedOrInterestedVendorStatus'
            actions:
              $ref: '#/components/schemas/PublicProjectActions'
      required:
        - actions
    PastPublicationsEntry:
      type: object
      description: Past Publication Entry
      allOf:
        - $ref: '#/components/schemas/BasePublicationData'
        - type: object
          properties:
            id:
              type: string
              format: uuid
            publicationDate:
              type: string
              format: date
            lotNumber:
              type: integer
          required:
            - id
            - publicationDate
    PastPublications:
      type: object
      description: Past publications
      properties:
        pastPublications:
          type: array
          items:
            $ref: '#/components/schemas/PastPublicationsEntry'
      required:
        - pastPublications
    NotificationFrequency:
      type: string
      enum:
        - daily
        - weekly
    SubscriptionFilters:
      type: object
      properties:
        search:
          type: string
          pattern: (^$)|.{3,1000}
          description: |
            Search input, either empty or requires between 3 and 1000 valid characters.
        projectSubTypes:
          description: |
            quick-filter: if defined then publications need to be one of the given types
          type: array
          default: []
          items:
            $ref: '#/components/schemas/ProjectSubType'
        issuedByOrganizations:
          description: |
            quick-filter: if defined then publications need to be issued by one of the selected organizations or as a children of the selected organizations
            (procurement-offices, institution or competence centre).
          type: array
          default: []
          items:
            type: string
            format: uuid
        lang:
          description: |
            quick-filter: defines in which languages shall be searched in case of translated fields. In case this property is not defined or an empty array is given, then we search in all languages
          type: array
          default: []
          items:
            $ref: '#/components/schemas/SystemLanguage'
        processTypes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided projects processTypes
          type: array
          default: []
          items:
            $ref: '#/components/schemas/PubProcessType'
        newestPubTypes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided pubTypeFilter values matching newest publication.
          type: array
          default: []
          items:
            $ref: '#/components/schemas/ProjectSearchPubTypeFilter'
        cpvCodes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided CPV codes defined in any publications
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
          type: array
          default: []
          items:
            $ref: '#/components/schemas/CPVCode'
        cpcCodes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided CPC codes defined in any publications
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
          type: array
          default: []
          items:
            $ref: '#/components/schemas/CPCCode'
        bkpCodes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided BKP codes defined in any publications
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapBkpCodeValidation'
          type: array
          default: []
          items:
            $ref: '#/components/schemas/BKPCode'
        ebkphCodes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided eBKP-h codes defined in any publications
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapEbkphCodeValidation'
          type: array
          default: []
          items:
            $ref: '#/components/schemas/EBKPHCode'
        ebkptCodes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided eBKP-t codes defined in any publications
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapEbkptCodeValidation'
          type: array
          default: []
          items:
            $ref: '#/components/schemas/EBKPTCode'
        npkCodes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided NPK codes defined in any publications
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapNpkCodeValidation'
          type: array
          default: []
          items:
            $ref: '#/components/schemas/NPKCode'
        oagCodes:
          description: |
            extended-filter: if defined, projects are filtered by one of the provided OAG codes defined in any publications
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
          type: array
          default: []
          items:
            $ref: '#/components/schemas/OAGCode'
        orderAddressCountryOnlySwitzerland:
          description: |
            Filter for projects that take place in Switzerland. 

            If `true` will only return projects where the country of the `orderAddress` is `CH` - Switzerland.
            If `false` or omitted will apply no filter return all projects (swiss projects included).

            Specifically if the country in one of the defined `orderAddress`es is Switzerland.
            If a project is `with` lots, a project is found if at least one of the lot order addresses contains Switzerland.

            Not every publication defines a `orderAddress`. Projects with only such publications will be ignored with this filter.
          type: boolean
          default: false
        orderAddressCantons:
          description: |
            List of two letter abbreviation of a swiss canton e.g. `BE,FR,VD`.

            Filter for projects that take place in one of the specified cantons in Switzerland.

            Returns the projects where the canton of one of the defined `orderAddress`es is in the given list.  
            If a project is `with` lots, a project is found if at least one of the lot order addresses contain one of the defined cantons.

            Not every publication defines a `orderAddress` and a proc office can describe a `orderAddress` in a unstructured way, only as a description.
            Projects with only such publications will be ignored with this filter.
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.CantonCodeValidation'
          type: array
          default: []
          items:
            type: string
            format: canton
    SubscriptionUpdate:
      type: object
      properties:
        name:
          type: string
        notificationFrequency:
          $ref: '#/components/schemas/NotificationFrequency'
        filters:
          $ref: '#/components/schemas/SubscriptionFilters'
      required:
        - name
        - notificationFrequency
        - filters
    Subscription:
      type: object
      allOf:
        - $ref: '#/components/schemas/SubscriptionUpdate'
        - type: object
          properties:
            id:
              type: string
              format: uuid
          required:
            - id
    Subscriptions:
      type: object
      properties:
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/Subscription'
    PubDraftAwardBaseInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PubDraftDirectAwardBase and PubDraftAwardBase
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseInterface'
        - $ref: '#/components/schemas/PubAwardBaseInterface'
        - $ref: '#/components/schemas/AllSubKinds'
        - type: object
          properties:
            sustainabilityFormTypes:
              readOnly: true
              type: array
              items:
                $ref: '#/components/schemas/SustainabilityFormType'
              description: |
                Sustainability forms, the procurement office can choose from in an award publication.
                Currently supported is either [nh01] or [nh02, nh03, nh04, nh05] or null if no sustainability keyfigures are required.
      discriminator:
        propertyName: type
        mapping:
          direct_award: '#/components/schemas/PubDraftDirectAwardBase'
          award: '#/components/schemas/PubDraftAwardBase'
    PubDraftDirectAwardBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardBaseInterface'
        - $ref: '#/components/schemas/PubDirectAwardBase'
    PubDraftAwardBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardBaseInterface'
        - $ref: '#/components/schemas/PubAwardBase'
    PubDraftTenderBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftCallForBidsBaseInterface'
        - $ref: '#/components/schemas/PubDraftLotLimitationData'
        - $ref: '#/components/schemas/ReferencingPub'
        - type: object
          properties:
            orderType:
              $ref: '#/components/schemas/PubOrderType'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftLotDescription'
            publicationTed:
              type: boolean
            cpvCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPVCode'
            cpcCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPCCode'
              description: |
                Only in use when the `orderType` is `service` and when in use is an optional value.
          required:
            - orderType
            - lots
    PubDraftCallForBidsBaseInterface:
      type: object
      description: |
        Interface / parent of a generic call-for-bids pub-draft base
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseInterface'
        - $ref: '#/components/schemas/PubDraftCorrectionBase'
      discriminator:
        propertyName: type
        mapping:
          tender: '#/components/schemas/PubDraftTenderBase'
          competition: '#/components/schemas/PubDraftCompetitionBase'
          study_contract: '#/components/schemas/PubDraftStudyContractBase'
    PubDraftLotLimitationData:
      type: object
      properties:
        participantLotsLimitation:
          type: integer
          description: |
            Indicator if there is a limitation for vendors, for how many lots in the project a vendor can make an offer. 

            Only used when the pub's `lotsType` is `with`.

            Set `null` for no limitation.
        participantLotsLimitationNote:
          $ref: '#/components/schemas/Translation'
          description: |
            Only used when the pub's `lotsType` is `with`.
    PubDraftCompetitionBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftCallForBidsBaseInterface'
        - $ref: '#/components/schemas/PubDraftLotLimitationData'
        - $ref: '#/components/schemas/ReferencingPub'
        - type: object
          properties:
            competitionType:
              $ref: '#/components/schemas/PubCompetitionType'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftLotDescription'
            cpvCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPVCode'
          required:
            - competitionType
    PubDraftStudyContractBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftCallForBidsBaseInterface'
        - $ref: '#/components/schemas/PubDraftLotLimitationData'
        - $ref: '#/components/schemas/ReferencingPub'
        - type: object
          properties:
            studyType:
              $ref: '#/components/schemas/PubStudyType'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftLotDescription'
            cpvCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPVCode'
          required:
            - studyType
    PubDraftBaseInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftData'
        - type: object
          properties:
            status:
              $ref: '#/components/schemas/PubDraftStatus'
            editorialDeadline:
              type: string
              format: date-time
              description: The editorial deadline for the selected publication date, the pub draft must be submitted before this date and time.
            submissionDate:
              type: string
              format: date-time
              description: The date and time when the pub draft was submitted for publication
            publishers:
              type: array
              items:
                type: string
                format: uuid
              description: list of publishers this pub-draft will get or was published to.
          required:
            - status
            - publishers
      discriminator:
        propertyName: type
        mapping:
          tender: '#/components/schemas/PubDraftTenderBase'
          competition: '#/components/schemas/PubDraftCompetitionBase'
          study_contract: '#/components/schemas/PubDraftStudyContractBase'
          direct_award: '#/components/schemas/PubDraftDirectAwardBase'
          award: '#/components/schemas/PubDraftAwardBase'
          advance_notice: '#/components/schemas/PubDraftAdvanceNoticeDiscriminator'
          request_for_information: '#/components/schemas/PubDraftRfiBase'
          abandonment: '#/components/schemas/PubDraftAbandonmentBase'
          revocation: '#/components/schemas/PubDraftRevocationBase'
          participant_selection: '#/components/schemas/PubDraftParticipantSelectionBase'
          selective_offering_phase: '#/components/schemas/PubDraftSelectiveOfferingPhaseBase'
    PubDraftCorrectionBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubCorrectionBase'
    PubDraftAdvanceNoticeDiscriminator:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PubDraftCompetitionBase'
        - $ref: '#/components/schemas/PubDraftStudyContractBase'
        - $ref: '#/components/schemas/PubDraftTenderBase'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PubDraftTenderBase'
          competition: '#/components/schemas/PubDraftCompetitionBase'
          study_contract: '#/components/schemas/PubDraftStudyContractBase'
    PubDraftCpcCode:
      type: object
      description: cpc code model that includes the validation annotation for the patching
      properties:
        cpcCode:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
          allOf:
            - $ref: '#/components/schemas/CPCCode'
    PubDraftCpvCode:
      type: object
      description: cpv code model that includes the validation annotation for the patching
      properties:
        cpvCode:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
          allOf:
            - $ref: '#/components/schemas/CPVCode'
    PubDraftRfiBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseInterface'
        - $ref: '#/components/schemas/PubDraftCorrectionBase'
        - $ref: '#/components/schemas/PubDraftCpcCode'
        - $ref: '#/components/schemas/PubDraftCpvCode'
    PubDraftAbandonmentBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseInterface'
        - $ref: '#/components/schemas/AllSubKinds'
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/ReferencingLot'
        - type: object
          properties:
            publicationTed:
              type: boolean
          required:
            - referencingPubId
    PubDraftRevocationBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseInterface'
        - $ref: '#/components/schemas/AllSubKinds'
        - $ref: '#/components/schemas/ReferencingPub'
        - type: object
          properties:
            publicationTed:
              type: boolean
            revokedPubPublished:
              type: boolean
              description: |
                False if revoked publication was not published (on simap). This is the case for:
                  * participant_selection with individual communication
      required:
        - publicationTed
        - referencingPubId
        - revokedPubPublished
    PubDraftParticipantSelectionBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseInterface'
        - $ref: '#/components/schemas/AllSubKinds'
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/ReferencingLot'
      required:
        - referencingPubId
    PubDraftSelectiveOfferingPhaseBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseInterface'
        - $ref: '#/components/schemas/PubDraftCorrectionBase'
        - $ref: '#/components/schemas/AllSubKinds'
        - $ref: '#/components/schemas/ReferencingPub'
        - $ref: '#/components/schemas/ReferencingLot'
        - type: object
          properties:
            participantSelectionPublished:
              type: boolean
              description: |
                True if pub_draft of participant_selection was published on simap
      required:
        - referencingPubId
    PubDraftData:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubData'
        - type: object
          properties:
            internalReference:
              type: string
            isTemplate:
              type: boolean
              description: True if this pub-draft is a template
            competenceCentreId:
              type: string
              format: uuid
              description: Reference to competence centre. Only valid if 'template' is set to true and mutual exclusive to 'procOfficeId'.
      required:
        - status
        - isTemplate
    PubDraftBase:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PubDraftAwardBase'
        - $ref: '#/components/schemas/PubDraftTenderBase'
        - $ref: '#/components/schemas/PubDraftCompetitionBase'
        - $ref: '#/components/schemas/PubDraftStudyContractBase'
        - $ref: '#/components/schemas/PubDraftDirectAwardBase'
        - $ref: '#/components/schemas/PubDraftAdvanceNoticeDiscriminator'
        - $ref: '#/components/schemas/PubDraftRfiBase'
        - $ref: '#/components/schemas/PubDraftAbandonmentBase'
        - $ref: '#/components/schemas/PubDraftRevocationBase'
        - $ref: '#/components/schemas/PubDraftParticipantSelectionBase'
        - $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseBase'
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PubDraftAwardBase'
          tender: '#/components/schemas/PubDraftTenderBase'
          competition: '#/components/schemas/PubDraftCompetitionBase'
          study_contract: '#/components/schemas/PubDraftStudyContractBase'
          direct_award: '#/components/schemas/PubDraftDirectAwardBase'
          advance_notice: '#/components/schemas/PubDraftAdvanceNoticeDiscriminator'
          request_for_information: '#/components/schemas/PubDraftRfiBase'
          abandonment: '#/components/schemas/PubDraftAbandonmentBase'
          revocation: '#/components/schemas/PubDraftRevocationBase'
          participant_selection: '#/components/schemas/PubDraftParticipantSelectionBase'
          selective_offering_phase: '#/components/schemas/PubDraftSelectiveOfferingPhaseBase'
    PubDraftCreationRequest:
      type: object
      properties:
        title:
          $ref: '#/components/schemas/Translation'
          description: Only optional if `type` is `award`
        type:
          $ref: '#/components/schemas/PubType'
        processType:
          $ref: '#/components/schemas/PubProcessType'
        orderType:
          $ref: '#/components/schemas/PubOrderType'
          description: |
            required if `processType` is `tender`
        studyType:
          $ref: '#/components/schemas/PubStudyType'
          description: |
            required if `processType` is `study_contract`
        competitionType:
          $ref: '#/components/schemas/PubCompetitionType'
          description: |
            required if `processType` is `competition`
        directAward:
          type: boolean
          description: |
            required if `type` is `tender`, `study_contract` and `competition`
        lotsType:
          $ref: '#/components/schemas/PubLotsType'
          description: |
            required if `type` is `tender`, `study_contract`, `competition` and `advance_notice`
        creationLanguage:
          $ref: '#/components/schemas/SystemLanguage'
          description: Only optional if `type` is `award`
        internalReference:
          type: string
          maxLength: 70
          description: |
            Internal dossier reference, reference of the project for the proc office. 
            The reference is not available in the published publications.

            Can be set when creating a new project / a new initial publication.

            To update the reference for an existing project use: 

            `PATCH /api/procoffices/v1/my/projects/{projectId}/internal-reference`
        referencingPubId:
          type: string
          format: uuid
          description: |
            Required if `type` is `award`
        referencingLotId:
          type: string
          format: uuid
          description: |
            Required if `type` is `award`. Only for publication / project with lots.
        correction:
          type: boolean
          description: |
            True if a correction of a pub-draft should be created.
        isTemplate:
          type: boolean
          description: |
            True if the pub_draft should get created as a template. Be aware that when creating a pub-drat as a template, certain constraints apply as:
              - the pub-draft cannot reference another pub or lot
              - the pub-draft cannot be marked as correction
        createFromTemplateProjectId:
          type: string
          format: uuid
          description: |
            Project id of the template project which should be used to copy and create a new initial publication and project. If provided, all other parameter are ignored.
    PubDraftCopyRequest:
      type: object
      properties:
        copyFrom:
          type: string
          format: uuid
      required:
        - copyFrom
    PubDraftAwardDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardDetailInterface'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - type: object
          properties:
            procurement:
              $ref: '#/components/schemas/PubDraftAwardProcurement'
          required:
            - procurement
    PubDraftAwardDetailInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - $ref: '#/components/schemas/PubDraftDetailWithLotReference'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubDraftAwardProjectInfo'
            decision:
              $ref: '#/components/schemas/PubDraftAwardDecisionDetail'
            statistics:
              $ref: '#/components/schemas/PubDraftAwardStatistics'
          required:
            - project-info
            - decision
            - statistics
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PubDraftAwardDetail'
          direct_award: '#/components/schemas/PubDraftDirectAwardDetail'
    PubDraftDirectAwardTenderProcurementService:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDirectAwardTenderProcurementInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            cpcCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPCCode'
    PubDraftDirectAwardTenderProcurementInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PubDraftDirectAwardTenderProcurement* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftDirectAwardProcurementInterface'
      required:
        - orderType
      discriminator:
        propertyName: orderType
        mapping:
          service: '#/components/schemas/PubDraftDirectAwardTenderProcurementService'
          construction: '#/components/schemas/PubDraftDirectAwardTenderProcurementConstruction'
          supply: '#/components/schemas/PubDraftDirectAwardTenderProcurementSupply'
    PubDraftBaseCodes:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseCodes'
    PubDraftDirectAwardTenderProcurementConstruction:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDirectAwardTenderProcurementInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            oagCodes:
              type: array
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
              items:
                $ref: '#/components/schemas/OAGCode'
            cpcCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPCCode'
            constructionType:
              $ref: '#/components/schemas/PubConstructionType'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
    PubDraftDirectAwardTenderProcurementSupply:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDirectAwardTenderProcurementInterface'
        - type: object
          properties:
            additionalCpvCodes:
              type: array
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              $ref: '#/components/schemas/PubSupplyType'
    PubDraftDirectAwardTenderProcurement:
      type: object
      description: |
        Uses the `orderType` to discriminate between the models for of the construction, supply or service type for the tender procurement pub draft.
      oneOf:
        - $ref: '#/components/schemas/PubDraftDirectAwardTenderProcurementService'
        - $ref: '#/components/schemas/PubDraftDirectAwardTenderProcurementConstruction'
        - $ref: '#/components/schemas/PubDraftDirectAwardTenderProcurementSupply'
      discriminator:
        propertyName: orderType
        mapping:
          service: '#/components/schemas/PubDraftDirectAwardTenderProcurementService'
          construction: '#/components/schemas/PubDraftDirectAwardTenderProcurementConstruction'
          supply: '#/components/schemas/PubDraftDirectAwardTenderProcurementSupply'
    PubDraftDirectAwardProcurementInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDirectAwardProcurement'
        - type: object
          properties:
            externalReference:
              $ref: '#/components/schemas/PubAndLotReference'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PubDraftDirectAwardTenderProcurement'
          competition: '#/components/schemas/PubDraftDirectAwardGeneralProcurement'
          study_contract: '#/components/schemas/PubDraftDirectAwardGeneralProcurement'
    PubDraftDirectAwardGeneralProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDirectAwardProcurementInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            oagCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
    PubDraftDirectAwardProcurement:
      type: object
      description: |
        Use the project type to discriminate between the models.
      oneOf:
        - $ref: '#/components/schemas/PubDraftDirectAwardGeneralProcurement'
        - $ref: '#/components/schemas/PubDraftDirectAwardTenderProcurement'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PubDraftDirectAwardTenderProcurement'
          competition: '#/components/schemas/PubDraftDirectAwardGeneralProcurement'
          study_contract: '#/components/schemas/PubDraftDirectAwardGeneralProcurement'
    PubDraftDirectAwardDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardDetailInterface'
        - type: object
          properties:
            procurement:
              $ref: '#/components/schemas/PubDraftDirectAwardProcurement'
          required:
            - procurement
    PubDraftDetailInterface:
      type: object
      description: Interface / parent that is implemented by the  PubDraft*Detail models, used for code generation.
      properties:
        id:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/PubType'
        projectType:
          $ref: '#/components/schemas/PubProjectType'
        base:
          $ref: '#/components/schemas/PubDraftBase'
        ted:
          $ref: '#/components/schemas/PubTedReference'
          description: |
            Reference to the TED publication, set when the publication is published on TED.
            For a publication that is sent, until the submission process is started the property is `null`.
            The submission process is started after the publication is published.
        publishers:
          type: array
          description: List of publishers of this publication
          items:
            $ref: '#/components/schemas/PublisherReference'
      required:
        - id
        - type
        - projectType
        - detail
        - publishers
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PubDraftAwardDetail'
          direct_award: '#/components/schemas/PubDraftDirectAwardDetail'
          tender: '#/components/schemas/PubDraftTenderDetail'
          competition: '#/components/schemas/PubDraftCompetitionDetail'
          study_contract: '#/components/schemas/PubDraftStudyContractDetail'
          participant_selection: '#/components/schemas/PubDraftParticipantSelectionDetail'
          selective_offering_phase: '#/components/schemas/PubDraftSelectiveOfferingPhaseDetail'
          revocation: '#/components/schemas/PubDraftRevocationDetail'
          abandonment: '#/components/schemas/PubDraftAbandonmentDetail'
          advance_notice: '#/components/schemas/PubDraftAdvanceNoticeDetailDiscriminator'
          request_for_information: '#/components/schemas/PubDraftRfiDetail'
    PubDraftDetailBaseDescription:
      type: object
      description: |
        Full Publication detail for tender, study_contract or competition publication drafts. All details consist of the 
        following structure:
          - project-info
          - lots
          - procurement
          - terms
          - dates
          - criteria

        Where `lots` is only provided if `lotsType` of the publication draft is set to `with` and `criteria` is only provided in case of 
        `lotsType` set to `without`. All other sections are provided but depend on `pubType`,  `processType` and `lotsType` of the publication draft.
    PubDraftCorrectionDetailData:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubCorrectionDetailData'
      required:
        - initialPublicationDate
    PubDraftDetailWithCorrection:
      type: object
      properties:
        correction:
          $ref: '#/components/schemas/PubDraftCorrectionDetailData'
    PubDraftTenderProjectInfoOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderProjectInfoInterface'
        - $ref: '#/components/schemas/PubBaseProjectInfoOpen'
        - type: object
          properties:
            publicationTed:
              type: boolean
    PubDraftTenderProjectInfoInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PubDraftTenderProjectInfo* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubBaseProjectInfo'
        - $ref: '#/components/schemas/PubBaseProjectInfoPublicationLanguageProperties'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            orderType:
              $ref: '#/components/schemas/PubOrderType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTenderProjectInfoOpen'
          selective: '#/components/schemas/PubDraftTenderProjectInfoSelective'
          invitation: '#/components/schemas/PubDraftTenderProjectInfoInvitation'
      required:
        - processType
        - orderType
    PubDraftTenderProjectInfoSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderProjectInfoInterface'
        - $ref: '#/components/schemas/PubBaseProjectInfoSelective'
        - type: object
          properties:
            publicationTed:
              type: boolean
    PubDraftTenderProjectInfoInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderProjectInfoInterface'
    PubBaseProjectInfoOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseProjectInfoOpenSelectiveBase'
    PubDraftTenderProjectInfo:
      title: PubDraftTenderProjectInfo
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process for the tender project info pub draft.
      oneOf:
        - $ref: '#/components/schemas/PubDraftTenderProjectInfoOpen'
        - $ref: '#/components/schemas/PubDraftTenderProjectInfoSelective'
        - $ref: '#/components/schemas/PubDraftTenderProjectInfoInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTenderProjectInfoOpen'
          selective: '#/components/schemas/PubDraftTenderProjectInfoSelective'
          invitation: '#/components/schemas/PubDraftTenderProjectInfoInvitation'
    PubDraftTenderConstructionLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderLotInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - $ref: '#/components/schemas/PubTenderConstructionFields'
    PubDraftTenderLotInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PubDraftTenderLot* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseLot'
        - $ref: '#/components/schemas/PubTenderSpecificProcurementFields'
      discriminator:
        propertyName: orderType
        mapping:
          construction: '#/components/schemas/PubDraftTenderConstructionLot'
          supply: '#/components/schemas/PubDraftTenderSupplyLot'
          service: '#/components/schemas/PubDraftTenderServiceLot'
    PubDraftTenderSupplyLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderLotInterface'
        - type: object
          properties:
            additionalCpvCodes:
              type: array
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              $ref: '#/components/schemas/PubSupplyType'
    PubDraftTenderServiceLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderLotInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
    PubDraftBaseProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseProcurement'
        - $ref: '#/components/schemas/PubBaseProcurementVariantsAndPartialOfferProperties'
        - type: object
          properties:
            orderAddress:
              $ref: '#/components/schemas/PubProcurementAddress'
    PubDraftQualificationCriterion:
      type: object
      allOf:
        - $ref: '#/components/schemas/Criterion'
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
      required:
        - title
    PubDraftBaseQualificationCriteria:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseQualificationCriteria'
        - type: object
          properties:
            qualificationCriteria:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftQualificationCriterion'
    PubDraftAwardCriterion:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftQualificationCriterion'
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
            weighting:
              type: integer
              description: |
                The wight of the criterion in percent
            maxPoints:
              type: integer
            isPriceCriterion:
              type: boolean
              description: |
                ONE criterion of the `awardCriteria` can be the criterion for the price.

                This is optional, there can be no price criterion for a publication. 

                By default, false.
      required:
        - title
    PubDraftBaseAwardCriteria:
      type: object
      properties:
        awardCriteriaSelection:
          $ref: '#/components/schemas/AwardCriteriaSelection'
          default: criteria_defined
        awardCriteriaNote:
          $ref: '#/components/schemas/Translation'
        awardCriteria:
          type: array
          items:
            $ref: '#/components/schemas/PubDraftAwardCriterion'
      required:
        - awardCriteriaSelection
        - awardCriteria
    PubDraftBaseCriteria:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseQualificationCriteria'
        - $ref: '#/components/schemas/PubDraftBaseAwardCriteria'
    PubDraftWeightedQualificationCriterion:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftQualificationCriterion'
        - type: object
          properties:
            weighting:
              type: integer
              description: |
                The weight of the criterion in percent
            maxPoints:
              type: integer
    PubDraftBaseCriteriaSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseCriteriaSelective'
        - type: object
          properties:
            weightedQualificationCriteria:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftWeightedQualificationCriterion'
    PubDraftBaseLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftLotDescription'
        - $ref: '#/components/schemas/PubDraftBaseProcurement'
        - $ref: '#/components/schemas/PubDraftBaseCriteria'
        - $ref: '#/components/schemas/PubDraftBaseCriteriaSelective'
        - type: object
          properties:
            canLotTypeBeChanged:
              type: boolean
              readOnly: true
              description: |
                Flag that indicates if a lot type can change. 

                Currently this functionality is only supported for tender lots in the `open` and selective `process`.
                For all other cases with lots the returned value will be `false`.
    PubDraftTenderLot:
      type: object
      description: |
        Uses the `orderType` to discriminate between the models of the service, supply or construction type.
      oneOf:
        - $ref: '#/components/schemas/PubDraftTenderConstructionLot'
        - $ref: '#/components/schemas/PubDraftTenderSupplyLot'
        - $ref: '#/components/schemas/PubDraftTenderServiceLot'
      discriminator:
        propertyName: orderType
        mapping:
          construction: '#/components/schemas/PubDraftTenderConstructionLot'
          supply: '#/components/schemas/PubDraftTenderSupplyLot'
          service: '#/components/schemas/PubDraftTenderServiceLot'
    PubDraftTenderProcurementConstruction:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderProcurementInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - $ref: '#/components/schemas/PubTenderConstructionFields'
        - type: object
          properties:
            cpcCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPCCode'
    PubDraftTenderProcurementInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PubDraftTenderProcurement* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseProcurement'
        - $ref: '#/components/schemas/PubTenderSpecificProcurementFields'
        - type: object
          properties:
            cpvCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPVCode'
      discriminator:
        propertyName: orderType
        mapping:
          construction: '#/components/schemas/PubDraftTenderProcurementConstruction'
          supply: '#/components/schemas/PubDraftTenderProcurementSupply'
          service: '#/components/schemas/PubDraftTenderProcurementService'
    PubDraftTenderProcurementSupply:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderProcurementInterface'
        - type: object
          properties:
            additionalCpvCodes:
              type: array
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              $ref: '#/components/schemas/PubSupplyType'
    PubDraftTenderProcurementService:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderProcurementInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            cpcCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPCCode'
    PubDraftTenderProcurement:
      title: PubDraftTenderProcurement
      description: |
        Uses the `orderType` to discriminate between the models for of the construction, supply or service type for the tender procurement pub draft.

        When the project is of lotsType `with`, when the pub draft is with lots, 
        this model and the respective endpoint is for the general procurement data.

        Only the following fields are used, can be patched. The others are ignored and must be set on the individual lot.  
        - `cpvCode`
        - `cpcCode`
        - `orderDescription`
      oneOf:
        - $ref: '#/components/schemas/PubDraftTenderProcurementConstruction'
        - $ref: '#/components/schemas/PubDraftTenderProcurementSupply'
        - $ref: '#/components/schemas/PubDraftTenderProcurementService'
      discriminator:
        propertyName: orderType
        mapping:
          construction: '#/components/schemas/PubDraftTenderProcurementConstruction'
          supply: '#/components/schemas/PubDraftTenderProcurementSupply'
          service: '#/components/schemas/PubDraftTenderProcurementService'
    PubDraftTenderTermsOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderTermsInterface'
        - $ref: '#/components/schemas/PubBaseTermsOpenSelective'
        - $ref: '#/components/schemas/PubBaseTermsWalkthrough'
    PubDraftTenderTermsInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PubDraftTenderTerms* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseTerms'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            orderType:
              $ref: '#/components/schemas/PubOrderType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTenderTermsOpen'
          selective: '#/components/schemas/PubDraftTenderTermsSelective'
          invitation: '#/components/schemas/PubDraftTenderTermsInvitation'
      required:
        - processType
        - orderType
    PubDraftTenderTermsSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderTermsInterface'
        - $ref: '#/components/schemas/PubBaseTermsOpenSelective'
        - $ref: '#/components/schemas/PubBaseTermsWalkthrough'
    PubDraftTenderTermsInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderTermsInterface'
        - $ref: '#/components/schemas/PubBaseTermsWalkthrough'
    PubDraftTermsRemedies:
      type: object
      properties:
        remediesNotice:
          $ref: '#/components/schemas/Translation'
    PubDraftTermsRemediesChanged:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsRemedies'
        - type: object
          properties:
            hasRemediesNoticeChanged:
              type: boolean
              readOnly: true
              description: |
                This flag indicates that the remedies notice on the publication differs from the 
                current remedies notice template of the same publication type and state contract area in 
                associated competence centre.
    PubDraftBaseTerms:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsRemediesChanged'
        - $ref: '#/components/schemas/PubBaseTerms'
    PubDraftTenderTerms:
      title: PubDraftTenderTerms
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process for the tender terms pub draft.
      oneOf:
        - $ref: '#/components/schemas/PubDraftTenderTermsOpen'
        - $ref: '#/components/schemas/PubDraftTenderTermsSelective'
        - $ref: '#/components/schemas/PubDraftTenderTermsInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTenderTermsOpen'
          selective: '#/components/schemas/PubDraftTenderTermsSelective'
          invitation: '#/components/schemas/PubDraftTenderTermsInvitation'
    PubDraftTenderDatesOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderDatesInterface'
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PubBaseDatesOpen'
        - $ref: '#/components/schemas/PubTenderDatesOpen'
    PubDraftTenderDatesInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PubDraftTenderDates* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseDatesAppointments'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            orderType:
              $ref: '#/components/schemas/PubOrderType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTenderDatesOpen'
          selective: '#/components/schemas/PubDraftTenderDatesSelective'
          invitation: '#/components/schemas/PubDraftTenderDatesInvitation'
      required:
        - processType
        - orderType
    PubDraftTenderDatesSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderDatesInterface'
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PubBaseDatesSelective'
    PubDraftTenderDatesInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderDatesInterface'
        - $ref: '#/components/schemas/PubTenderDates'
        - $ref: '#/components/schemas/PubBaseDatesInvitation'
    PubDraftQna:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubBaseQna'
        - type: object
          properties:
            qnaRoundEndDate:
              type: string
              format: date
              readOnly: true
              nullable: true
              description: |
                Specified in case this pub-draft is a correction of a call-for-bids, null otherwise.
                In case of a correction, it denotes the date before the correction already associated to a qna round (i.e. can also be the same as `date` in case it was not modified).
            isEditable:
              type: boolean
              description: |
                True if this qna round is still editable. Only true if qna round is not attached to an already published and closed qna round.
            isRemovable:
              type: boolean
              description: |
                True if the qna round can still get removed from the publication. Only true if this qna round doesn't reference an already 
                published qna round.
    PubDraftAppointment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          $ref: '#/components/schemas/Translation'
        date:
          type: string
          format: date
        note:
          $ref: '#/components/schemas/Translation'
      required:
        - id
    PubDraftBaseDatesAppointments:
      type: object
      properties:
        qnas:
          type: array
          items:
            $ref: '#/components/schemas/PubDraftQna'
        otherAppointments:
          type: array
          items:
            $ref: '#/components/schemas/PubDraftAppointment'
      required:
        - qnas
        - otherAppointments
    PubDraftTenderDates:
      title: PubDraftTenderDates
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process for the tender dates pub draft.
      oneOf:
        - $ref: '#/components/schemas/PubDraftTenderDatesOpen'
        - $ref: '#/components/schemas/PubDraftTenderDatesSelective'
        - $ref: '#/components/schemas/PubDraftTenderDatesInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTenderDatesOpen'
          selective: '#/components/schemas/PubDraftTenderDatesSelective'
          invitation: '#/components/schemas/PubDraftTenderDatesInvitation'
    PubDraftTenderCriteriaOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderCriteriaInterface'
    PubDraftTenderCriteriaInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PubDraftTenderCriteria* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseCriteria'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            orderType:
              $ref: '#/components/schemas/PubOrderType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTenderCriteriaOpen'
          selective: '#/components/schemas/PubDraftTenderCriteriaSelective'
          invitation: '#/components/schemas/PubDraftTenderCriteriaInvitation'
      required:
        - processType
        - orderType
    PubDraftTenderCriteriaSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderCriteriaInterface'
        - $ref: '#/components/schemas/PubDraftBaseCriteriaSelective'
    PubDraftTenderCriteriaInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTenderCriteriaInterface'
    PubDraftTenderCriteria:
      title: PubDraftTenderCriteria
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process for the tender criteria pub draft.
      oneOf:
        - $ref: '#/components/schemas/PubDraftTenderCriteriaOpen'
        - $ref: '#/components/schemas/PubDraftTenderCriteriaSelective'
        - $ref: '#/components/schemas/PubDraftTenderCriteriaInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTenderCriteriaOpen'
          selective: '#/components/schemas/PubDraftTenderCriteriaSelective'
          invitation: '#/components/schemas/PubDraftTenderCriteriaInvitation'
    PubDraftTenderDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - $ref: '#/components/schemas/PubDraftDetailBaseDescription'
        - $ref: '#/components/schemas/PubDraftDetailWithCorrection'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - $ref: '#/components/schemas/DetailWithInvitedVendors'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubDraftTenderProjectInfo'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftTenderLot'
            procurement:
              $ref: '#/components/schemas/PubDraftTenderProcurement'
            terms:
              $ref: '#/components/schemas/PubDraftTenderTerms'
            dates:
              $ref: '#/components/schemas/PubDraftTenderDates'
            criteria:
              $ref: '#/components/schemas/PubDraftTenderCriteria'
          required:
            - project-info
            - procurement
            - terms
            - dates
    PubDraftProjectInfoOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftProjectInfoInterface'
        - $ref: '#/components/schemas/PubBaseProjectInfoOpen'
    PubDraftProjectInfoInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PubProjectInfo* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubBaseProjectInfo'
        - $ref: '#/components/schemas/PubBaseProjectInfoPublicationLanguageProperties'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftProjectInfoOpen'
          selective: '#/components/schemas/PubDraftProjectInfoSelective'
          invitation: '#/components/schemas/PubDraftProjectInfoInvitation'
      required:
        - processType
    PubDraftProjectInfoSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftProjectInfoInterface'
        - $ref: '#/components/schemas/PubBaseProjectInfoSelective'
    PubDraftProjectInfoInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftProjectInfoInterface'
    PubDraftProjectInfo:
      description: |
        Use the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PubDraftProjectInfoOpen'
        - $ref: '#/components/schemas/PubDraftProjectInfoSelective'
        - $ref: '#/components/schemas/PubDraftProjectInfoInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftProjectInfoOpen'
          selective: '#/components/schemas/PubDraftProjectInfoSelective'
          invitation: '#/components/schemas/PubDraftProjectInfoInvitation'
    PubDraftCompetitionLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseLot'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            oagCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
      required:
        - processType
        - procurementTopic
        - constructionCategory
    PubDraftOagCodes:
      type: object
      description: oag codes model that includes the validation annotation for the patching
      properties:
        oagCodes:
          x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
          type: array
          items:
            $ref: '#/components/schemas/OAGCode'
    PubDraftProcurement:
      type: object
      description: |
        When the project is of lotsType `with`, when the pub draft is with lots, 
        this model and the respective endpoint is for the general procurement data.

        Only the following fields are used, can be patched. The others are ignored and must be set on the individual lot.  
        - `cpvCode`
        - `orderDescription`
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseProcurement'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - $ref: '#/components/schemas/PubDraftOagCodes'
        - $ref: '#/components/schemas/PubDraftCpvCode'
        - $ref: '#/components/schemas/PubDraftCpcCode'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
          required:
            - processType
    PubDraftTermsExtendedOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsExtendedInterface'
        - $ref: '#/components/schemas/PubBaseTermsOpenSelective'
    PubDraftTermsExtendedInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PubDraftTermsExtended* models, used for code generation.
        Used for types study and competition.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseTerms'
        - $ref: '#/components/schemas/PubBaseTermsExtended'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTermsExtendedOpen'
          selective: '#/components/schemas/PubDraftTermsExtendedSelective'
          invitation: '#/components/schemas/PubDraftTermsExtendedInvitation'
      required:
        - processType
    PubDraftTermsExtendedSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsExtendedInterface'
        - $ref: '#/components/schemas/PubBaseTermsOpenSelective'
    PubDraftTermsExtendedInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsExtendedInterface'
    PubDraftTermsExtended:
      title: PubDraftTerms
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation
        process for the terms pub draft if the draft is a study or competition.
      oneOf:
        - $ref: '#/components/schemas/PubDraftTermsExtendedOpen'
        - $ref: '#/components/schemas/PubDraftTermsExtendedSelective'
        - $ref: '#/components/schemas/PubDraftTermsExtendedInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftTermsExtendedOpen'
          selective: '#/components/schemas/PubDraftTermsExtendedSelective'
          invitation: '#/components/schemas/PubDraftTermsExtendedInvitation'
    PubDraftDatesOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDatesInterface'
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PubBaseDatesOpen'
    PubDraftDatesInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PubDraftDates* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseDatesAppointments'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftDatesOpen'
          selective: '#/components/schemas/PubDraftDatesSelective'
          invitation: '#/components/schemas/PubDraftDatesInvitation'
      required:
        - processType
    PubDraftDatesSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDatesInterface'
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PubBaseDatesSelective'
    PubDraftDatesInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDatesInterface'
        - $ref: '#/components/schemas/PubBaseDatesInvitation'
    PubDraftDates:
      description: |
        Use the `processType` to discriminate between the models of the open, selective or invitation process.
      oneOf:
        - $ref: '#/components/schemas/PubDraftDatesOpen'
        - $ref: '#/components/schemas/PubDraftDatesSelective'
        - $ref: '#/components/schemas/PubDraftDatesInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftDatesOpen'
          selective: '#/components/schemas/PubDraftDatesSelective'
          invitation: '#/components/schemas/PubDraftDatesInvitation'
    PubDraftCriteriaOpen:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftCriteriaInterface'
    PubDraftCriteriaInterface:
      type: object
      description: |
        Interface / parent that is implemented by the  PubDraftCriteria* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseCriteria'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftCriteriaOpen'
          selective: '#/components/schemas/PubDraftCriteriaSelective'
          invitation: '#/components/schemas/PubDraftCriteriaInvitation'
      required:
        - processType
        - orderType
    PubDraftCriteriaSelective:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftCriteriaInterface'
        - $ref: '#/components/schemas/PubDraftBaseCriteriaSelective'
    PubDraftCriteriaInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftCriteriaInterface'
    PubDraftCriteria:
      title: PubDraftCriteria
      description: |
        Uses the `processType` to discriminate between the models of the open, selective or invitation process for the tender criteria pub draft.
      oneOf:
        - $ref: '#/components/schemas/PubDraftCriteriaOpen'
        - $ref: '#/components/schemas/PubDraftCriteriaSelective'
        - $ref: '#/components/schemas/PubDraftCriteriaInvitation'
      discriminator:
        propertyName: processType
        mapping:
          open: '#/components/schemas/PubDraftCriteriaOpen'
          selective: '#/components/schemas/PubDraftCriteriaSelective'
          invitation: '#/components/schemas/PubDraftCriteriaInvitation'
    PubDraftCompetitionDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - $ref: '#/components/schemas/PubDraftDetailBaseDescription'
        - $ref: '#/components/schemas/PubDraftDetailWithCorrection'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - $ref: '#/components/schemas/DetailWithInvitedVendors'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubDraftProjectInfo'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftCompetitionLot'
            procurement:
              $ref: '#/components/schemas/PubDraftProcurement'
            terms:
              $ref: '#/components/schemas/PubDraftTermsExtended'
            dates:
              $ref: '#/components/schemas/PubDraftDates'
            criteria:
              $ref: '#/components/schemas/PubDraftCriteria'
          required:
            - project-info
            - procurement
            - terms
            - dates
    PubDraftStudyContractLot:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseLot'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            processType:
              $ref: '#/components/schemas/PubProcessType'
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            oagCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
      required:
        - processType
        - procurementTopic
        - constructionCategory
    PubDraftStudyContractDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - $ref: '#/components/schemas/PubDraftDetailBaseDescription'
        - $ref: '#/components/schemas/PubDraftDetailWithCorrection'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - $ref: '#/components/schemas/DetailWithInvitedVendors'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubDraftProjectInfo'
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftStudyContractLot'
            procurement:
              $ref: '#/components/schemas/PubDraftProcurement'
            terms:
              $ref: '#/components/schemas/PubDraftTermsExtended'
            dates:
              $ref: '#/components/schemas/PubDraftDates'
            criteria:
              $ref: '#/components/schemas/PubDraftCriteria'
          required:
            - project-info
            - procurement
            - terms
            - dates
    PubDraftDetailWithLotReference:
      type: object
      properties:
        lot:
          allOf:
            - $ref: '#/components/schemas/PubDraftLotDescription'
          description: |
            Lot information if this pub-draft referred to a lot or null if the project was created without lots
    PubDraftAwardedVendor:
      type: object
      properties:
        vendorId:
          type: string
          format: uuid
        vendorName:
          type: string
          readOnly: true
        vendorAddress:
          $ref: '#/components/schemas/Address'
          readOnly: true
      required:
        - vendorId
        - vendorName
    PubDraftParticipantSelectionQualifiedVendor:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardedVendor'
        - type: object
          properties:
            awarded:
              type: boolean
              description: |
                True if vendor was qualified for the second phase of the selective process
          required:
            - awarded
    PubDraftParticipantSelectionInfo:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsRemediesChanged'
        - type: object
          properties:
            participantSelectionLimitation:
              $ref: '#/components/schemas/ThreeValuedSelection'
            participantSelectionNote:
              $ref: '#/components/schemas/Translation'
            participantSelectionCommunication:
              $ref: '#/components/schemas/ParticipantSelectionCommunication'
            vendors:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftParticipantSelectionQualifiedVendor'
              description: |
                List of vendors which submitted an offer or have been awarded for this publication
            publicationDate:
              type: string
              format: date
          required:
            - participantSelectionLimitation
            - participantSelectionCommunication
            - vendors
    PubDraftParticipantSelectionDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - $ref: '#/components/schemas/PubDraftDetailWithLotReference'
        - $ref: '#/components/schemas/DetailWithPubReference'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
            procurement:
              $ref: '#/components/schemas/PubDraftDirectAwardProcurement'
            participant-selection:
              $ref: '#/components/schemas/PubDraftParticipantSelectionInfo'
          required:
            - project-info
            - procurement
            - participant-selection
    PubDraftSelectiveOfferingPhaseNotice:
      type: object
      properties:
        notice:
          $ref: '#/components/schemas/TranslationSanitizedHtml'
    PubDraftSelectiveOfferingPhaseDates:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseDatesAppointments'
        - $ref: '#/components/schemas/PubBaseDates'
        - $ref: '#/components/schemas/PubBaseDatesOpen'
    PubDraftSelectiveOfferingPhaseCriteria:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseAwardCriteria'
    PubDraftSelectiveOfferingPhaseDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - $ref: '#/components/schemas/PubDraftDetailWithLotReference'
        - $ref: '#/components/schemas/PubDraftDetailWithCorrection'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
            notice:
              $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseNotice'
            dates:
              $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseDates'
            criteria:
              $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseCriteria'
          required:
            - project-info
            - notice
            - dates
            - criteria
    PubDraftRevocationInfo:
      type: object
      description: |
        Note that in the case the revokation is for a rfi, the `remediesNotice` fields are not used, in a rfi this information doesn't exist.
        For a patch, the fields are ignored in a rfi project.
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsRemediesChanged'
        - type: object
          properties:
            publicationDate:
              type: string
              format: date
            reason:
              $ref: '#/components/schemas/Translation'
              description: |
                The reason why the publication is revoked
            remarks:
              $ref: '#/components/schemas/Translation'
              description: |
                Optional remarks for the revocation
    PubDraftRevocationDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - $ref: '#/components/schemas/DetailWithPubReference'
        - $ref: '#/components/schemas/PubRevocationDetail'
        - type: object
          properties:
            revocation:
              $ref: '#/components/schemas/PubDraftRevocationInfo'
            project-info:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
            procurement:
              $ref: '#/components/schemas/PubProcurementOrderDescription'
              description: |
                General order description information.
            lots:
              type: array
              items:
                $ref: '#/components/schemas/PubLotProcurement'
              description: |
                Lot specific procurement and lot information of the revoked publication. Only provided in case of projects
                with lotsType `with` and either an array of all lot information of the revoked 
                publication (advance_notice) or an array of a single lot in case the publication references a specific lot (award, participant_selection).
          required:
            - revocation
            - revokedPub
            - project-info
    PubDraftAbandonmentInfo:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsRemediesChanged'
        - $ref: '#/components/schemas/PubAbandonmentInfo'
    PubDraftAbandonmentDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - type: object
          properties:
            abandonment:
              $ref: '#/components/schemas/PubDraftAbandonmentInfo'
            abandonedLot:
              allOf:
                - $ref: '#/components/schemas/PubDraftLotDescription'
              description: |
                The lot which was abandoned or null in case the whole project was abandoned which is always the case if
                the project was created without lots
            project-info:
              $ref: '#/components/schemas/PubBaseProjectInfoAddress'
          required:
            - abandonment
            - project-info
    PubDraftAdvanceNoticeDetailDiscriminator:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PubDraftCompetitionDetail'
        - $ref: '#/components/schemas/PubDraftStudyContractDetail'
        - $ref: '#/components/schemas/PubDraftTenderDetail'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PubDraftTenderDetail'
          competition: '#/components/schemas/PubDraftCompetitionDetail'
          study_contract: '#/components/schemas/PubDraftStudyContractDetail'
    PubDraftRfiProjectInfo:
      type: object
      description: Model for the rfi project information
      allOf:
        - $ref: '#/components/schemas/PubBaseProjectInfo'
    PubDraftRfiDates:
      type: object
      description: Model for the rfi dates
      allOf:
        - $ref: '#/components/schemas/PubBaseCallForBidsDates'
        - $ref: '#/components/schemas/PubDraftBaseDatesAppointments'
    PubDraftRfiProcurement:
      type: object
      description: Model for the rfi procurement information
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - $ref: '#/components/schemas/PubDraftOagCodes'
        - $ref: '#/components/schemas/PubDraftCpvCode'
        - $ref: '#/components/schemas/PubDraftCpcCode'
        - $ref: '#/components/schemas/PubBaseProcurement'
        - type: object
          properties:
            orderAddress:
              $ref: '#/components/schemas/PubProcurementAddress'
    PubDraftRfiTerms:
      type: object
      description: Model for the rfi terms
      allOf:
        - $ref: '#/components/schemas/PubBaseMinimalTerms'
    PubDraftRfiDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftDetailInterface'
        - $ref: '#/components/schemas/DetailWithOptionalPubReference'
        - $ref: '#/components/schemas/PubDraftDetailWithCorrection'
        - type: object
          properties:
            project-info:
              $ref: '#/components/schemas/PubDraftRfiProjectInfo'
            dates:
              $ref: '#/components/schemas/PubDraftRfiDates'
            procurement:
              $ref: '#/components/schemas/PubDraftRfiProcurement'
            terms:
              $ref: '#/components/schemas/PubDraftRfiTerms'
          required:
            - project-info
            - dates
            - procurement
            - terms
    PubDraftAwardProjectInfo:
      type: object
      allOf:
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
            stateContractArea:
              type: boolean
            publicationTed:
              type: boolean
              description: |
                Only `tender` publication can be sent to TED, can be true when `referencing_pub_type` is `tender`
                else false
        - $ref: '#/components/schemas/PubBaseProjectInfoAddress'
    PubDraftAwardDecisionExport:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftTermsRemedies'
        - $ref: '#/components/schemas/PubAwardDecision'
    PubDraftStatisticsAwardedVendor:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubVendorWithAddressData'
        - type: object
          properties:
            price:
              $ref: '#/components/schemas/PriceWithVat'
    PubDraftAwardVendorSubmission:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftStatisticsAwardedVendor'
        - type: object
          properties:
            note:
              $ref: '#/components/schemas/Translation'
            rank:
              type: integer
            awarded:
              type: boolean
              description: |
                True if vendor was awarded for this publication.
          required:
            - awarded
    PubDraftAwardDecisionDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardDecisionExport'
        - type: object
          properties:
            vendors:
              type: array
              items:
                $ref: '#/components/schemas/PubDraftAwardVendorSubmission'
          required:
            - vendors
    JustificationDirectAward:
      type: string
      description: |
        Values map to:
        https://www.fedlex.admin.ch/eli/cc/1996/609_609_609/de#art_XII_I 
      enum:
        - a1_no_offer
        - a2_no_offer_fulfilled_entry_conditions
        - a3_no_vendor_fulfilled_entry_conditions
        - a4_offers_coordinated_same_demands
        - b1_specific_vendor_work_of_art
        - b2_specific_vendor_patent_or_copyright
        - b3_specific_vendor_technical_reasons
        - c1_additional_delivery_same_vendor_not_interchangeable
        - c2_additional_delivery_same_vendor_considerable_extra_costs
        - d_unpredictable_urgent
        - e_commodity_exchange_products
        - f_prototype
        - g_special_sale_due_to_liquidation_or_receivership
        - h1_award_winner_conforms_publication
        - h2_award_winner_with_independent_jury_and_promised_contract
    PubDraftAwardStatistics:
      type: object
      properties:
        totalPrice:
          $ref: '#/components/schemas/PriceWithVat'
        justificationDirectAward:
          $ref: '#/components/schemas/JustificationDirectAward'
        vendors:
          type: array
          items:
            $ref: '#/components/schemas/PubDraftStatisticsAwardedVendor'
      required:
        - vendors
    PubDraftAwardTenderProcurementService:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardTenderProcurementInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            cpcCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPCCode'
    PubDraftAwardTenderProcurementInterface:
      type: object
      description: |
        Interface / parent that is implemented by the PubDraftAwardTenderProcurement* models, used for code generation.
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardProcurementInterface'
      required:
        - orderType
      discriminator:
        propertyName: orderType
        mapping:
          service: '#/components/schemas/PubDraftAwardTenderProcurementService'
          construction: '#/components/schemas/PubDraftAwardTenderProcurementConstruction'
          supply: '#/components/schemas/PubDraftAwardTenderProcurementSupply'
    PubDraftAwardTenderProcurementConstruction:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardTenderProcurementInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            oagCodes:
              type: array
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
              items:
                $ref: '#/components/schemas/OAGCode'
            cpcCode:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpcCodeValidation'
              allOf:
                - $ref: '#/components/schemas/CPCCode'
            constructionType:
              $ref: '#/components/schemas/PubConstructionType'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
    PubDraftAwardTenderProcurementSupply:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardTenderProcurementInterface'
        - type: object
          properties:
            additionalCpvCodes:
              type: array
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapCpvCodeValidation'
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              $ref: '#/components/schemas/PubSupplyType'
    PubDraftAwardTenderProcurement:
      type: object
      description: |
        Uses the `orderType` to discriminate between the models for of the construction, supply or service type for the tender procurement pub draft.
      oneOf:
        - $ref: '#/components/schemas/PubDraftAwardTenderProcurementService'
        - $ref: '#/components/schemas/PubDraftAwardTenderProcurementConstruction'
        - $ref: '#/components/schemas/PubDraftAwardTenderProcurementSupply'
      discriminator:
        propertyName: orderType
        mapping:
          service: '#/components/schemas/PubDraftAwardTenderProcurementService'
          construction: '#/components/schemas/PubDraftAwardTenderProcurementConstruction'
          supply: '#/components/schemas/PubDraftAwardTenderProcurementSupply'
    PubDraftAwardProcurementInterface:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubAwardProcurement'
        - type: object
          properties:
            externalReference:
              $ref: '#/components/schemas/PubAndLotReference'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PubDraftAwardTenderProcurement'
          competition: '#/components/schemas/PubDraftAwardGeneralProcurement'
          study_contract: '#/components/schemas/PubDraftAwardGeneralProcurement'
    PubDraftAwardGeneralProcurement:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardProcurementInterface'
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            procurementTopic:
              $ref: '#/components/schemas/PubProcurementTopic'
            oagCodes:
              x-extra-annotation: '@get:com.unic.simap.clientservices.api.SimapOagCodeValidation'
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
    PubDraftAwardProcurement:
      type: object
      description: |
        Use the project type to discriminate between the models.
      oneOf:
        - $ref: '#/components/schemas/PubDraftAwardGeneralProcurement'
        - $ref: '#/components/schemas/PubDraftAwardTenderProcurement'
      discriminator:
        propertyName: projectType
        mapping:
          tender: '#/components/schemas/PubDraftAwardTenderProcurement'
          competition: '#/components/schemas/PubDraftAwardGeneralProcurement'
          study_contract: '#/components/schemas/PubDraftAwardGeneralProcurement'
    PubDraftDetail:
      type: object
      description: Full detail of a publication draft
      oneOf:
        - $ref: '#/components/schemas/PubDraftTenderDetail'
        - $ref: '#/components/schemas/PubDraftCompetitionDetail'
        - $ref: '#/components/schemas/PubDraftStudyContractDetail'
        - $ref: '#/components/schemas/PubDraftAwardDetail'
        - $ref: '#/components/schemas/PubDraftDirectAwardDetail'
        - $ref: '#/components/schemas/PubDraftParticipantSelectionDetail'
        - $ref: '#/components/schemas/PubDraftSelectiveOfferingPhaseDetail'
        - $ref: '#/components/schemas/PubDraftRevocationDetail'
        - $ref: '#/components/schemas/PubDraftAbandonmentDetail'
        - $ref: '#/components/schemas/PubDraftAdvanceNoticeDetailDiscriminator'
        - $ref: '#/components/schemas/PubDraftRfiDetail'
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PubDraftAwardDetail'
          direct_award: '#/components/schemas/PubDraftDirectAwardDetail'
          tender: '#/components/schemas/PubDraftTenderDetail'
          competition: '#/components/schemas/PubDraftCompetitionDetail'
          study_contract: '#/components/schemas/PubDraftStudyContractDetail'
          participant_selection: '#/components/schemas/PubDraftParticipantSelectionDetail'
          selective_offering_phase: '#/components/schemas/PubDraftSelectiveOfferingPhaseDetail'
          revocation: '#/components/schemas/PubDraftRevocationDetail'
          abandonment: '#/components/schemas/PubDraftAbandonmentDetail'
          advance_notice: '#/components/schemas/PubDraftAdvanceNoticeDetailDiscriminator'
          request_for_information: '#/components/schemas/PubDraftRfiDetail'
    WizardState:
      type: object
      properties:
        state:
          type: object
    PubDraftTranslationLanguages:
      type: object
      properties:
        translationLanguages:
          type: array
          items:
            $ref: '#/components/schemas/TranslationLanguage'
          description: |
            the localization languages besides the `creationLanguage`
    PubDraftLotsReorder:
      type: object
      properties:
        lots:
          type: array
          items:
            $ref: '#/components/schemas/PubDraftLotId'
      required:
        - lots
    PubDraftLots:
      type: object
      properties:
        lots:
          type: array
          items:
            $ref: '#/components/schemas/PubDraftLotDescription'
      required:
        - lots
    PubDraftAwardDecisionStep:
      type: object
      allOf:
        - $ref: '#/components/schemas/PubDraftAwardDecisionDetail'
        - $ref: '#/components/schemas/PubDraftTermsRemediesChanged'
        - type: object
          properties:
            publicationDate:
              type: string
              format: date
    SupportedSustainabilityFormTypes:
      type: object
      properties:
        usedInSustainabilityFormTypes:
          description: |
            The property is required in the response and ignored in the request
          readOnly: true
          type: array
          items:
            $ref: '#/components/schemas/SustainabilityFormType'
    A1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isStandardizedService:
              type: boolean
      required:
        - isStandardizedService
    A2ProcurementCharacteristics:
      type: string
      enum:
        - durable
        - standing_order
        - complex
        - intellectual_achievement
        - innovative
        - not_relevant
    A2:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            procurementCharacteristics:
              type: array
              items:
                $ref: '#/components/schemas/A2ProcurementCharacteristics'
              minItems: 1
    A3ProcurementComplexity:
      type: string
      enum:
        - small
        - medium
        - large
    A3:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            procurementComplexity:
              $ref: '#/components/schemas/A3ProcurementComplexity'
    A4:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isAwardCriteriaWeightsRelevant:
              description: |
                Award criteria weights are not relevant for 'direct award' and 'competition'
              type: boolean
            priceWeight:
              type: integer
              minimum: 0
              maximum: 100
            sustainabilityWeight:
              type: integer
              minimum: 0
              maximum: 100
            innovationWeight:
              type: integer
              minimum: 0
              maximum: 100
            offerPlausibilityWeight:
              type: integer
              minimum: 0
              maximum: 100
            otherQualityCriteriaWeight:
              type: integer
              minimum: 0
              maximum: 100
            priceReliabilityWeight:
              type: integer
              minimum: 0
              maximum: 100
            otherWeight:
              type: integer
              minimum: 0
              maximum: 100
      required:
        - isAwardCriteriaWeightsRelevant
    A5CheckCriteria:
      type: string
      enum:
        - 'yes'
        - 'no'
        - unknown
        - not_relevant
    A5CriteriaTypes:
      type: string
      enum:
        - price
        - social_criteria
        - quality
        - ecology
        - innovation
    A5:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            checkCriteria:
              $ref: '#/components/schemas/A5CheckCriteria'
            criteriaTypes:
              type: array
              items:
                $ref: '#/components/schemas/A5CriteriaTypes'
              minItems: 1
    B1QualityRelatedCriteria:
      type: string
      enum:
        - qualification_criteria
        - technical_specifications
        - award_criteria
        - 'no'
    B1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            qualityRelatedCriteria:
              type: array
              items:
                $ref: '#/components/schemas/B1QualityRelatedCriteria'
              minItems: 1
    B2QualityRelatedLabelsRequirements:
      type: string
      enum:
        - 'yes'
        - 'no'
        - not_sme_friendly
        - not_relevant
    B2:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            qualityRelatedLabelsRequirements:
              $ref: '#/components/schemas/B2QualityRelatedLabelsRequirements'
            qualityRelatedLabels:
              type: string
              description: |
                List all labels required like Max Havelaar.
                This field is required if the field qualityRelatedLabelRequirement is set to yes.
    C1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isCountryOfOriginForGoodsAsked:
              type: boolean
            countryOfOriginForGoods:
              type: string
              description: |
                The ISO 3166 two letter country code. The list with the ids / codes can be get from `GET /api/countries/v1`
            comment:
              type: string
    YesNoNotRelevant:
      type: string
      enum:
        - 'yes'
        - 'no'
        - not_relevant
    D1EvaluationCriteriaDimensionsDefined:
      type: string
      enum:
        - society
        - economy
        - environment
    D1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isOverallProjectLead:
              type: boolean
            isKbobRecommendationPartOfContract:
              type: boolean
            evaluationCriteriaDimensionDefined:
              $ref: '#/components/schemas/YesNoNotRelevant'
            evaluationCriteriaDimensionsDefined:
              type: array
              items:
                $ref: '#/components/schemas/D1EvaluationCriteriaDimensionsDefined'
    D2:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isKbobRecommendationPartOfContract:
              type: boolean
    D3:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsPartOfContract:
              $ref: '#/components/schemas/YesNoNotRelevant'
    E1ElementCostsConsidered:
      type: string
      enum:
        - acquisition
        - operation
        - maintenance
        - disposal
        - organization
        - external
    E1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            lifeCycleCostsConsidered:
              $ref: '#/components/schemas/YesNoNotRelevant'
            reason:
              type: string
            elementCostsConsidered:
              type: array
              items:
                $ref: '#/components/schemas/E1ElementCostsConsidered'
              minItems: 1
      required:
        - lifeCycleCostsConsidered
    EcologicalSocialSocietalCriteria:
      type: string
      enum:
        - self_declaration
        - agb
        - specification
        - draft_contract
    F1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            safetyRegulationsDemanded:
              type: array
              items:
                $ref: '#/components/schemas/EcologicalSocialSocietalCriteria'
            comment:
              type: string
    F2:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            iloCoreAgreementsDemanded:
              type: array
              items:
                $ref: '#/components/schemas/EcologicalSocialSocietalCriteria'
            comment:
              type: string
    F3EvidencesSocialCriteria:
      type: string
      enum:
        - signed_declaration_bkb
        - signed_confirmation
        - following_evidence
    F3:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            evidencesSocialCriteriaComplianceProvided:
              type: array
              items:
                $ref: '#/components/schemas/F3EvidencesSocialCriteria'
            evidencesSocialCriteriaComplianceProvidedEvidence:
              type: string
            comment:
              type: string
    F4ClarificationsSocialCriteriaCompliance:
      type: string
      enum:
        - consulting
        - inspection
    F4:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isClarificationSocialCriteriaComplianceDone:
              type: boolean
            clarificationsSocialCriteriaCompliance:
              type: array
              items:
                $ref: '#/components/schemas/F4ClarificationsSocialCriteriaCompliance'
            otherClarifications:
              type: string
    F5:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isSubcontractorSocialCriteriaComplianceDemanded:
              type: boolean
            subcontractorSocialCriteriaComplianceCommitments:
              type: array
              items:
                $ref: '#/components/schemas/EcologicalSocialSocietalCriteria'
            comment:
              type: string
    F6:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isKbobContractAgreementDemanded:
              type: boolean
            isSafetyRegulationComplianceDemanded:
              type: boolean
            isIloCoreAgreementDemanded:
              type: boolean
            isEvidenceOfSocialCriteriaDemanded:
              type: boolean
            isSubcontractorSocialCriteriaComplianceDemanded:
              type: boolean
    F7a:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
            comment:
              type: string
    F7b:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
            comment:
              type: string
    F8:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
            comment:
              type: string
    F9:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
            comment:
              type: string
    G1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            environmentalProtectionsDemanded:
              type: array
              items:
                $ref: '#/components/schemas/EcologicalSocialSocietalCriteria'
              minItems: 1
            comment:
              type: string
    G2:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            isEnvironmentalProtectionDemanded:
              type: boolean
    G21OtherSustainabilityRequirements:
      type: string
      enum:
        - yes_environmental_impact_assessments
        - yes_following
        - 'no'
    G21:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            otherSustainabilityRequirementsBeenMet:
              $ref: '#/components/schemas/G21OtherSustainabilityRequirements'
            otherSustainabilityRequirementsBeenMetDescription:
              type: string
    G3EcologicalCriteriaExpressed:
      type: string
      enum:
        - technical_specifications
        - award_criteria
        - combination_of_technical_specifications_and_award_criteria
        - suitability_criteria
    G3:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            hasEcologicalCriteriaExpressed:
              type: boolean
            ecologicalCriteriaExpressed:
              type: array
              items:
                $ref: '#/components/schemas/G3EcologicalCriteriaExpressed'
              minItems: 1
    G4:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            ecologicalCriteriaDemanded:
              type: string
    G5:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            environmentalEvidence:
              description: |
                If isNoEvidence set to false, either a text in environmentalEvidence or in otherEvidence or in both is required
              type: string
            otherEvidence:
              description: |
                If isNoEvidence set to false, either a text in environmentalEvidence or in otherEvidence or in both is required
              type: string
            isNoEvidence:
              type: boolean
    G6BestFulfilment:
      type: string
      enum:
        - 'yes'
        - 'no'
        - identical
    G6:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            bestFulfilment:
              $ref: '#/components/schemas/G6BestFulfilment'
    G7a:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
    G7b:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
    G7c:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
    G7d:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            standardsDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
    G8OtherEcologicalCriteriaSelected:
      type: string
      enum:
        - suitability_criteria
        - technical_specifications
        - award_criteria
        - service_description
    G8:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            otherEcologicalCriteriaDemanded:
              $ref: '#/components/schemas/YesNoNotRelevant'
            otherEcologicalCriteriaSelected:
              type: array
              items:
                $ref: '#/components/schemas/G8OtherEcologicalCriteriaSelected'
    G9EcologicalTopicsDepicted:
      type: string
      enum:
        - energy_consumption
        - climate_protection
        - material_consumption
        - water_consumption
        - avoidance_of_pollutants
        - product_life
        - recycling
        - environmental_note
        - not_relevant
    G9:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            ecologicalTopicsDepicted:
              type: array
              items:
                $ref: '#/components/schemas/G9EcologicalTopicsDepicted'
    H1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            innovativeSolutionsAvailable:
              type: boolean
    YesNoPartly:
      type: string
      enum:
        - 'yes'
        - 'no'
        - partly
    H11:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            procurementSuitedForInnovativeSolution:
              $ref: '#/components/schemas/YesNoPartly'
    H2InnovationSupportingProcurementProcedures:
      type: string
      enum:
        - functional_tender
        - dialogue_procedure
        - competition_procedure
        - study_procedure
        - allowance_of_variants
        - couvert_method
    H2:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            innovationSupportingProcurementProcedures:
              $ref: '#/components/schemas/YesNoNotRelevant'
            innovationSupportingProcurementProceduresUsed:
              type: array
              items:
                $ref: '#/components/schemas/H2InnovationSupportingProcurementProcedures'
            otherInnovationSupportingProcurementProceduresUsed:
              type: string
    H3InnovationSupportingServicesCriteria:
      type: string
      enum:
        - suitability_criteria
        - technical_specifications
        - award_criteria
        - service_description
    H3:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            innovationSupportingServicesCriteriaChosen:
              $ref: '#/components/schemas/YesNoNotRelevant'
            innovationSupportingServicesCriteria:
              type: array
              items:
                $ref: '#/components/schemas/H3InnovationSupportingServicesCriteria'
                minItems: 1
    H4InnovationSupportingProcurementKinds:
      type: string
      enum:
        - technological_innovation
        - social_innovation
        - efficient_resources_usage
        - process_innovation
        - not_relevant
    H4:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            innovationSupportingProcurementKinds:
              type: array
              items:
                $ref: '#/components/schemas/H4InnovationSupportingProcurementKinds'
                minItems: 1
            otherInnovationSupportingProcurementKinds:
              type: string
    I1aCompatibleMeasures:
      type: string
      enum:
        - division_into_lots
        - admission_partial_offers
        - admission_bidding_consortiums
        - admission_subcontractors
    I1a:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            compatibleMeasuresMet:
              $ref: '#/components/schemas/YesNoNotRelevant'
            compatibleMeasures:
              type: array
              items:
                $ref: '#/components/schemas/I1aCompatibleMeasures'
            otherCompatibleMeasures:
              type: string
    I1bCompatibleMeasures:
      type: string
      enum:
        - division_into_lots
        - admission_bidding_consortiums
        - processing_individual_service_providers
    I1b:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            compatibleMeasuresMet:
              $ref: '#/components/schemas/YesNoNotRelevant'
            compatibleMeasures:
              type: array
              items:
                $ref: '#/components/schemas/I1bCompatibleMeasures'
            otherCompatibleMeasures:
              type: string
    I2CompatibleMeasures:
      type: string
      enum:
        - late_proof_request
        - waiver_cost_intensive_evidence
        - waiver_charging_fees
    I2:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            compatibleMeasuresMet:
              $ref: '#/components/schemas/YesNoNotRelevant'
            compatibleMeasures:
              type: array
              items:
                $ref: '#/components/schemas/I2CompatibleMeasures'
      required:
        - compatibleMeasuresMet
    I3AwardRecipients:
      type: string
      enum:
        - tenderer_without_subcontractors
        - tenderer_with_subcontractors
        - bidding_consortium
        - lots_different_bidders
    I3:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            awardRecipients:
              type: array
              items:
                $ref: '#/components/schemas/I3AwardRecipients'
    I4NumberRangeOfEmployees:
      type: string
      enum:
        - one_to_9
        - ten_to_49
        - fifty_to_249
        - greater_than_249
    I4:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            numberRangeOfEmployees:
              $ref: '#/components/schemas/I4NumberRangeOfEmployees'
      required:
        - numberRangeOfEmployees
    J1:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            hasRejectedBidders:
              type: boolean
            numberOfRejectedBidders:
              type: integer
            totalNumberOfBidders:
              type: integer
    J2:
      type: object
      allOf:
        - $ref: '#/components/schemas/SupportedSustainabilityFormTypes'
        - type: object
          properties:
            hasRejectedBidders:
              type: boolean
            numberOfRejectedBidders:
              type: integer
            totalNumberOfBidders:
              type: integer
    PubDraftAwardSustainabilityForm:
      type: object
      properties:
        contactFirstName:
          type: string
        contactLastName:
          type: string
        contactFunction:
          type: string
        contactPhone:
          type: string
        selectedSustainabilityFormType:
          $ref: '#/components/schemas/SustainabilityFormType'
        a1:
          $ref: '#/components/schemas/A1'
        a2:
          $ref: '#/components/schemas/A2'
        a3:
          $ref: '#/components/schemas/A3'
        a4:
          $ref: '#/components/schemas/A4'
        a5:
          $ref: '#/components/schemas/A5'
        b1:
          $ref: '#/components/schemas/B1'
        b2:
          $ref: '#/components/schemas/B2'
        c1:
          $ref: '#/components/schemas/C1'
        d1:
          $ref: '#/components/schemas/D1'
        d2:
          $ref: '#/components/schemas/D2'
        d3:
          $ref: '#/components/schemas/D3'
        e1:
          $ref: '#/components/schemas/E1'
        f1:
          $ref: '#/components/schemas/F1'
        f2:
          $ref: '#/components/schemas/F2'
        f3:
          $ref: '#/components/schemas/F3'
        f4:
          $ref: '#/components/schemas/F4'
        f5:
          $ref: '#/components/schemas/F5'
        f6:
          $ref: '#/components/schemas/F6'
        f7a:
          $ref: '#/components/schemas/F7a'
        f7b:
          $ref: '#/components/schemas/F7b'
        f8:
          $ref: '#/components/schemas/F8'
        f9:
          $ref: '#/components/schemas/F9'
        g1:
          $ref: '#/components/schemas/G1'
        g2:
          $ref: '#/components/schemas/G2'
        g21:
          $ref: '#/components/schemas/G21'
        g3:
          $ref: '#/components/schemas/G3'
        g4:
          $ref: '#/components/schemas/G4'
        g5:
          $ref: '#/components/schemas/G5'
        g6:
          $ref: '#/components/schemas/G6'
        g7a:
          $ref: '#/components/schemas/G7a'
        g7b:
          $ref: '#/components/schemas/G7b'
        g7c:
          $ref: '#/components/schemas/G7c'
        g7d:
          $ref: '#/components/schemas/G7d'
        g8:
          $ref: '#/components/schemas/G8'
        g9:
          $ref: '#/components/schemas/G9'
        h1:
          $ref: '#/components/schemas/H1'
        h11:
          $ref: '#/components/schemas/H11'
        h2:
          $ref: '#/components/schemas/H2'
        h3:
          $ref: '#/components/schemas/H3'
        h4:
          $ref: '#/components/schemas/H4'
        i1a:
          $ref: '#/components/schemas/I1a'
        i1b:
          $ref: '#/components/schemas/I1b'
        i2:
          $ref: '#/components/schemas/I2'
        i3:
          $ref: '#/components/schemas/I3'
        i4:
          $ref: '#/components/schemas/I4'
        j1:
          $ref: '#/components/schemas/J1'
        j2:
          $ref: '#/components/schemas/J2'
    PubDraftCorrectionInfo:
      type: object
      properties:
        publicationDate:
          type: string
          format: date
        remarks:
          $ref: '#/components/schemas/Translation'
          description: |
            Optional remarks for the correction
    ValidationErrorReason:
      type: string
      description: |
        - `required` - required field is missing, on arrays or lists must contain at least on entry 
        - `must_be_null` - field that is must be `null` has an value
        - `must_be_empty` - list that must be empty contains entries
        - `min` - value is less than the minimal required value
        - `max` - value is greater than the maximal allowed value
        - `sub_selection_invalid` - the value is not allowed, the selection of the parent of this field does not allow the value of the child
        - `failed_range` - the value is not within the allowed range
        - `invalid_publication_day` - the selected day is not an allowed publication day, the publisher for the po doesn't allow publications on the selected weekday
        - `past_editorial_deadline` - the editorial deadline for the selected publication date is already passed, can't submit / publish the publication.
        - `invalid_award_criteria_selection` - Award criteria selection is not allowed for publication type award
        - `unsupported_value` - A field contains an unsupported value
        - `awarded_vendors_non_unique_rank` - Awarded vendors are not ranked uniquely
        - `decision_date_after_publication_date` - Decision date needs to be equal or earlier than the publication date
        - `wrong_sustainability_form_selected` - The selected sustainability form is not in the range given by the sustainability trigger
        - `duplicate_values` - The same value appears more than once
        - `invalid_email_format` - Email address has not a valid format.
        - `invalid_phone_format` - Phone has not a valid E.164 - international number format.
        - `invalid_pattern` - The value doesn't conform with the defined pattern for the field.
        - `invalid_size` - The string value doesn't conform with the defined sizes for the field.
        - `general_error` - Error case for wich no specific key is defined.
        - `invalid_order` - Ordering of elements is invalid
        - `past_publication_date` - Date value is past publication date of current publication.
        - `before_previous_publication_date` - Date value is before publication date of the previous publication
        - `past_offer_deadline` - Date value is past offer deadline
        - `publication_ted_requires_price_selection` - Publication send to TED requires that the price is defined
        - `not_specified_not_allowed` - not_specified was chosen but is not allowed for the current publication type
        - `ted_validation` - validation error reported by the TED SDK
        - `state_contract_requires_wto_language` - Publications with state contract type require a WTO language (FR or EN) to be available
      enum:
        - required
        - must_be_null
        - must_be_empty
        - min
        - max
        - sub_selection_invalid
        - failed_range
        - invalid_publication_day
        - past_editorial_deadline
        - invalid_award_criteria_selection
        - unsupported_value
        - awarded_vendors_non_unique_rank
        - decision_date_after_publication_date
        - wrong_sustainability_form_selected
        - duplicate_values
        - invalid_email_format
        - invalid_phone_format
        - invalid_pattern
        - invalid_size
        - general_error
        - invalid_order
        - past_publication_date
        - before_previous_publication_date
        - past_offer_deadline
        - publication_ted_requires_price_selection
        - not_specified_not_allowed
        - ted_validation
        - state_contract_requires_wto_language
    ValidationError:
      type: object
      properties:
        field:
          type: string
          description: |
            The validated field, if it's an nested object, it will be the object-path to the validated field in the object.

            Example:
            { "person": { "name": null } -> "person.name"

            { "list": [ { "a": "valid" }, { "a": null } ] } -> "list[1].a"
        invalidValue: {}
        errorKey:
          $ref: '#/components/schemas/ValidationErrorReason'
        message:
          type: string
      required:
        - field
        - errorKey
    ValidationResults:
      type: object
      properties:
        validationResults:
          type: object
          description: |
            As the keys of the map the values of the `PubSteps` enum will be used to provide some structural safety.

            Note the special case for the lot keys, see the endpoint / enum description.
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ValidationError'
      required:
        - validationResults
    PastPublishedPubDraftEntry:
      type: object
      description: Past published or for the proc office to be published publication.
      allOf:
        - $ref: '#/components/schemas/PastPublicationsEntry'
        - type: object
          properties:
            status:
              $ref: '#/components/schemas/PubDraftStatus'
          required:
            - status
    PastPublishedPubDrafts:
      type: object
      description: Past publications
      properties:
        pastPublications:
          type: array
          items:
            $ref: '#/components/schemas/PastPublishedPubDraftEntry'
      required:
        - pastPublications
    RoleAndOrganizationChange:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/AssignableRole'
        orgId:
          type: string
          format: uuid
      required:
        - role
    RoleAndOrganization:
      type: object
      allOf:
        - $ref: '#/components/schemas/RoleAndOrganizationChange'
        - type: object
          properties:
            org:
              $ref: '#/components/schemas/Translation'
            isOrgInactive:
              type: boolean
              description: |
                Indication if the organization is inactive (true) or active (false).
                A procurement office is inactive as long as it is not confirmed by a competence centre admin. 
                If the organization is not a procurement office the property value is null because other organizations than a 
                procurement office have no such thing like active or inactive.
            active:
              type: boolean
              description: The currently active role and organization the user has selected.
      required:
        - role
        - active
    RolesAndOrganizations:
      type: object
      properties:
        rolesAndOrganizations:
          type: array
          items:
            $ref: '#/components/schemas/RoleAndOrganization'
      required:
        - rolesAndOrganizations
    Publishers:
      type: object
      properties:
        publishers:
          type: array
          items:
            $ref: '#/components/schemas/Publisher'
      required:
        - publishers
    QnaPublishResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        answerState:
          $ref: '#/components/schemas/QnaAnswerState'
        questionAnsweredAt:
          type: string
          format: date-time
      required:
        - id
        - answerState
        - questionAnsweredAt
    QnaPublishResponses:
      type: object
      description: List of qna's (question answer pair)
      properties:
        qnaPublishResponse:
          type: array
          items:
            $ref: '#/components/schemas/QnaPublishResponse'
    QnaUpdate:
      type: object
      allOf:
        - $ref: '#/components/schemas/Question'
        - type: object
          properties:
            answer:
              type: string
            vendorAskedQuestion:
              allOf:
                - $ref: '#/components/schemas/VendorMinimal'
    TestScenarioBase:
      type: object
      properties:
        title:
          $ref: '#/components/schemas/Translation'
        basePublicationType:
          $ref: '#/components/schemas/PubType'
        baseProcessType:
          $ref: '#/components/schemas/PubProcessType'
        baseLotsType:
          default: without
          $ref: '#/components/schemas/PubLotsType'
        baseOrderType:
          $ref: '#/components/schemas/PubOrderType'
          description: |
            required if `baseType` is `tender`
        baseStudyType:
          $ref: '#/components/schemas/PubStudyType'
          description: |
            required if `baseType` is `study_contract`
        baseCompetitionType:
          $ref: '#/components/schemas/PubCompetitionType'
          description: |
            required if `baseType` is `competition`
        basePublicationDate:
          type: string
          format: date
        followUpPublicationDate:
          type: string
          format: date
        followUpPublished:
          type: boolean
        offerTypes:
          type: array
          items:
            $ref: '#/components/schemas/PubOfferType'
          uniqueItems: true
          description: |
            type of offers allowed for this publication. At least one value must be provided if the property is defined.
        offerDeadline:
          type: string
          format: date-time
        interestedVendorIds:
          type: array
          description: |
            Ids of vendors which should get registered with 'interest_shown' on the project as depending on the scenario it won't be possible to show interest after publication was published. No 
            additional validation is performed in the backend.
          items:
            type: string
            format: uuid
        numberOfLots:
          type: integer
          default: 1
          description: |
            If `baseLotsType` is set to `with` can specify the number of lot's which should get created in the base publication. Default to 1 if not specified.
        followUpLotIndex:
          type: integer
          default: 0
          description: |
            If `baseLotsType` is set to `with` specifies the lot index for which the follow up publications should get created. Defaults to 0.
    AdvanceNoticeBase:
      type: object
      properties:
        advanceNoticePublicationDate:
          type: string
          format: date
        createAdvanceNotice:
          type: boolean
          description: |
            if true, then an advance notice is created and the call-for-bids will be based on it, otherwise only a call-for-bids is created
    VendorDigitalSubmissionScenario:
      type: object
      properties:
        vendorId:
          type: string
          format: uuid
        latestSubmissionStatus:
          $ref: '#/components/schemas/VendorDigitalSubmissionStatus'
          description: |
            status of latest submission in this project. In a later state in the project, the submission gets automatically submitted 
            to reflect the correct state of the business process (i.e. when creating an award, digital offer has to be submitted first).y
        submissionDateTime:
          type: string
          format: date-time
        generateAndUploadDocuments:
          type: boolean
          description: |
            If `true` automatically generates a document and attaches it to the submission.
            If the project is with lots, one document is generated for the generic part and another one for the lot specific part.
      required:
        - vendorId
    WithVendorDigitalSubmission:
      type: object
      properties:
        vendorDigitalSubmissions:
          type: array
          items:
            $ref: '#/components/schemas/VendorDigitalSubmissionScenario'
    AbandonmentTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/AdvanceNoticeBase'
        - $ref: '#/components/schemas/WithVendorDigitalSubmission'
    TestScenarioResult:
      type: object
      properties:
        projectId:
          type: string
          format: uuid
        basePublicationId:
          type: string
          format: uuid
        followUpPublicationId:
          type: string
          format: uuid
        nextFollowUpPublicationId:
          type: string
          format: uuid
        lotIds:
          type: array
          items:
            type: string
            format: uuid
          description: |
            Will return the ids of all created lots if basePublication was created with `lotsType` `with`, otherwise empty array.
        followUpLotId:
          type: string
          format: uuid
          description: |
            Will return the id of the lot, for which the follow-up publication(s) where created. Null if created with `lotsType` `without`.
      required:
        - projectId
        - basePublicationId
    QnaRoundBase:
      type: object
      properties:
        qnaRoundSourceType:
          default: no_qna_rounds
          $ref: '#/components/schemas/PubQnaRoundSourceType'
        numberOfQnaRounds:
          type: integer
          default: 0
          description: |
            Number of qna rounds created for this publication. Only applicable of 'qnaRoundSourceType' is not set to 'no_qna_rounds'
    InitialPublicationTestScenarioBase:
      type: object
      properties:
        initialPublicationPublished:
          type: boolean
          default: false
          description: |
            true, if this initial publication should get published. If false, initial publication will get created in status 'draft'. Defaults to false.
    AdvanceNoticeTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/QnaRoundBase'
        - $ref: '#/components/schemas/InitialPublicationTestScenarioBase'
    PubWithQualifiedVendorsBase:
      type: object
      properties:
        qualifiedVendorIds:
          type: array
          description: |
            Ids of qualified vendors for this project and defined lot via followUpLotIndex. Be aware that qualified vendors are automatically marked as interestedVendors having submitted a participation offer
          items:
            type: string
            format: uuid
    PubWithAwardedVendorsBase:
      type: object
      properties:
        awardedVendorIds:
          type: array
          description: |
            Ids of qualified vendors for this project and defined lot via followUpLotIndex. Be aware that qualified vendors are automatically marked as interestedVendors having submitted an offer
          items:
            type: string
            format: uuid
    AwardTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/AdvanceNoticeBase'
        - $ref: '#/components/schemas/PubWithQualifiedVendorsBase'
        - $ref: '#/components/schemas/PubWithAwardedVendorsBase'
        - $ref: '#/components/schemas/WithVendorDigitalSubmission'
        - type: object
          properties:
            awardOfferDeadlineDays:
              type: integer
    CallForBidsTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/AdvanceNoticeBase'
        - $ref: '#/components/schemas/InitialPublicationTestScenarioBase'
        - $ref: '#/components/schemas/QnaRoundBase'
        - $ref: '#/components/schemas/WithVendorDigitalSubmission'
        - type: object
          properties:
            invitedVendors:
              type: array
              description: |
                Ids of vendors which should get invited to this call_for_bids publication. Only available if process_type is set to 'invitation'
              items:
                type: string
                format: uuid
    CorrectionTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/AdvanceNoticeBase'
        - $ref: '#/components/schemas/QnaRoundBase'
        - $ref: '#/components/schemas/PubWithQualifiedVendorsBase'
        - $ref: '#/components/schemas/WithVendorDigitalSubmission'
    DirectAwardTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/InitialPublicationTestScenarioBase'
        - $ref: '#/components/schemas/PubWithAwardedVendorsBase'
    ParticipantSelectionTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/AdvanceNoticeBase'
        - $ref: '#/components/schemas/PubWithQualifiedVendorsBase'
        - $ref: '#/components/schemas/WithVendorDigitalSubmission'
        - type: object
          properties:
            participantSelectionCommunication:
              $ref: '#/components/schemas/ParticipantSelectionCommunication'
            participantSelectionAddress:
              $ref: '#/components/schemas/PubAddress'
    SelectiveOfferingPhaseTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/AdvanceNoticeBase'
        - $ref: '#/components/schemas/QnaRoundBase'
        - $ref: '#/components/schemas/PubWithQualifiedVendorsBase'
        - $ref: '#/components/schemas/WithVendorDigitalSubmission'
        - type: object
          properties:
            participantSelectionCommunication:
              $ref: '#/components/schemas/ParticipantSelectionCommunication'
            participantSelectionAddress:
              $ref: '#/components/schemas/PubAddress'
    RevocationTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/AdvanceNoticeBase'
        - $ref: '#/components/schemas/PubWithQualifiedVendorsBase'
        - $ref: '#/components/schemas/PubWithAwardedVendorsBase'
        - $ref: '#/components/schemas/WithVendorDigitalSubmission'
    RequestForInformationTestScenario:
      type: object
      allOf:
        - $ref: '#/components/schemas/TestScenarioBase'
        - $ref: '#/components/schemas/InitialPublicationTestScenarioBase'
        - $ref: '#/components/schemas/QnaRoundBase'
        - $ref: '#/components/schemas/WithVendorDigitalSubmission'
    WTOStatisticsProcOfficeType:
      type: string
      enum:
        - central_or_decentral_federation
        - other_federation
        - entire_federal_administration
        - cantonal_or_other_cantonal
        - communal_or_other_communal
      description: |
        - `central_or_decentral_federation` - can be only used by the role `competence_centre_admin`
        - `other_federation` - can be only used by the role `competence_centre_admin`
        - `entire_federal_administration` - can be only used by the role `competence_centre_admin`
        - `cantonal_or_other_cantonal` - can be only used by the role `simap_admin`
        - `communal_or_other_communal` - can be only used by the role `simap_admin`
    WTOStatisticsOrganizationType:
      type: string
      enum:
        - canton
        - proc_office
    WTOStatisticsTotal:
      type: object
      properties:
        totalCHF:
          type: number
          format: price
        numberOfOrders:
          type: integer
      required:
        - totalCHF
        - numberOfOrders
    WTOStatisticsTotalsByOrigin:
      type: object
      properties:
        ch:
          $ref: '#/components/schemas/WTOStatisticsTotal'
        eu:
          $ref: '#/components/schemas/WTOStatisticsTotal'
        usa:
          $ref: '#/components/schemas/WTOStatisticsTotal'
        other:
          $ref: '#/components/schemas/WTOStatisticsTotal'
    WTOStatisticsTotalsByCategoryTotals:
      type: object
      properties:
        service:
          $ref: '#/components/schemas/WTOStatisticsTotal'
        supply:
          $ref: '#/components/schemas/WTOStatisticsTotal'
        construction:
          $ref: '#/components/schemas/WTOStatisticsTotal'
        origins:
          $ref: '#/components/schemas/WTOStatisticsTotalsByOrigin'
      required:
        - origins
    WTOStatisticsTotalsDirectAwardByCategoryEntry:
      type: object
      allOf:
        - $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryTotals'
        - type: object
          properties:
            totals:
              $ref: '#/components/schemas/WTOStatisticsTotal'
    WTOStatisticsTotalsDirectAwardByCategory:
      type: object
      description: |
        Total of direct awards (Freihändige Vergaben) by top-level 'justificationDirectAward' answers.
      properties:
        a:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategoryEntry'
        b:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategoryEntry'
        c:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategoryEntry'
        d:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategoryEntry'
        e:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategoryEntry'
        f:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategoryEntry'
        g:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategoryEntry'
        h:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategoryEntry'
    WTOStatisticsOverallTotals:
      type: object
      properties:
        overall:
          allOf:
            - $ref: '#/components/schemas/WTOStatisticsTotal'
          description: |
            Total of all awards and direct awards.
        service:
          allOf:
            - $ref: '#/components/schemas/WTOStatisticsTotal'
          description: |
            Total of all awards and direct awards for the service category.
        supply:
          allOf:
            - $ref: '#/components/schemas/WTOStatisticsTotal'
          description: |
            Total of all awards and direct awards for the service supply.
        construction:
          allOf:
            - $ref: '#/components/schemas/WTOStatisticsTotal'
          description: |
            Total of all awards and direct awards for the construction supply.
        origins:
          allOf:
            - $ref: '#/components/schemas/WTOStatisticsTotalsByOrigin'
          description: |
            Total for the origins of all awards and direct awards.
        directAward:
          allOf:
            - $ref: '#/components/schemas/WTOStatisticsTotal'
          description: |
            Total of all direct awards (Freihändige Vergaben).
        directAwardByCategory:
          $ref: '#/components/schemas/WTOStatisticsTotalsDirectAwardByCategory'
      required:
        - origins
        - directAwardByCategory
    WTOStatisticsTotalsByOrganizationEntry:
      type: object
      description: This object contains statistics values aggregated by the same organization.
      properties:
        organizationId:
          type: string
          format: uuid
        organizationName:
          type: string
        totals:
          $ref: '#/components/schemas/WTOStatisticsTotal'
      required:
        - organizationId
        - organizationName
    WTOStatisticsTotalsByCategoryEntry:
      type: object
      description: This object contains statistics values aggregated by the same organization and cpvCode.
      allOf:
        - $ref: '#/components/schemas/WTOStatisticsTotalsByOrganizationEntry'
        - $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryTotals'
        - type: object
          properties:
            cpvCode:
              type: string
              format: cpvCode
          required:
            - cpvCode
    WTOStatisticsDirectAwardTotalsByCategory:
      type: object
      description: |
        This object contains statistics values grouped by top-level 'justificationDirectAward' answers and aggregated by the same organization and cpvCode below those groups.
        Properties names of this object refer to the top-level answers of 'justificationDirectAward' (i.e. 'a1_no_offer', 'a2_no_offer_fulfilled_entry_conditions', 'a3_no_vendor_fulfilled_entry_conditions' 
        and 'a4_offers_coordinated_same_demands' all belonging to the top-level group of justification 'a').
      properties:
        a:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
        b:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
        c:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
        d:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
        e:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
        f:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
        g:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
        h:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
      required:
        - a
        - b
        - c
        - d
        - e
        - f
        - g
        - h
    WTOStatisticsExport:
      type: object
      description: Export of aggregated values of WTO related awards and direct_awards
      properties:
        from:
          type: string
          format: date
          description: considered awards having a publication date bigger or equals to the `from` date.
        to:
          type: string
          format: date
          description: considered awards having a publication date smaller or equals to the `to` date.
        euroExchangeRate:
          type: number
          format: float
          description: exchange rate of euro to chf used to convert and aggregate the total prices of awards with currency 'eur'.
        usdExchangeRate:
          type: number
          format: float
          description: exchange rate of usd to chf used to convert and aggregate the total prices of awards with currency 'usd'.
        aggregatedByOrganizationType:
          $ref: '#/components/schemas/WTOStatisticsOrganizationType'
          description: aggregate exported awards by defined organization type.
        procOfficeTypeFilter:
          $ref: '#/components/schemas/WTOStatisticsProcOfficeType'
          description: considered awards of proc_offices matching the proc_office filter type.
        overallTotals:
          $ref: '#/components/schemas/WTOStatisticsOverallTotals'
        awardAndDirectAwardTotalsByOrganization:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByOrganizationEntry'
        awardAndDirectAwardTotalsByCategory:
          type: array
          items:
            $ref: '#/components/schemas/WTOStatisticsTotalsByCategoryEntry'
        directAwardTotalsByCategory:
          $ref: '#/components/schemas/WTOStatisticsDirectAwardTotalsByCategory'
      required:
        - from
        - to
        - euroExchangeRate
        - usdExchangeRate
        - organizationType
        - overallTotals
        - awardAndDirectAwardTotalsByOrganization
        - awardAndDirectAwardTotalsByCategory
        - directAwardTotalsByCategory
    PageName:
      type: string
      description: |
        The PageName is a identifier for a page displaying content which is editable by the simap-admin.
        Together with the TabName it defines a predefined structure where content can be located and displayed. 
        Each page consist of one or many tabs. Each tab further consists of one or many cards/content-components. 
        These are styled differently depending on there content-component-type.
        Following pages are available:
        * `start_page` - no tabs/single tab
        * `help` - tabs: edu-videos, frequently asked questions
        * `topical` - tabs: news, agenda, release notes
        * `procurement` - tabs: further information on public procurement, exclusion from public procurement, EU/WTO/EFTA, Instiutions and associations, WTO statistics
        * `about` - tabs: organisation, business regulations, statutes, general terms conditions
      enum:
        - start_page
        - help
        - topical
        - procurement
        - about
    TabName:
      type: string
      description: |
        The TabName is a identifier for a tab displaying content which is editable by the simap-admin.
        Together with the PageName it defines a predefined structure where content can be located and displayed. 
        Each tab is located within an page. Each tab consist of one or many cards/content-components.
        Following tabs are available:
        * `start_page` - pseudo tab as there are no tabs on the start-page.
        * `edu_videos` - A collection of videos which explain various features of the simap-platform 
        * `frequently_asked_questions` - common questions are answered here
        * `news` - news articles are published on this tab
        * `agenda` - list of important deadlines and events
        * `release_notes` - contains information about the changes made to simap and newly added features for each published release
        * `further_information_on_public_procurement` - information about the fundamentals and details all around the subject: public procurements
        * `exclusion_from_public_procurement` - information in which scenarios a public procurement isn't mandatory
        * `eu_wto_efta` - further links about public procurements within different associations and unions
        * `institutions_and_associations` - further links about associations and institutions strongly related to simap
        * `wto_statistics` - Links to download the newest wto-statistics
        * `organisation` - information about the persons who make simap possible and their roles 
        * `business_regulations` - rules and regulations about the simap-organisation
        * `statutes` - describes what the purpose of the simap-organisation is, defines terms and how the organisation works 
        * `general_terms_conditions` - general terms and conditions
      enum:
        - start_page
        - edu_videos
        - frequently_asked_questions
        - news
        - agenda
        - release_notes
        - further_information_on_public_procurement
        - exclusion_from_public_procurement
        - eu_wto_efta
        - institutions_and_associations
        - wto_statistics
        - organisation
        - business_regulations
        - statutes
        - general_terms_conditions
    ContentComponent:
      type: object
      description: Basic properties for a content-component. Extra properties are added depending on the discriminator type
      properties:
        id:
          type: string
          format: uuid
        componentType:
          $ref: '#/components/schemas/ComponentType'
        position:
          type: integer
          minimum: 0
      required:
        - id
        - componentType
        - position
      discriminator:
        propertyName: componentType
        mapping:
          info_box: '#/components/schemas/ContentComponentInfoBox'
          text_section: '#/components/schemas/ContentComponentTextSection'
          links: '#/components/schemas/ContentComponentLinks'
          videos: '#/components/schemas/ContentComponentVideos'
          articles: '#/components/schemas/ContentComponentArticles'
    ContentComponentInfoBox:
      type: object
      allOf:
        - $ref: '#/components/schemas/ContentComponent'
        - type: object
          properties:
            content:
              $ref: '#/components/schemas/TranslationSanitizedHtml'
          required:
            - content
    ContentComponentTextSection:
      type: object
      allOf:
        - $ref: '#/components/schemas/ContentComponent'
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
            content:
              $ref: '#/components/schemas/TranslationSanitizedHtml'
          required:
            - content
    ContentComponentLinkItemIcon:
      type: string
      description: |
        This icon are used for content-component-link-items.
        The frontend uses it to display a fitting icon.
        Following types are available:
        * web - indicates that this link points to a website
        * pdf - indicates that this link points to a pdf-file
      enum:
        - web
        - pdf
    ContentComponentLinkItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        displayText:
          $ref: '#/components/schemas/Translation'
        url:
          $ref: '#/components/schemas/TranslationURL'
        icon:
          $ref: '#/components/schemas/ContentComponentLinkItemIcon'
        index:
          type: integer
          minimum: 0
      required:
        - id
        - displayText
        - url
        - icon
        - index
    ContentComponentLinks:
      type: object
      allOf:
        - $ref: '#/components/schemas/ContentComponent'
        - type: object
          properties:
            title:
              $ref: '#/components/schemas/Translation'
            items:
              type: array
              items:
                $ref: '#/components/schemas/ContentComponentLinkItem'
          required:
            - items
    ContentComponentYoutubeVideoItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        youtubeVideoId:
          $ref: '#/components/schemas/Translation'
        title:
          $ref: '#/components/schemas/Translation'
        index:
          type: integer
          minimum: 0
      required:
        - id
        - youtubeVideoId
        - title
        - index
    ContentComponentVideos:
      type: object
      allOf:
        - $ref: '#/components/schemas/ContentComponent'
        - type: object
          properties:
            items:
              type: array
              items:
                $ref: '#/components/schemas/ContentComponentYoutubeVideoItem'
          required:
            - items
    ContentComponentArticleCategory:
      type: string
      description: |
        This category are specifically used in conjunction with content-component-articles and article-items.
        Following categories are available:
        * `news` - news related to the platform and the association simap.ch
        * `agenda` - upcoming dates for planned events 
        * `release_notes` - release notes for the platform simap.ch
      enum:
        - news
        - agenda
        - release_notes
    ContentComponentMetadataArticleItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        date:
          type: string
          format: date
          readOnly: true
        title:
          $ref: '#/components/schemas/Translation'
          readOnly: true
      required:
        - id
        - date
        - title
    ContentComponentArticles:
      type: object
      allOf:
        - $ref: '#/components/schemas/ContentComponent'
        - type: object
          properties:
            category:
              $ref: '#/components/schemas/ContentComponentArticleCategory'
              description: The category on the articles define which article-items to load.
            items:
              type: array
              items:
                $ref: '#/components/schemas/ContentComponentMetadataArticleItem'
          required:
            - items
            - category
    ComponentType:
      type: string
      description: |
        The component-type defines and describes the type of content the component has.
        It's used as discriminator to add different properties. It can be used to present the content in different styles to the user.
        Following types are available:
        * `text_section` - text component, see model `ContentComponentTextSection`.
        * `info_box` - info box component for announcements, see model `ContentComponentInfoBox`.
        * `links` - link component for a collection of links, see model `ContentComponentLinks`. 
        * `articles` - article component for a collection of entries for the selected topic, see model `ContentComponentArticles`.
        * `videos` - video component for a collection of videos, see model `ContentComponentVideos`.
      enum:
        - text_section
        - info_box
        - links
        - articles
        - videos
    TabComponent:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/TabName'
        contentComponents:
          type: array
          description: Editable content components by the simap_admin located at this tab.
          items:
            $ref: '#/components/schemas/ContentComponent'
      required:
        - name
        - contentComponents
    PageComponent:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/PageName'
        tabs:
          type: array
          description: Contains the tabs which has editable content components
          readOnly: true
          items:
            $ref: '#/components/schemas/TabComponent'
      required:
        - name
        - tabs
    ContentComponentArticleItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        category:
          $ref: '#/components/schemas/ContentComponentArticleCategory'
          description: The category on the article-items define to which category they belong.
        date:
          type: string
          format: date
        title:
          $ref: '#/components/schemas/Translation'
        content:
          $ref: '#/components/schemas/TranslationSanitizedHtml'
      required:
        - id
        - category
        - date
        - title
        - content
    VendorDigitalSubmission:
      type: object
      allOf:
        - $ref: '#/components/schemas/VendorDigitalSubmissionInfo'
        - type: object
          properties:
            id:
              type: string
              format: uuid
            submissionType:
              $ref: '#/components/schemas/VendorDigitalSubmissionType'
            vendorId:
              type: string
              format: uuid
            submissionStatus:
              $ref: '#/components/schemas/VendorDigitalSubmissionStatus'
            submittedBy:
              $ref: '#/components/schemas/UserMinimal'
          required:
            - id
            - submissionType
            - vendorId
            - submissionStatus
    VendorDigitalSubmissionDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/VendorDigitalSubmissionDetailInfo'
        - $ref: '#/components/schemas/VendorDigitalSubmission'
    VendorDigitalSubmissionDetails:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseProjectInfo'
        - type: object
          properties:
            submissions:
              type: array
              items:
                $ref: '#/components/schemas/VendorDigitalSubmissionDetail'
          required:
            - submissions
    VendorDigitalSubmissionBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseProjectInfo'
        - $ref: '#/components/schemas/VendorDigitalSubmission'
        - type: object
          properties:
            projectTitle:
              $ref: '#/components/schemas/Translation'
            referencingLot:
              $ref: '#/components/schemas/PublicationLotDescription'
              description: Holds the current lot for the offering-phase in the selective process.
            availableLots:
              description: |
                List of lots available for submission, only provided for projects with lots.
              type: array
              items:
                $ref: '#/components/schemas/PublicationLotDescription'
            selectedLots:
              description: |
                List of lots selected for submission, only used for projects with lots.
              type: array
              items:
                type: string
                format: uuid
          required:
            - projectTitle
            - availableLots
            - selectedLots
    VendorDigitalSubmissionCreate:
      type: object
      properties:
        submissionType:
          $ref: '#/components/schemas/VendorDigitalSubmissionType'
        lotIds:
          type: array
          items:
            type: string
            format: uuid
      required:
        - submissionType
    VendorDigitalSubmissionDocumentUploadMeta:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseDocumentUploadMeta'
        - type: object
          properties:
            lotId:
              type: string
              format: uuid
              description: If document should get attached to a specific lot the submission is eligible for.
    VendorDigitalSubmissionDocumentUploadMultipart:
      type: object
      description: |
        Payload of a multipart vendor submission document file upload strictly relying on the order of the parts. 
        Part 1 must be `meta` following by the part `file` to be able to process the request stream based.
      properties:
        meta:
          $ref: '#/components/schemas/VendorDigitalSubmissionDocumentUploadMeta'
        file:
          type: string
          format: binary
      required:
        - meta
        - file
    VendorDigitalSubmissionDocumentAddVendorDocument:
      type: object
      properties:
        vendorDocumentId:
          type: string
          format: uuid
          description: Reference to the vendor document to add to the vendor digital submission
        lotId:
          type: string
          format: uuid
          description: Optional reference to the lotId if the created vendor digital submission document should be attached to a specific lot only
      required:
        - vendorDocumentId
    SustainabilityTrigger:
      type: object
      properties:
        id:
          type: string
          format: uuid
        cpvCodeMatch:
          type: string
          description: |
            The CPV code that this sustainability trigger matches against.
            Use either an 8 digit code for an exact match or 1-7 digits followed by an asterisk (*) to match
            a subtree of the cpv-code tree.
        compCentreId:
          type: string
          format: uuid
          description: The ID of the competence centre that this sustainability trigger belongs to.
        institutionId:
          type: string
          format: uuid
          description: The ID of the institution that this sustainability trigger applies to.
        sustainabilityFormTypes:
          type: array
          items:
            $ref: '#/components/schemas/SustainabilityFormType'
          description: |
            SustainabilityFormType the trigger shall apply to.
            Currently supported is either [nh01] or [nh02, nh03, nh04, nh05].
        productCategoryId:
          type: string
          format: uuid
          description: |
            The ID of the product category of this sustainability trigger.
            GET `/api/sustainability/v1/product-categories` for available categories.
        productCategoryName:
          type: string
          readOnly: true
          description: |
            Name of the category, only available in german.
            Not required for creating a new trigger.
      required:
        - id
        - cpvCodeMatch
        - description
        - compCentreId
        - institutionId
        - sustainabilityFormTypes
        - productCategoryId
    SustainabilityTriggers:
      type: object
      properties:
        sustainabilityTriggers:
          type: array
          items:
            $ref: '#/components/schemas/SustainabilityTrigger'
    ProductCategory:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          description: the name of the product category
      required:
        - id
        - name
    ProductCategories:
      type: object
      properties:
        productCategories:
          type: array
          items:
            $ref: '#/components/schemas/ProductCategory'
    PubSteps:
      type: string
      enum:
        - project-info
        - dates
        - procurement
        - criteria
        - terms
        - lot
        - decision
        - statistics
        - sustainability
        - abandonment
        - revocation
        - correction
        - participant-selection
        - notice
        - ted
        - invited-vendors
      description: |
        - `lot` - when used to describe a step, it is combined with the lot id -> `lot--5b63971e-bf2f-4c9b-b0e3-a741277e9cbf`
        - `notice` - notice step of an `selective_offering_phase` publication
        - `ted` - not a real step but is used during validation, i.e. all TED related errors will be attached to this step
        - `invited-vendors` - only relevant for call_for_bids in the invitation process
    TargetPage:
      type: string
      description: list of possible page values where a use can get redirected
      enum:
        - login
        - vendor_admin_user_manager
        - proc_office_user_manager
        - comp_centre_manage_proc_offices
        - project
        - project_qnas
        - project_documents
        - subscription
        - my_organizations
        - vendor_profile
    RedirectRole:
      type: string
      enum:
        - subscription_user
        - procurement_project_contributor
        - procurement_user
        - procurement_admin
        - vendor_user
        - vendor_admin
        - competence_centre_print_user
        - competence_centre_admin
        - simap_admin
        - any
      description: |
        The possible roles that can be used in the `RedirectContext` to define the role for the redirect link.

        Enum of the possible roles (`AssignableRole`) a user can have + the special case `any` if any role can be used, the currently active role
        should be used in the redirect.
    RedirectContext:
      type: object
      description: |
        Context model of a redirect request in the frontend. 
        The context-token is appended as base64 encoded string to the frontend endpoint `/<lang>/redirect?context=`
      properties:
        page:
          description: Reference to the page to which the browser should get redirected
          $ref: '#/components/schemas/TargetPage'
        role:
          $ref: '#/components/schemas/RedirectRole'
          description: |
            If provided, user should switch to the provided role when redirecting to the requested page.

            There is a special case, the `any` role. When used the user must login / be logged in but no automatic role change will happen,
            the currently active role is used.
        orgId:
          type: string
          format: uuid
          description: If provided, user should switch to provided organization when redirecting to the requested page.
        projectId:
          type: string
          format: uuid
          description: if provided, redirect to requested page in the context of the selected project.
        lotId:
          type: string
          format: uuid
          description: if provided, redirect to requested page in the context of the selected lot.
        subscriptionId:
          type: string
          format: uuid
          description: if provided, redirect to requested page in the context of the selected subscription.
      required:
        - page
    PubDraftAwardBaseType:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PubDraftAwardBase'
        - $ref: '#/components/schemas/PubDraftDirectAwardBase'
      discriminator:
        propertyName: type
        mapping:
          award: '#/components/schemas/PubDraftAwardBase'
          direct_award: '#/components/schemas/PubDraftDirectAwardBase'
    PubDraftAwardOverallProcurement:
      type: object
      description: |
        overall definition for all possible procurement information. Certain fields are only filled based on projectType of award.
      allOf:
        - $ref: '#/components/schemas/PubDraftBaseCodes'
        - type: object
          properties:
            orderDescription:
              $ref: '#/components/schemas/Translation'
            cpvCode:
              $ref: '#/components/schemas/CPVCode'
            procurementTopic:
              description: provided for non-tender publications
              $ref: '#/components/schemas/PubProcurementTopic'
            cpcCode:
              description: provided for awarded tender service publications
              $ref: '#/components/schemas/CPCCode'
            oagCodes:
              description: provided for awarded tender construction or non-tender publications
              type: array
              items:
                $ref: '#/components/schemas/OAGCode'
            constructionCategory:
              description: provided for awarded tender construction or non-tender publications
              $ref: '#/components/schemas/PubConstructionCategoryOptional'
            constructionType:
              description: provided for awarded tender construction publications
              $ref: '#/components/schemas/PubConstructionType'
            additionalCpvCodes:
              description: provided for awarded tender supply publications or non-tender publications
              type: array
              items:
                $ref: '#/components/schemas/CPVCode'
            supplyType:
              description: provided for awarded tender supply publications
              $ref: '#/components/schemas/PubSupplyType'
          required:
            - orderDescription
            - cpvCode
    PubDraftAwardStatisticsExport:
      type: object
      properties:
        totalPrice:
          $ref: '#/components/schemas/PriceWithVat'
        justificationDirectAward:
          $ref: '#/components/schemas/JustificationDirectAward'
    AwardedVendorExport:
      type: object
      description: |
        Statistic data of an awarded vendor in combination with awarded publication data.
      properties:
        award:
          $ref: '#/components/schemas/PubDraftAwardBaseType'
        lot:
          $ref: '#/components/schemas/LotReference'
          description: Lot information. Only available in case project has lotsType `with`
        procurementRecipient:
          $ref: '#/components/schemas/PubAddress'
        procurementOffice:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/ProcOfficeType'
            mainActivity:
              $ref: '#/components/schemas/MainActivity'
            address:
              $ref: '#/components/schemas/PubAddress'
          required:
            - type
            - mainActivity
            - address
        procurement:
          $ref: '#/components/schemas/PubDraftAwardOverallProcurement'
        decision:
          $ref: '#/components/schemas/PubDraftAwardDecisionExport'
        statistics:
          $ref: '#/components/schemas/PubDraftAwardStatisticsExport'
        awardedVendor:
          $ref: '#/components/schemas/PubDraftAwardVendorSubmission'
      required:
        - award
        - procurementRecipient
        - procurementOffice
        - procurement
        - decision
        - statistics
        - awardedVendor
    PubDraftCallForBidsBaseType:
      type: object
      oneOf:
        - $ref: '#/components/schemas/PubDraftTenderBase'
        - $ref: '#/components/schemas/PubDraftCompetitionBase'
        - $ref: '#/components/schemas/PubDraftStudyContractBase'
      discriminator:
        propertyName: type
        mapping:
          tender: '#/components/schemas/PubDraftTenderBase'
          competition: '#/components/schemas/PubDraftCompetitionBase'
          study_contract: '#/components/schemas/PubDraftStudyContractBase'
    PubMainCodes:
      type: object
      properties:
        cpvCode:
          $ref: '#/components/schemas/CPVCode'
        cpcCode:
          $ref: '#/components/schemas/CPCCode'
      required:
        - cpvCode
    CallForBidsExport:
      type: object
      description: |
        Call-for-bids export data
      properties:
        base:
          $ref: '#/components/schemas/PubDraftCallForBidsBaseType'
        numberOfLots:
          type: integer
          description: Number of lots. Only provided if project was created with lotsType `with`.
        procurementRecipient:
          $ref: '#/components/schemas/PubAddress'
        procurementOffice:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/ProcOfficeType'
            address:
              $ref: '#/components/schemas/PubAddress'
          required:
            - type
        procurement:
          $ref: '#/components/schemas/PubMainCodes'
        remediesNotice:
          $ref: '#/components/schemas/Translation'
      required:
        - base
        - procurementRecipient
        - procurementOffice
        - procurement
        - remediesNotice
    SustainabilityFormExport:
      type: object
      description: |
        Export object of award sustainability form data combined with award publication data.
        The model is based on the sustainability form of the pub-draft structure. 
        Since the mapping of questions to selected forms, provided by the usedInSustainabilityFormTypes property in each question, 
        would be redundant for every row, this property is set to null for all questions. 
        Use '/sustainability-form/v1/mappings' endpoint to query the form question mapping once for the whole export.
      properties:
        processType:
          $ref: '#/components/schemas/PubProcessType'
        projectNumber:
          type: string
        lotNumber:
          type: integer
        publicationNumber:
          type: string
          example: 123-01
          description: |
            Unique publication number aka "Meldungsnummer".
        publicationDate:
          type: string
          format: date
        totalPrice:
          $ref: '#/components/schemas/PriceWithVat'
        vendorNames:
          type: array
          items:
            type: string
        cpvCode:
          $ref: '#/components/schemas/CPVCode'
        productCategory:
          type: string
        procurementOffice:
          type: object
          properties:
            name:
              $ref: '#/components/schemas/Translation'
        form:
          $ref: '#/components/schemas/PubDraftAwardSustainabilityForm'
      required:
        - processType
        - projectNumber
        - publicationNumber
        - publicationDate
        - totalPrice
        - vendorNames
        - cpvCode
        - productCategory
        - procurementOffice
        - form
    UserRoleExport:
      type: object
      description: |
        Export user data, one row for every role a user has.
      properties:
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
          format: email
        language:
          $ref: '#/components/schemas/SystemLanguage'
        role:
          $ref: '#/components/schemas/AssignableRole'
        organisationName:
          $ref: '#/components/schemas/Translation'
      required:
        - email
        - language
        - role
    Code:
      type: object
      anyOf:
        - $ref: '#/components/schemas/CPVCode'
        - $ref: '#/components/schemas/CPCCode'
        - $ref: '#/components/schemas/BKPCode'
        - $ref: '#/components/schemas/EBKPHCode'
        - $ref: '#/components/schemas/EBKPTCode'
        - $ref: '#/components/schemas/NPKCode'
        - $ref: '#/components/schemas/OAGCode'
  securitySchemes:
    SimapOIDC:
      type: openIdConnect
      openIdConnectUrl: /auth/realms/simap/.well-known/openid-configuration
  responses:
    ServerError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerErrorAttributes'
  parameters:
    QueryParamFrom:
      name: from
      schema:
        type: string
        format: date-time
      in: query
      required: false
      description: filter list of response entries having a changed date bigger or equals to the provided `from` date.
    QueryParamTo:
      name: to
      schema:
        type: string
        format: date-time
      in: query
      required: false
      description: filter list of response entries having a changed date smaller or equals to the provided `to` date.
    QueryParamLastItem:
      name: lastItem
      schema:
        type: string
      in: query
      required: false
      description: The name of the last history entry in the list - see the `lastItem` field in the `pagination` object.
    ParamCompCentreId:
      name: compCentreId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: The id of the competence centre, get available competence centres at /compcentres/v1
    ParamProcOfficeId:
      name: procOfficeId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of the procurement office, can be obtained by GET on /procoffices/v1 or has to be provided on creation
    ParamProjectId:
      name: projectId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of the project, available projects can be seen by GET on /procoffices/v1/my/projects/projects-overview
    QueryParamLotId:
      name: lotId
      schema:
        type: string
        format: uuid
      in: query
      required: false
      description: Id of the lot, can be found in the publication data
    ParamVendorId:
      name: vendorId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of the vendor, can be obtained by `GET /vendor/v1` or has to be provided on creation
    ParamProjectDocumentId:
      name: projectDocumentId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of a project document
    ParamUserId:
      name: userId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of a user
    ParamHistoryId:
      name: hid
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of the history entry.
    ParamVendorDigitalSubmissionId:
      name: vendorDigitalSubmissionId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of the vendor digital submission
    ParamVendorLastItem:
      in: query
      name: lastItem
      schema:
        type: string
      description: |
        The name of the last vendor in the list - see the `lastItem` field in the `pagination` object.
      required: false
    ParamVendorSearch:
      in: query
      name: search
      schema:
        type: string
      required: true
      description: |
        Search by `name`, `additionalName`, UID or DUNS

        Requires at least 3 valid characters.
    ParamVendorDocumentId:
      name: vendorDocumentId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of a vendor document
    QueryParamToken:
      name: token
      schema:
        type: string
      in: query
      required: true
      description: authenticate via token in query parameter
    ParamPublicationId:
      name: publicationId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of the publication
    ParamPubDraftId:
      name: pubDraftId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of the publication draft.
    ParamLotId:
      name: lotId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of the lot, can be found in the publication data
    ParamVendorDigitalSubmissionDocumentId:
      name: vendorDigitalSubmissionDocumentId
      schema:
        type: string
        format: uuid
      in: path
      required: true
      description: Id of a vendor digital submission document
