Помилки API звітів про порушення

Звіт про порушення у статусі draft

Заборонено публікувати одразу опубліковані звіти про порушення

POST /contracts/88888888444455556666000000000001/violation_reports HTTP/1.0
Authorization: Bearer broker
{
  "data": {
    "details": {
      "reason": "contractBreach",
      "description": "Постачальник порушив контракт."
    },
    "status": "pending"
  }
}
HTTP/1.0 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Request-ID: 88888888-4444-5555-6666-000000000004
Content-Length: 266
{
  "type": "data-validation",
  "title": "Data Validation Error",
  "details": "Validation errors in body",
  "status": 400,
  "errors": [
    {
      "type": "status_error",
      "loc": [
        "data",
        "status"
      ],
      "msg": "pending should be draft.",
      "input": "pending",
      "ctx": {
        "status": "pending"
      }
    }
  ]
}

Спроба змінити звіт про порушення, додаючи зайві поля, має завершуватися помилкою.

PATCH /violation_reports/88888888444455556666000000000034 HTTP/1.0
Authorization: Bearer broker
{
  "data": {
    "tender_id": "11111111111111111111111111111111",
    "status": "pending",
    "reason": "goodsNonCompliance"
  }
}
HTTP/1.0 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Request-ID: 88888888-4444-5555-6666-00000000000d
Content-Length: 1220
{
  "type": "data-validation",
  "title": "Data Validation Error",
  "details": "Validation errors in body",
  "status": 400,
  "errors": [
    {
      "type": "missing",
      "loc": [
        "data",
        "ViolationReportPatchDetailsRequestData",
        "details"
      ],
      "msg": "Field required",
      "input": {
        "tender_id": "11111111111111111111111111111111",
        "status": "pending",
        "reason": "goodsNonCompliance"
      }
    },
    {
      "type": "extra_forbidden",
      "loc": [
        "data",
        "ViolationReportPatchDetailsRequestData",
        "tender_id"
      ],
      "msg": "Extra inputs are not permitted",
      "input": "11111111111111111111111111111111"
    },
    {
      "type": "extra_forbidden",
      "loc": [
        "data",
        "ViolationReportPatchDetailsRequestData",
        "status"
      ],
      "msg": "Extra inputs are not permitted",
      "input": "pending"
    },
    {
      "type": "extra_forbidden",
      "loc": [
        "data",
        "ViolationReportPatchDetailsRequestData",
        "reason"
      ],
      "msg": "Extra inputs are not permitted",
      "input": "goodsNonCompliance"
    },
    {
      "type": "extra_forbidden",
      "loc": [
        "data",
        "ViolationReportPublishRequestData",
        "tender_id"
      ],
      "msg": "Extra inputs are not permitted",
      "input": "11111111111111111111111111111111"
    },
    {
      "type": "extra_forbidden",
      "loc": [
        "data",
        "ViolationReportPublishRequestData",
        "reason"
      ],
      "msg": "Extra inputs are not permitted",
      "input": "goodsNonCompliance"
    }
  ]
}

Зміна звіту про порушення без внесення змін має бути успішною, а значення dateModified має залишатися таким самим.

PATCH /violation_reports/88888888444455556666000000000034 HTTP/1.0
Authorization: Bearer broker
{
  "data": {
    "details": {
      "reason": "contractBreach",
      "description": "Постачальник порушив контракт."
    }
  }
}
HTTP/1.0 200 OK
Content-Type: application/json; charset=utf-8
X-Request-ID: 88888888-4444-5555-6666-00000000000e
Content-Length: 1764
{
  "data": {
    "details": {
      "reason": "contractBreach",
      "description": "Постачальник порушив контракт.",
      "dateModified": "2025-10-12T15:35:35+03:00"
    },
    "id": "88888888444455556666000000000034",
    "violationReportID": "UA-D-2025-10-12-000001",
    "status": "draft",
    "tender_id": "88888888444455556666000000000002",
    "contract_id": "88888888444455556666000000000001",
    "dateCreated": "2025-10-12T15:35:35+03:00",
    "dateModified": "2025-10-12T15:35:35+03:00",
    "author": {
      "name": "Adam Bryan",
      "identifier": {
        "id": "534962516",
        "scheme": "UA-EDR"
      },
      "address": {
        "streetAddress": "298 Michael Street Apt. 869",
        "postalCode": "66552",
        "countryName": "Chad"
      },
      "contactPoint": {
        "name": "Nathan Lee",
        "email": "marc75@example.org",
        "telephone": "560.702.9241x61926",
        "faxNumber": "8314738249",
        "url": "http://www.lucero-collier.com/"
      },
      "kind": "general"
    },
    "defendants": [
      {
        "name": "Hannah Peterson",
        "identifier": {
          "id": "500071620",
          "scheme": "UA-EDR"
        },
        "address": {
          "streetAddress": "81790 Connie Islands Suite 835",
          "postalCode": "87381",
          "countryName": "Qatar"
        },
        "contactPoint": {
          "name": "Chase Simpson",
          "email": "jerry22@example.com",
          "telephone": "(381)680-2072",
          "faxNumber": "461.576.2320x55262",
          "url": "https://wilson-schneider.com/"
        },
        "scale": "micro"
      }
    ],
    "authority": {
      "name": "Nicole Schmidt",
      "identifier": {
        "id": "K94288046",
        "scheme": "UA-EDR"
      },
      "address": {
        "streetAddress": "8891 Eric Station",
        "postalCode": "83706",
        "countryName": "Argentina"
      },
      "contactPoint": {
        "name": "Jeremy Wood",
        "email": "shane44@example.net",
        "telephone": "570.847.0352x0101",
        "faxNumber": "824.553.4561x9450",
        "url": "http://www.roth.com/"
      },
      "kind": "special"
    }
  }
}

DefendantStatement і Decision у статусі draft

Якщо звіт про порушення має статус draft, він ще не є публічним.

GET /violation_reports/88888888444455556666000000000034 HTTP/1.0
Authorization: Bearer broker
HTTP/1.0 200 OK
Content-Type: application/json; charset=utf-8
X-Request-ID: 88888888-4444-5555-6666-000000000006
Content-Length: 1764
{
  "data": {
    "details": {
      "reason": "contractBreach",
      "description": "Постачальник порушив контракт.",
      "dateModified": "2025-10-12T15:35:35+03:00"
    },
    "id": "88888888444455556666000000000034",
    "violationReportID": "UA-D-2025-10-12-000001",
    "status": "draft",
    "tender_id": "88888888444455556666000000000002",
    "contract_id": "88888888444455556666000000000001",
    "dateCreated": "2025-10-12T15:35:35+03:00",
    "dateModified": "2025-10-12T15:35:35+03:00",
    "author": {
      "name": "Adam Bryan",
      "identifier": {
        "id": "534962516",
        "scheme": "UA-EDR"
      },
      "address": {
        "streetAddress": "298 Michael Street Apt. 869",
        "postalCode": "66552",
        "countryName": "Chad"
      },
      "contactPoint": {
        "name": "Nathan Lee",
        "email": "marc75@example.org",
        "telephone": "560.702.9241x61926",
        "faxNumber": "8314738249",
        "url": "http://www.lucero-collier.com/"
      },
      "kind": "general"
    },
    "defendants": [
      {
        "name": "Hannah Peterson",
        "identifier": {
          "id": "500071620",
          "scheme": "UA-EDR"
        },
        "address": {
          "streetAddress": "81790 Connie Islands Suite 835",
          "postalCode": "87381",
          "countryName": "Qatar"
        },
        "contactPoint": {
          "name": "Chase Simpson",
          "email": "jerry22@example.com",
          "telephone": "(381)680-2072",
          "faxNumber": "461.576.2320x55262",
          "url": "https://wilson-schneider.com/"
        },
        "scale": "micro"
      }
    ],
    "authority": {
      "name": "Nicole Schmidt",
      "identifier": {
        "id": "K94288046",
        "scheme": "UA-EDR"
      },
      "address": {
        "streetAddress": "8891 Eric Station",
        "postalCode": "83706",
        "countryName": "Argentina"
      },
      "contactPoint": {
        "name": "Jeremy Wood",
        "email": "shane44@example.net",
        "telephone": "570.847.0352x0101",
        "faxNumber": "824.553.4561x9450",
        "url": "http://www.roth.com/"
      },
      "kind": "special"
    }
  }
}

Спроба опублікувати заяву відповідача має завершуватися помилкою.

POST /violation_reports/88888888444455556666000000000034/defendantStatements HTTP/1.0
Authorization: Bearer broker
{
  "data": {
    "description": "В усьому винні бобри. Обіцяли, що більше не будуть."
  }
}
HTTP/1.0 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 189
{
  "type": "http-bad-request",
  "title": "Bad Request",
  "details": "Can add defendantStatement only during defendantPeriod.",
  "status": 400,
  "now": "2023-10-10T01:00:00+03:00",
  "period": null
}

Спроба додати документ заяви відповідача також має завершуватися помилкою.

POST /violation_reports/88888888444455556666000000000034/defendantStatements HTTP/1.0
Authorization: Bearer broker
{
  "data": {
    "description": "В усьому винні бобри. Обіцяли, що більше не будуть."
  }
}
HTTP/1.0 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 189
{
  "type": "http-bad-request",
  "title": "Bad Request",
  "details": "Can add defendantStatement only during defendantPeriod.",
  "status": 400,
  "now": "2023-10-10T01:00:00+03:00",
  "period": null
}

Спроба опублікувати рішення має завершуватися помилкою.

POST /violation_reports/88888888444455556666000000000034/decisions HTTP/1.0
Authorization: Bearer broker
{
  "data": {
    "resolution": "declinedNoViolation",
    "description": "Комісія дійшла висновку, що ці карти не підпадають під гриф \"таємно\" або \"для службового користування\"."
  }
}
HTTP/1.0 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 189
{
  "type": "http-bad-request",
  "title": "Bad Request",
  "details": "Can change decision only after defendantPeriod.endDate.",
  "status": 400,
  "now": "2023-10-10T01:00:00+03:00",
  "period": null
}

Спроба додати документ рішення також має завершуватися помилкою.

POST /violation_reports/88888888444455556666000000000034/decisions/11111111111111111111111111111111/documents HTTP/1.0
Authorization: Bearer broker
{
  "data": {
    "title": "sign.p7s",
    "url": "http://ds.k8s.prozorro.local/get/8888888844445555666600000000000b?Signature=pmBa12rHL%2Bcw4rVkxiC84Hm6ypCJhsEjatCayJ4QRTwHRRxeTqngrgWizWCmqlGQlt2%2FfNk%2FWeJRtZal7%2BFtAQ%3D%3D&KeyID=a8968c46",
    "hash": "md5:00000000000000000000000000000000",
    "format": "application/pkcs7-signature",
    "documentType": "violationReportSignature"
  }
}
HTTP/1.0 404 Not Found
Content-Type: application/json; charset=utf-8
Content-Length: 97
{
  "type": "http-not-found",
  "title": "Not Found",
  "details": "decision not found.",
  "status": 404
}