{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenAPI definition",
    "version": "v0"
  },
  "servers": [
    {
      "url": "https://irz.arimr.gov.pl/api/drob",
      "description": "Środowisko produkcyjne IRZplus"
    }
  ],
  "paths": {
    "/dokument/api/prod/zuzd": {
      "post": {
        "tags": [
          "zwierzeta-drobiowe-api-prod-controller"
        ],
        "operationId": "zlozDyspozycjeZUZD_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DyspozycjaZUZD"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ZlozenieDyspozycjiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/zdarzenia/api/prod/zdarzeniadrob": {
      "get": {
        "tags": [
          "dane-zdarzen-drobiowatych-api-prod-controller"
        ],
        "operationId": "pobierzZwierzeta_5",
        "parameters": [
          {
            "name": "request",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PobieranieZdarzenApiRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PobieranieZdarzenApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/dokument/api/prod/dokumentyZlozone": {
      "get": {
        "tags": [
          "zwierzeta-drobiowe-api-prod-controller"
        ],
        "operationId": "pobierzDokument_1",
        "parameters": [
          {
            "name": "request",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PobieranieDokumentuApiRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PobieranieDokumentuResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "KodOpisWartosciDto": {
        "type": "object",
        "properties": {
          "kod": {
            "type": "string"
          },
          "opis": {
            "type": "string"
          }
        }
      },
      "BazowaPozycja": {
        "type": "object",
        "properties": {
          "lp": {
            "type": "integer",
            "format": "int64"
          },
          "statusPozycji": {
            "type": "string",
            "enum": [
              "ZATWIERDZONA",
              "DO_ZATWIERDZENIA",
              "POMINIETA"
            ]
          }
        }
      },
      "BazoweZgloszenie": {
        "type": "object",
        "properties": {
          "pozycje": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BazowaPozycja"
            }
          },
          "czyKorekta": {
            "type": "boolean"
          }
        }
      },
      "BladWalidacji": {
        "type": "object",
        "properties": {
          "identyfikator": {
            "type": "string"
          },
          "kodBledu": {
            "type": "string"
          },
          "komunikat": {
            "type": "string"
          },
          "typBledu": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "kodWystapieniaBledu": {
            "type": "string"
          },
          "czyUzasadniony": {
            "type": "boolean"
          },
          "uzasadnienie": {
            "type": "string"
          },
          "regula": {
            "type": "string"
          },
          "czyUzasadnialny": {
            "type": "boolean"
          }
        }
      },
      "BladWalidacjiPozycji": {
        "type": "object",
        "properties": {
          "identyfikator": {
            "type": "string"
          },
          "kodBledu": {
            "type": "string"
          },
          "komunikat": {
            "type": "string"
          },
          "typBledu": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "kodWystapieniaBledu": {
            "type": "string"
          },
          "czyUzasadniony": {
            "type": "boolean"
          },
          "uzasadnienie": {
            "type": "string"
          },
          "regula": {
            "type": "string"
          },
          "czyUzasadnialny": {
            "type": "boolean"
          },
          "numerPozycji": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "WynikWalidacjiZdarzenia": {
        "type": "object",
        "properties": {
          "etapWalidacji": {
            "type": "string"
          },
          "bledyWalidacjiZdarzenia": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BladWalidacji"
            }
          },
          "bledyWalidacjiPozycji": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BladWalidacjiPozycji"
            }
          }
        }
      },
      "BladWalidacjiDTO": {
        "type": "object",
        "properties": {
          "kodBledu": {
            "type": "string"
          },
          "komunikat": {
            "type": "string"
          }
        }
      },
      "ZlozenieDyspozycjiResponse": {
        "type": "object",
        "properties": {
          "komunikat": {
            "type": "string"
          },
          "bledy": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BladWalidacjiDTO"
            }
          },
          "numerDokumentu": {
            "type": "string"
          }
        }
      },
      "DyspozycjaZUZD": {
        "required": [
          "numerProducenta",
          "zgloszenie"
        ],
        "type": "object",
        "properties": {
          "komorkaOrganizacyjna": {
            "type": "string",
            "description": "Komórka organizacyjna ARiMR, do której składana jest dyspozycja"
          },
          "numerProducenta": {
            "type": "string",
            "description": "Numer producenta, który składa dyspozycję"
          },
          "zgloszenie": {
            "$ref": "#/components/schemas/ZgloszenieZUZDDTO"
          }
        }
      },
      "PozycjaZUZDDTO": {
        "type": "object",
        "properties": {
          "lp": {
            "type": "integer",
            "format": "int64"
          },
          "statusPozycji": {
            "type": "string",
            "enum": [
              "ZATWIERDZONA",
              "DO_ZATWIERDZENIA",
              "POMINIETA"
            ]
          },
          "typZdarzenia": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "numerIdenPartiiDrobiu": {
            "type": "string"
          },
          "dataZdarzenia": {
            "type": "string",
            "format": "date"
          },
          "przyjeteZDzialalnosci": {
            "type": "string"
          },
          "dataPrzyjeciaDoZakladu": {
            "type": "string",
            "format": "date"
          },
          "liczbaDrobiu": {
            "type": "integer",
            "format": "int32"
          },
          "liczbaJajWylegowych": {
            "type": "integer",
            "format": "int32"
          },
          "kategoriaJajWylegowych": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "masaCialaDrobiuJajWylegowych": {
            "type": "number"
          },
          "krajWwozu": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "uuid": {
            "type": "string"
          }
        }
      },
      "ZgloszenieZUZDDTO": {
        "type": "object",
        "properties": {
          "pozycje": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PozycjaZUZDDTO"
            }
          },
          "czyKorekta": {
            "type": "boolean"
          },
          "numerZakladuPrzetworczegoLubSpalarni": {
            "type": "string"
          },
          "gatunek": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          }
        }
      },
      "ZdarzenieDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "numerIdentyfikacyjnyZwierzecia": {
            "type": "string"
          },
          "gatunek": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "typZdarzenia": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "stanZdarzenia": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "dataZdarzenia": {
            "type": "string",
            "format": "date"
          },
          "dataKomplementarna": {
            "type": "string",
            "format": "date"
          },
          "dataWplywuDoArimr": {
            "type": "string",
            "format": "date"
          },
          "typDokumentu": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "numerProducenta": {
            "type": "string"
          },
          "producentZglaszajacy": {
            "type": "string"
          },
          "producentKomplementarny": {
            "type": "string"
          },
          "wynikPrzetwarzania": {
            "$ref": "#/components/schemas/WynikWalidacjiZdarzenia"
          },
          "zglaszajacaDzialalnosc": {
            "type": "string"
          },
          "komplementarnaDzialalnosc": {
            "type": "string"
          },
          "idDokumentuKancelaryjnego": {
            "type": "integer",
            "format": "int64"
          },
          "doDzialalnosci": {
            "type": "string"
          },
          "numerDokumentuKorekty": {
            "type": "string"
          },
          "numerDokumentu": {
            "type": "string"
          },
          "zdzialalnosci": {
            "type": "string"
          }
        }
      },
      "PobieranieZdarzenApiResponse": {
        "type": "object",
        "properties": {
          "komunikat": {
            "type": "string",
            "description": "Komunikat"
          },
          "listaZdarzenie": {
            "type": "array",
            "description": "Lista zdarzeń",
            "items": {
              "$ref": "#/components/schemas/ZdarzenieDTO"
            }
          }
        },
        "description": "Response pobierania zdarzeń przez API produkcyjne"
      },
      "PobieranieZdarzenApiRequest": {
        "type": "object",
        "properties": {
          "numerProducenta": {
            "type": "string",
            "description": "Numer producenta"
          },
          "numerDzialalnosci": {
            "type": "string",
            "description": "Numer działalności"
          },
          "numerPartiiDrobiu": {
            "type": "string",
            "description": "Numer partii"
          },
          "gatunek": {
            "type": "string",
            "description": "Kod wartości słownikowej – Gatunek (SIA-SL02125)"
          },
          "typZdarzenia": {
            "type": "string",
            "description": "Kod wartości słownikowej – Typ zdarzenia (SIA-SL02126)"
          },
          "stanZdarzenia": {
            "type": "string",
            "description": "Kod wartości słownikowej – Stan zdarzenia (SIA-SL02194)"
          },
          "dataZdarzeniaOd": {
            "type": "string",
            "description": "Data zdarzenia od",
            "format": "date"
          },
          "dataZdarzeniaDo": {
            "type": "string",
            "description": "Data zdarzenia do",
            "format": "date"
          }
        },
        "description": "Request pobierania zdarzeń przez API produkcyjne"
      },
      "PobieranieDokumentuApiRequest": {
        "required": [
          "numerDokumentu",
          "numerProducenta"
        ],
        "type": "object",
        "properties": {
          "numerProducenta": {
            "type": "string",
            "description": "Numer producenta, w kontekście którego odbywa się pobranie danych"
          },
          "numerDokumentu": {
            "type": "string",
            "description": "Numer dyspozycji (dokumentu)"
          }
        },
        "description": "Request pobierania dokumentu"
      },
      "PobieranieDokumentuResponse": {
        "type": "object",
        "properties": {
          "komunikat": {
            "type": "string",
            "description": "Komunikat"
          },
          "numerDokumentu": {
            "type": "string",
            "description": "Numer dokumentu"
          },
          "szczegoly": {
            "$ref": "#/components/schemas/BazoweZgloszenie"
          },
          "blad": {
            "type": "array",
            "description": "Bład",
            "items": {
              "$ref": "#/components/schemas/PobieranieDokumentuResponse"
            }
          }
        },
        "description": "Wynik pobierania dokumentu"
      }
    }
  }
}