swagger: '2.0'
info:
  title: Moduł Przyjmowania i Zabezpieczania Ofert
  description: >-
    Moduł Przyjmowania i Zabezpieczania Ofert (MPiZO) jest odpowiedzialny za
    przyjmowanie i zabezpieczanie ofert. W szczególności będzie
    przyjmował zaszyfrowane i podpisane podpisem kwalifikowanym dokumenty
    przygotowane przez Wykonawców, składane poprzez Portal e-Usług.
  version: '1.0'
schemes:
  - https
host: api.ezamowienia.gov.pl
basePath: /mpizo
consumes:
  - application/json
produces:
  - application/json
tags:
  - name: Składanie ofert
  - name: Pobranie ofert
  - name: Otwarcie ofert
  - name: Wybór ofert
  - name: Zaproszenie do składania ofert
paths:
  '/oferty':
    post:
      summary: Utwórz ofertę
      description: >-
        Metoda służy do złożenia oferty i otrzymania jej identyfikatora.
        Utworzenie identyfikatora odbywa się poprzez wysłanie wstępnego żądania
        zawierającego hash nowej oferty. W odpowiedzi zwracane jest ID
        nowoutworzonej oferty.
      operationId: UtworzOferte
      tags:
        - Składanie ofert
      parameters:
        - name: body
          description: Informacje o ofercie
          in: body
          required: true
          schema:
            $ref: '#/definitions/UtworzOferteRequest'
      responses:
        '201':
          description: Utworzono ofertę
          schema:
            $ref: '#/definitions/UtworzOferteResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Postępowanie nie istnieje
          schema:
            $ref: '#/definitions/Blad'
        '409':
          description: Oferta o podanym hashu już istnieje
          schema:
            $ref: '#/definitions/Blad'
  '/oferty/postepowanie/{idPostepowania}':
    parameters:
      - $ref: '#/parameters/IdPostepowania'
    get:
      summary: Pobierz oferty
      description: >-
        Metoda służy do pobrania listy wszystkich ofert, które zostały
        złożone dla danego postępowania. Oferty może pobrać Zamawiający,
        tylko gdy upłynął termin składania ofert.
      operationId: PobierzOferty
      tags:
        - Pobranie ofert
      responses:
        '200':
          description: Oferty postępowania
          schema:
            $ref: '#/definitions/PobierzOfertyResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Postępowanie nie istnieje
          schema:
            $ref: '#/definitions/Blad'
  '/oferty/postepowanie/{idPostepowania}/potwierdzenie':
    parameters:
      - $ref: '#/parameters/IdPostepowania'
    post:
      summary: Prześlij potwierdzenie pobrania ofert
      description: >-
        Metoda służy do przesłania potwierdzenia pobrania ofert postępowania.
      operationId: PotwierdzeniePobraniaOfert
      tags:
        - Potwierdzenie pobrania ofert
      parameters:
        - name: body
          description: Informacje o ofertach
          in: body
          required: true
          schema:
            $ref: '#/definitions/PotwierdzniePobraniaOfertRequest'
      responses:
        '200':
          description: Przyjęto potwierdzenie pobrania ofert
          schema:
            $ref: '#/definitions/PotwierdzniePobraniaOfertResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Postępowanie nie istnieje
          schema:
            $ref: '#/definitions/Blad'
  '/oferty/postepowanie/{idPostepowania}/wyborOferty':
    parameters:
      - $ref: '#/parameters/IdPostepowania'
    post:
      summary: Prześlij dane z wyboru oferty
      description: >-
        Metoda służy do przesłania danych z wyboru oferty.
      operationId: DaneZWyboruOfert
      tags:
        - Wybór ofert
      parameters:
        - name: body
          description: Informacje o wyborze oferty
          in: body
          required: true
          schema:
            $ref: '#/definitions/DaneZWyboruOfertRequest'
      responses:
        '201':
          description: Przyjęto dane z wyboru ofert
          schema:
            $ref: '#/definitions/DaneZWyboruOfertResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Postępowanie nie istnieje
          schema:
            $ref: '#/definitions/Blad'
  '/oferty/postepowanie/{idPostepowania}/rezygnacja':
    parameters:
      - $ref: '#/parameters/IdPostepowania'
    post:
      summary: Prześlij rezygnację ze składania oferty
      description: >-
        Metoda służy do przesłania rezygnacji ze składania oferty.
      operationId: RezygnacjaZeSkladaniaOferty
      tags:
        - Składanie ofert
      parameters:
        - name: body
          description: Informacje o rezygnacji
          in: body
          required: true
          schema:
            $ref: '#/definitions/RezygnacjaZeSkladaniaOfertyRequest'
      responses:
        '200':
          description: Przyjęto rezygnację ze składania oferty
          schema:
            $ref: '#/definitions/RezygnacjaZeSkladaniaOfertyResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Postępowanie nie istnieje
          schema:
            $ref: '#/definitions/Blad'
  '/oferty/{id}':
    parameters:
      - $ref: '#/parameters/IdOferty'
    put:
      summary: Prześlij ofertę
      description: >-
        Metoda służy do przesyłania zaszyfrowanej treści oferty dla podanego
        postępowania. Ofertę może wysłać Wykonawca, po uprzednim utworzeniu
        oferty i otrzymaniu identyfikatora oferty.
      operationId: PrzeslijOferte
      tags:
        - Składanie ofert
      parameters:
        - name: body
          description: Zaszyfrowana oferta
          in: body
          required: true
          schema:
            $ref: '#/definitions/PrzeslijOferteRequest'
      responses:
        '200':
          description: Zapisano ofertę
          schema:
            $ref: '#/definitions/PrzeslijOferteResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Oferta nie istnieje
          schema:
            $ref: '#/definitions/Blad'
    delete:
      summary: Wycofaj ofertę
      description: >-
        Metoda umożliwia wycofanie oferty. Wycofanie nie będzie skuteczne, gdy
        żądanie zgłoszono po terminie składania ofert, bądź oferent nie
        przeszedł pozytywnie weryfikacji.
      operationId: WycofajOferte
      tags:
        - Składanie ofert
      responses:
        '200':
          description: Wycofano ofertę
          schema:
            $ref: '#/definitions/WycofajOferteResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Oferta nie istnieje
          schema:
            $ref: '#/definitions/Blad'
        '409':
          description: Nie można wycofać oferty
          schema:
            $ref: '#/definitions/Blad'
    get:
      summary: Pobierz ofertę
      description: >-
        Metoda służy do pobrania zaszyfrowanej oferty. Pobranie jest
        możliwe przez Zamawiającego, tylko po upłynięciu terminu składania
        ofert.
      operationId: PobierzOferte
      tags:
        - Pobranie ofert
      responses:
        '200':
          description: Oferta
          schema:
            $ref: '#/definitions/PobierzOferteResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Oferta nie istnieje
          schema:
            $ref: '#/definitions/Blad'
  '/oferty/{id}/zmiana/{hash}':
    parameters:
      - $ref: '#/parameters/IdOferty'
      - $ref: '#/parameters/Hash'
    put:
      summary: Zmień ofertę
      description: >-
        Metoda umożliwia zmianę oferty. Zmiana polega na wycofaniu
        istniejącej oferty i złożeniu nowej oferty. Aby
        wycofanie starej oferty było skuteczne, należy przesłać zaszyfrowaną
        ofertę w żądaniu. Zmiana nie będzie skuteczna, gdy żądanie
        zgłoszono po terminie składania ofert, bądź oferent nie
        przeszedł pozytywnie weryfikacji.
      operationId: ZmienOferte
      tags:
        - Składanie ofert
      parameters:
        - name: body
          description: Zaszyfrowana oferta
          in: body
          required: true
          schema:
            $ref: '#/definitions/PrzeslijOferteRequest'
      responses:
        '200':
          description: Zmieniono ofertę
          schema:
            $ref: '#/definitions/ZmienOferteResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Oferta nie istnieje
          schema:
            $ref: '#/definitions/Blad'
        '409':
          description: Nie można zmienić oferty
          schema:
            $ref: '#/definitions/Blad'
  '/oferty/{id}/epo':
    parameters:
      - $ref: '#/parameters/IdOferty'
    get:
      summary: Pobierz EPO
      description: >-
        Metoda umożliwia pobranie Elektronicznego Potwierdzenia Otrzymania (EPO)
        dla zadanej oferty.
      operationId: PobierzEpo
      tags:
        - Składanie ofert
      responses:
        '200':
          description: EPO
          schema:
            $ref: '#/definitions/PobierzEpoResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Oferta nie istnieje
          schema:
            $ref: '#/definitions/Blad'
  '/oferty/postepowanie/{idPostepowania}/daneZZaproszeniaDoSkladaniaOfert':
    parameters:
      - $ref: '#/parameters/IdPostepowania'
    post:
      summary: Wysłanie danych o wysłanych zaproszeniach do składania ofert
      description: >-
        Metoda służy do przesłania danych o wysłanych zaproszeniach do składania ofert.
      operationId: DaneOWyslanychZaproszeniachDoSkladaniaOfert
      tags:
        - Zaproszenie do składania ofert
      parameters:
        - name: body
          description: Dane o wysłanych zaproszeniach do składania ofert
          in: body
          required: true
          schema:
            $ref: '#/definitions/DaneZZaproszeniaDoSkladaniaOfertRequest'
      responses:
        '201':
          description: Przyjęto dane zaproszenia do składania ofert
          schema:
            $ref: '#/definitions/ZaproszenieDoSkladaniaOfertResponse'
        '400':
          description: Niepoprawne żądanie
          schema:
            $ref: '#/definitions/Blad'
        '401':
          description: Niezalogowany
          schema:
            $ref: '#/definitions/Blad'
        '403':
          description: Brak uprawnień
          schema:
            $ref: '#/definitions/Blad'
        '404':
          description: Postępowanie nie istnieje
          schema:
            $ref: '#/definitions/Blad'
parameters:
  IdPostepowania:
    name: idPostepowania
    in: path
    description: Identyfikator postępowania
    required: true
    type: string
    format: uuid
  IdOferty:
    name: id
    in: path
    description: Identyfikator oferty
    required: true
    type: string
    format: uuid
  Hash:
    name: hash
    in: path
    description: Hash oferty w formie base64
    required: true
    type: string
    format: byte
definitions:
  IdPostepowania:
    description: Identyfikator postępowania
    type: string
    format: uuid
  IdOferty:
    description: Identyfikator oferty
    type: string
    format: uuid
  IdOfertyNaPrzedmiotZamowienia:
    description: Identyfikator oferty na przedmiot zamówienia
    type: string
    format: uuid
  UtworzOferteRequest:
    type: object
    required:
      - idPostepowania
      - hash
      - typ
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      hash:
        description: Hash oferty w formie base64
        type: string
        format: byte
      rodzaj:
        $ref: '#/definitions/RodzajOferty'
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      hash: NEYUeineC/Oxpv8rEZQ0rDdIICcSVWt85yRaWHXmcVjIR0g3y7
  UtworzOferteResponse:
    type: object
    required:
      - idPostepowania
      - idOferty
      - czasUtworzeniaOferty
      - links
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      idOferty:
        $ref: '#/definitions/IdOferty'
      czasUtworzeniaOferty:
        description: Znacznik czasu utworzenia oferty
        type: string
        format: date-time
      uplynalTermin:
        description: Informacja o upłynięciu terminu
        type: object
        required:
          - czasOtrzymaniaOferty
          - terminSkladaniaOfert
        properties:
          czasOtrzymaniaOferty:
            description: Znacznik czasu otrzymania oferty
            type: string
            format: date-time
          terminSkladaniaOfert:
            description: Znacznik czasu terminu składania ofert
            type: string
            format: date-time
      links:
        $ref: '#/definitions/Links'
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      idOferty: 1e07ba0b-4d8c-43c0-a222-86e0e3118c36
      czasUtworzeniaOferty: '2018-04-05T11:51:20.123'
      uplynalTermin:
        czasOtrzymaniaOferty: '2018-04-05T11:51:20.123'
        terminSkladaniaOfert: '2018-04-05T11:51:20.123'
      links:
        - rel: PobierzEpo
          action: GET
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36/epo
        - rel: PrzeslijOferte
          action: PUT
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36
        - rel: ZmienOferte
          action: PUT
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36/zmiana
        - rel: WycofajOferte
          action: DELETE
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36
  PobierzOfertyResponse:
    type: object
    required:
      - idPostepowania
      - czasWydaniaOfert
      - links
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      czasWydaniaOfert:
        description: Znacznik czasu wydania ofert
        type: string
        format: date-time
      oferty:
        description: Oferty
        type: array
        items:
          type: object
          required:
            - idOferty
            - hash
          properties:
            idOferty:
              $ref: '#/definitions/IdOferty'
            hash:
              description: Hash oferty w formie base64
              type: string
              format: byte
      links:
        $ref: '#/definitions/Links'
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      czasWydaniaOfert: '2018-04-05T11:51:20.123'
      oferty:
        - idOferty: 1e07ba0b-4d8c-43c0-a222-86e0e3118c36
          hash: NEYUeineC/Oxpv8rEZQ0rDdIICcSVWt85yRaWHXmcVjIR0g3y7
      links:
        - rel: PobierzOferte
          action: GET
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36
  PrzeslijOferteRequest:
    type: object
    required:
      - oferta
    properties:
      oferta:
        description: Zaszyfrowana zawartość oferty
        type: string
        format: binary
      decyzjaOZlozeniuPoTerminie:
        description: Decyzja o złożeniu oferty po terminie składania ofert
        type: boolean
    example:
      oferta: NEYUeineC/Oxpv8rEZQ0rDdIICcSVWt85yRaWHXmcVjIR0g3y7
  PrzeslijOferteResponse:
    type: object
    required:
      - idPostepowania
      - idOferty
      - czasOtrzymaniaOferty
      - links
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      idOferty:
        $ref: '#/definitions/IdOferty'
      czasOtrzymaniaOferty:
        description: Znacznik czasu otrzymania oferty
        type: string
        format: date-time
      links:
        $ref: '#/definitions/Links'
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      idOferty: 1e07ba0b-4d8c-43c0-a222-86e0e3118c36
      czasOtrzymaniaOferty: '2018-04-05T11:51:20.123'
      links:
        - rel: PobierzEpo
          action: GET
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36/epo
        - rel: ZmienOferte
          action: PUT
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36/zmiana
        - rel: WycofajOferte
          action: DELETE
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36
  WycofajOferteResponse:
    type: object
    required:
      - idPostepowania
      - idOferty
      - czasWycofaniaOferty
      - links
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      idOferty:
        $ref: '#/definitions/IdOferty'
      czasWycofaniaOferty:
        description: Znacznik czasu wycofania oferty
        type: string
        format: date-time
      powodOdmowyWycofaniaOferty:
        description: Powód braku możliwości wycofania oferty
        type: string
      links:
        $ref: '#/definitions/Links'
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      idOferty: 1e07ba0b-4d8c-43c0-a222-86e0e3118c36
      czasWycofaniaOferty: '2018-04-05T11:51:20.123'
      links:
        - rel: PobierzEpo
          action: GET
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36/epo
        - rel: UtworzOferte
          action: POST
          href: /oferty
  ZmienOferteResponse:
    type: object
    required:
      - idPostepowania
      - idOferty
      - czasZmianyOferty
      - links
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      idOferty:
        $ref: '#/definitions/IdOferty'
      czasZmianyOferty:
        description: Znacznik czasu zmiany oferty
        type: string
        format: date-time
      powodOdmowyZmianyOferty:
        description: Powód braku możliwości zmiany oferty
        type: string
      links:
        $ref: '#/definitions/Links'
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      idOferty: 1e07ba0b-4d8c-43c0-a222-86e0e3118c36
      czasZmianyOferty: '2018-04-05T11:51:20.123'
      links:
        - rel: PobierzEpo
          action: GET
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36/epo
        - rel: UtworzOferte
          action: POST
          href: /oferty
  PobierzOferteResponse:
    type: object
    required:
      - idPostepowania
      - idOferty
      - czasWydaniaOferty
      - oferta
      - links
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      idOferty:
        $ref: '#/definitions/IdOferty'
      czasWydaniaOferty:
        description: Znacznik czasu wydania oferty
        type: string
        format: date-time
      oferta:
        description: Zaszyfrowana zawartość oferty
        type: string
      links:
        $ref: '#/definitions/Links'
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      idOferty: 1e07ba0b-4d8c-43c0-a222-86e0e3118c36
      czasWydaniaOferty: '2018-04-05T11:51:20.123'
      oferta: NEYUeineC/Oxpv8rEZQ0rDdIICcSVWt85yRaWHXmcVjIR0g3y7
      links:
        - rel: PobierzOferty
          action: GET
          href: /oferty/e63bf835-224a-4b3b-a564-160640911f0a
  PobierzEpoResponse:
    type: object
    required:
      - idPostepowania
      - idOferty
      - czasOtrzymaniaOferty
      - czasWygenerowaniaEpo
      - links
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      idOferty:
        $ref: '#/definitions/IdOferty'
      czasOtrzymaniaOferty:
        description: Znacznik czasu otrzymania oferty
        type: string
        format: date-time
      czasWygenerowaniaEpo:
        description: Znacznik czasu wygenerowania EPO
        type: string
        format: date-time
      links:
        $ref: '#/definitions/Links'
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      idOferty: 1e07ba0b-4d8c-43c0-a222-86e0e3118c36
      czasOtrzymaniaOferty: '2018-04-05T11:51:20.123'
      czasWygenerowaniaEpo: '2018-04-05T11:51:20.123'
      links:
        - rel: PrzeslijOferte
          action: PUT
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36
        - rel: ZmienOferte
          action: PUT
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36/zmiana
        - rel: WycofajOferte
          action: DELETE
          href: /oferty/1e07ba0b-4d8c-43c0-a222-86e0e3118c36
  DaneZOtwarciaOfertRequest:
    type: object
    required:
      - czasOtwarciaOfert
      - iloscZlozonychOfert
    properties:
      czasOtwarciaOfert:
        description: Znacznik czasu otwarcia ofert
        type: string
        format: date-time
      iloscZlozonychOfert:
        description: Ile złożono ofert w podanym postępowaniu
        type: integer
      ofertyNaPrzedmiotZamowienia:
        description: Lista ofert
        type: array
        items:
          type: object
          required:
            - punktacja
            - czyStanowiCzescOferty
            - rozstrzygniecie
          properties:
            punktacja:
              description: Ilość zdobytych punktów przez ofertę
              type: integer
            czyStanowiCzescOferty:
              description: Czy stanowi część oferty
              type: boolean
            rozstrzygniecie:
              description: Rozstrzygnięcie
              type: string
              enum:
                - Wybrana
                - Niewybrana
                - Odrzucona
            kryteriaPrzedmiotowe:
              description: Wartości kryteriów przedmiotowych
              type: array
              items:
                type: object
                required:
                  - nazwa
                  - znaczenie
                  - wartosc
                properties:
                  nazwa:
                    description: Nazwa kryterium
                    type: string
                  znaczenie:
                    description: Znaczenie kryterium
                    type: string
                  wartosc:
                    description: Wartość kryterium
                    type: string
    example:
      czasOtwarciaOfert: '2018-04-05T11:51:20.123'
      iloscZlozonychOfert: 4
      ofertyNaPrzedmiotZamowienia:
        - punktacja: 100
          czyStanowiCzescOferty: true
          rozstrzygniecie: Wybrana
          kryteriaPrzedmiotowe:
            - nazwa: Cena
              znaczenie: Cena oferty
              wartosc: '80%'
            - nazwa: Czas dostarczenia
              znaczenie: Czy oferta została dostarczona w terminie
              wartosc: '20%'
  DaneZOtwarciaOfertResponse:
    type: object
    required:
      - idPostepowania
      - czasOtrzymania
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      czasOtrzymania:
        description: Znacznik czasu otrzymania danych z otwarcia ofert
        type: string
        format: date-time
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      czasOtrzymania: '2018-04-05T11:51:20.123'
  PotwierdzniePobraniaOfertRequest:
    type: object
    required:
      - czasPobraniaOfert
      - listaPobranychOfert
    properties:
      czasPobraniaOfert:
        description: Znacznik czasu pobrania ofert
        type: string
        format: date-time
      listaPobranychOfert:
        description: Lista identyfikatorow ofert
        type: array
        minLength: 1
        items:
          $ref: '#/definitions/pobranaOferta'
    example:
      czasPobraniaOfert: '2018-04-05T11:51:20.123'
      listaPobranychOfert:
          - idOferty: 1e07ba0b-4d8c-43c0-a222-86e0e3118c36
            hash: faslkfjasdkljf40
  PotwierdzniePobraniaOfertResponse:
    type: object
    required:
      - idPostepowania
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
  DaneZWyboruOfertRequest:
    type: object
    properties:
      rodzajWybranychOfert:
        $ref: '#/definitions/RodzajOferty'
      dataWyboru:
        description: 'Data wyboru najkorzystniejszej oferty / oceny ofert wstępnych.'
        type: string
        format: date-time
        example: '2019-01-01 00:00:00'
      oferty:
        type: array
        items:
          $ref: '#/definitions/oferta'
        minItems: 0
      selfCleaning:
        $ref: '#/definitions/SelfCleaning'
      wykonawcyWykluczeni:
        type: array
        items:
          type: object
          properties:
            idWykonawcy:
              $ref: '#/definitions/IdWykonawcy'
            podstawaWykluczenia:
              description: 'Podstawa prawna wykluczenia, lub puste jeśli oferta nie była wykluczona.'
              type: string
        minItems: 0
      listaOfertOdrzuconych:
        type: array
        items:
          allOf:
            - $ref: '#/definitions/oferta'
          properties:
            powodOdrzucenia:
              description: 'Podstawa prawna odrzucenia, lub puste jeśli oferta nie była odrzucona.'
              type: string
            czyPowodInnyNizPrzeslankiOKtorychMowaWArt89Ust1:
              description: 'Czy zamawiający odrzucił ofertę na podstawie przesłanek odrzucenia oferty innych niż przesłanki, o których mowa w art. 89 ust. 1 Pzp.'
              type: boolean
      czyAukcja:
        description: 'Czy zamawiający zastosował aukcję elektroniczną – art. 131h ust. 2 Pzp.'
        type: boolean
  SelfCleaning:
    description: 'Jesli tablica jest pusta, albo nie została w ogóle przesłana - żaden z Wykonawców nie skorzystał z self-cleaningu.'
    type: array
    items:
      type: object
      properties:
        idWykonawcy:
          allOf:
            - $ref: '#/definitions/IdWykonawcy'
          description: 'Wykonawca korzystający z self-cleaningu'
        czyUznano:
          description: 'Informacja, czy Zamawiający uznał dowody self-cleaning za wystarczający wobec danego Wykonawcy.'
          type: boolean
    minItems: 0
  oferta:
    type: object
    properties:
      idOfertyNaPrzedmiotZamowienia:
        $ref: '#/definitions/IdOfertyNaPrzedmiotZamowienia'
      punktacja:
        description: 'Punktacja oferty: informacja uzupełniana na etapie otrzymania danych z informacji z wyboru najkorzystniejszej oferty.'
        type: number
        format: double
      ranking:
        description: 'Miejsce w rankingu'
        type: number
      punktacjaZaKryterium:
        type: array
        items:
          type: object
          properties:
            nazwaKryterium:
              type: string
            punktacja:
              type: number
              format: double
        minItems: 1
  DaneZWyboruOfertResponse:
    type: object
    required:
      - idPostepowania
      - czasOtrzymania
    properties:
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
      czasOtrzymania:
        description: Znacznik czasu otrzymania danych z wyboru ofert
        type: string
        format: date-time
    example:
      idPostepowania: e63bf835-224a-4b3b-a564-160640911f0a
      czasOtrzymania: '2018-04-05T11:51:20.123'
  RezygnacjaZeSkladaniaOfertyRequest:
    type: object
    properties:
      hashOferty:
        description: Hash oferty, w formie base64
        type: string
      dataHashOferty:
        description: Data otrzymania hasha oferty
        type: string
        format: date-time
  RezygnacjaZeSkladaniaOfertyResponse:
    type: object
    properties:
      dataRezygnacji:
        description: Data, kiedy przyjęto rezygnację ze składania oferty
        type: string
        format: date-time
  DaneZZaproszeniaDoSkladaniaOfertRequest:
    type: object
    properties:
      wyslaneZaproszenia:
        type: array
        items:
          type: object
          properties:
            dataWyslaniaZaproszenia:
              type: string
              format: date-time
            wykonawca:
              $ref: '#/definitions/IdWykonawcy'
          required:
            - dataWyslaniaZaproszenia
            - wykonawca
      terminSkladaniaOfert:
        type: string
        format: date-time
      urlSiwz:
        type: string
      terminPublikacjiOgloszenia:
        type: string
        format: date-time
      adresURLPublikacjiOgloszenia:
        type: string
      adresSkladaniaOfert:
        type: string
      wymaganyJezykOferty:
        type: string
      kryteriaPrzedmiotoweOfert:
        description: Wartości kryteriów przedmiotowych
        type: array
        items:
          type: object
          required:
            - nazwa
            - waga
            - istotnosc
          properties:
            nazwa:
              description: Nazwa kryterium
              type: string
            waga:
              description: Waga kryterium
              type: string
            istotnosc:
              description: Istotność kryterium
              type: string
      wykonawcyDopuszczeni:
        type: array
        items:
          $ref: '#/definitions/WykonawcyZaproszeni'
      wykonawcyNiedopuszczeni:
        type: array
        items:
          allOf:
            - $ref: '#/definitions/WykonawcyZaproszeni'
          properties:
            czyWniosekWTerminie:
              type: boolean
            oswiadczeniaWgArt26:
              type: string
            niespelnioneWarunkiUdzaluWgArt22:
              type: array
              items:
                type: string
  ZaproszenieDoSkladaniaOfertResponse:
    type: object
    properties:
      dataOtrzymania:
        type: string
        format: date-time
      idPostepowania:
        $ref: '#/definitions/IdPostepowania'
  WykonawcyZaproszeni:
    type: object
    properties:
      idWykonawcy:
        $ref: '#/definitions/IdWykonawcy'
      dataWyslaniaZaproszenia:
        type: string
        format: 'date-time'
      lacznaPunktacja:
        type: number
  IdWykonawcy:
      description: >-
        Identyfikator Wykonawcy używany do jednoznaczego identyfikowania danych
        wykonawcy, jest trzymany w formie GUID.
      type: string
      format: uuid
      example: bc3c9b5d-1d11-412d-8465-8888af5582d6
  RodzajOferty:
    type: string
    enum:
      - Oferta
      - Oferta wstępna
      - Oferta dodatkowa
  Blad:
    description: Błąd
    type: object
    required:
      - blad
    properties:
      blad:
        type: object
        required:
          - id
          - podsystem
          - kod
          - opis
          - czas
        properties:
          id:
            description: Unikalny identyfikator błędu
            type: string
            format: uuid
          podsystem:
            description: ID modułu Platformy, w ramach którego wystąpił błąd
            type: string
          kod:
            description: Kod błędu
            type: string
          opis:
            description: Opis błędu
            type: string
          czas:
            description: Znacznik czasu wystąpienia błędu
            type: string
            format: date-time
    example:
      blad:
        id: e63bf835-224a-4b3b-a564-160640911f0a
        podsystem: MPiZO
        kod: 123
        opis: Szczegółowy opis błędu
        czas: '2018-04-05T11:51:20.123'
  Links:
    description: Odnośniki do zasobów
    type: array
    items:
      description: Odnośnik
      type: object
      required:
        - rel
        - action
        - href
      properties:
        rel:
          description: Nazwa odnośnika do zasobu
          type: string
        action:
          description: Metoda HTTP
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
        href:
          description: Adres zasobu
          type: string
  pobranaOferta:
      type: object
      required:
        - idOferty
        - sumaKontrolnaOferty
      properties:
        idOferty:
          $ref: '#/definitions/IdOferty'
        hash:
          description: Hash oferty w formie base64
          type: string
          format: byte
