From 51b13a4f542334c2a7be396888f68846f6e78ec0 Mon Sep 17 00:00:00 2001 From: "maxim.pakhomov" Date: Fri, 10 Sep 2021 16:13:20 +0300 Subject: [PATCH] fix in docs description of contract disqualification --- .../http/frameworks/mailestone-view.http | 19 ++++++++++++++ .../http/frameworks/patch-milestone-met.http | 25 +++++++++++++++++++ .../post-milestone-disqualification.http | 23 ----------------- .../source/agreements/tutorial_frameworks.rst | 8 ++++-- .../agreements/tutorial_frameworks.po | 22 ++++++++-------- docs/tests/test_agreements.py | 15 ++++++++--- .../tests/agreement_blanks.py | 2 -- .../electroniccatalogue/tests/base.py | 16 +----------- 8 files changed, 73 insertions(+), 57 deletions(-) create mode 100644 docs/source/agreements/http/frameworks/mailestone-view.http create mode 100644 docs/source/agreements/http/frameworks/patch-milestone-met.http delete mode 100644 docs/source/agreements/http/frameworks/post-milestone-disqualification.http diff --git a/docs/source/agreements/http/frameworks/mailestone-view.http b/docs/source/agreements/http/frameworks/mailestone-view.http new file mode 100644 index 0000000000..7804491d96 --- /dev/null +++ b/docs/source/agreements/http/frameworks/mailestone-view.http @@ -0,0 +1,19 @@ +GET /api/2.5/agreements/2c88cbfb9f454f82976cb11006b46885/contracts/391acac5215446eeb6fc77beaa747403/milestones?acc_token=dd875ed1c80d40c38602ee0c12d1374b HTTP/1.0 +Authorization: Bearer token +Host: lb-api-sandbox.prozorro.gov.ua + +Response: 200 OK +Content-Type: application/json +X-Content-Type-Options: nosniff +{ + "data": [ + { + "id": "3fe881cc13824149bb8f655de17cae47", + "type": "activation", + "status": "scheduled", + "dueDate": "2021-05-16T00:00:00+02:00", + "dateModified": "2021-04-01T01:00:00+03:00" + } + ] +} + diff --git a/docs/source/agreements/http/frameworks/patch-milestone-met.http b/docs/source/agreements/http/frameworks/patch-milestone-met.http new file mode 100644 index 0000000000..79f8d87f51 --- /dev/null +++ b/docs/source/agreements/http/frameworks/patch-milestone-met.http @@ -0,0 +1,25 @@ +PATCH /api/2.5/agreements/2c88cbfb9f454f82976cb11006b46885/contracts/391acac5215446eeb6fc77beaa747403/milestones/3fe881cc13824149bb8f655de17cae47?acc_token=dd875ed1c80d40c38602ee0c12d1374b HTTP/1.0 +Authorization: Bearer token +Content-Length: 27 +Content-Type: application/json +Host: lb-api-sandbox.prozorro.gov.ua +DATA: +{ + "data": { + "status": "met" + } +} + +Response: 200 OK +Content-Type: application/json +X-Content-Type-Options: nosniff +{ + "data": { + "id": "3fe881cc13824149bb8f655de17cae47", + "type": "activation", + "status": "met", + "dueDate": "2021-05-16T00:00:00+02:00", + "dateModified": "2021-04-01T01:00:00+03:00" + } +} + diff --git a/docs/source/agreements/http/frameworks/post-milestone-disqualification.http b/docs/source/agreements/http/frameworks/post-milestone-disqualification.http deleted file mode 100644 index 136d237f10..0000000000 --- a/docs/source/agreements/http/frameworks/post-milestone-disqualification.http +++ /dev/null @@ -1,23 +0,0 @@ -POST /api/2.5/agreements/2c88cbfb9f454f82976cb11006b46885/contracts/391acac5215446eeb6fc77beaa747403/milestones?acc_token=dd875ed1c80d40c38602ee0c12d1374b HTTP/1.0 -Authorization: Bearer token -Content-Length: 506 -Content-Type: application/json -Host: lb-api-sandbox.prozorro.gov.ua -DATA: -{ - "data": { - "type": "disqualification", - "documents": [ - { - "hash": "md5:00000000000000000000000000000000", - "title": "milestone.doc", - "format": "application/msword", - "datePublished": "2020-09-08T01:00:00+03:00", - "id": "cd52b90af77e4f5b8cb0f210e83987b5", - "dateModified": "2020-09-08T01:00:00+03:00", - "url": "http://public-docs-sandbox.prozorro.gov.ua/get/a117dbccdbe947eb832962bc34a243b2?Signature=7UD43Grdv0LqSgZPiWN8c73GzI9n4P7qRXNGKGWk2zpiW4%2BFQzKx%2Fw2Qt1Nz2vH8UUYz8GS6ykrhhVDJAMVGDQ%3D%3D&KeyID=a8968c46" - } - ] - } -} - diff --git a/docs/source/agreements/tutorial_frameworks.rst b/docs/source/agreements/tutorial_frameworks.rst index 7f232c9d45..511ab2d386 100644 --- a/docs/source/agreements/tutorial_frameworks.rst +++ b/docs/source/agreements/tutorial_frameworks.rst @@ -60,8 +60,12 @@ For ban contract, you just need to add milestone to contract with status `ban`: Contract disqualification ~~~~~~~~~~~~~~~~~~~~~~~~~ +Let's see our created mailestone. In our mailestone you can see the ``id``. -For disqualification contract, you just need to add milestone to contract with status `disqualification`: +.. include:: http/frameworks/mailestone-view.http + :code: + +When we know ``id`` of our mailestone we can patch contract for disqualification, you just need to patch milestone 'type' : 'activation' to status ``met``: -.. include:: http/frameworks/post-milestone-disqualification.http +.. include:: http/frameworks/patch-milestone-met.http :code: diff --git a/docs/source/locale/uk/LC_MESSAGES/agreements/tutorial_frameworks.po b/docs/source/locale/uk/LC_MESSAGES/agreements/tutorial_frameworks.po index 0f5fcae642..dfc2336804 100644 --- a/docs/source/locale/uk/LC_MESSAGES/agreements/tutorial_frameworks.po +++ b/docs/source/locale/uk/LC_MESSAGES/agreements/tutorial_frameworks.po @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: openprocurement.api 2.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-04-07 14:32+0300\n" +"POT-Creation-Date: 2021-09-09 10:53+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.9.0\n" +"Generated-By: Babel 2.9.1\n" msgid "Tutorial" msgstr "Туторіал" @@ -35,14 +35,8 @@ msgstr "Угода автоматично переноситься з модул msgid "Creating agreement" msgstr "Створення реєстру" -msgid "" -"Let's say that we have conducted framework, submission and qualification and it has ``active`` status. " -"When the framework is active and you change qualification status to active, system **automatically** created agreement(from framework) with contract(from qualification)." - -msgstr "" -"Припустимо, що є кваліфікація, заявка та рішення по заявці в статусах ``active``. " -"Коли заявка в стаусі `active` і ви оновлюєте рішення по заявці до `active` статусу " -"система **автоматично** створює реєстр(з кваліфікації) з контрактом(з рішення по заявці)." +msgid "Let's say that we have conducted framework, submission and qualification and it has ``active`` status. When the framework is active and you change qualification status to active, system **automatically** created agreement(from framework) with contract(from qualification)." +msgstr "Припустимо, що є кваліфікація, заявка та рішення по заявці в статусах ``active``. Коли заявка в стаусі `active` і ви оновлюєте рішення по заявці до `active` статусу система **автоматично** створює реєстр(з кваліфікації) з контрактом(з рішення по заявці)." msgid "Getting agreement" msgstr "Отримання реєстру" @@ -74,5 +68,9 @@ msgstr "Для того щоб забанити контракт, потрібн msgid "Contract disqualification" msgstr "Дискваліфікація контракту" -msgid "For disqualification contract, you just need to add milestone to contract with status `disqualification`:" -msgstr "Для дискваліфікації контракту, потрібно додати майлстон до контракту в статусі `disqualification`:" +msgid "Let's see our created mailestone. In our mailestone you can see the ``id``." +msgstr "Давайте подивимось на створений майлстон. В ньому міститься ``id``" + +msgid "When we know ``id`` of our mailestone we can patch contract for disqualification, you just need to patch milestone 'type' : 'activation' to status ``met``:" +msgstr "Для дискваліфікації використовуючи майлстон ``id`` можно пропатчити майлстон з 'type' : 'activation' переводом статус в ``met``:" + diff --git a/docs/tests/test_agreements.py b/docs/tests/test_agreements.py index 6b37bb0ff8..97ce43a5e5 100644 --- a/docs/tests/test_agreements.py +++ b/docs/tests/test_agreements.py @@ -11,7 +11,7 @@ from openprocurement.framework.electroniccatalogue.tests.base import ( test_electronicCatalogue_data, ban_milestone_data_with_documents, - disqualification_milestone_data_with_documents, + disqualification_milestone_data, BaseElectronicCatalogueWebTest, ) @@ -341,6 +341,15 @@ def test_docs(self): {'data': ban_milestone}, ) - disqualification_milestone = deepcopy(disqualification_milestone_data_with_documents) - disqualification_milestone["documents"][0]["url"] = self.generate_docservice_url() + with open(TARGET_EC_DIR + 'mailestone-view.http', 'wb') as self.app.file_obj: + response = self.app.get( + f"/agreements/{self.agreement_id}/contracts/{contract_2_id}/milestones?acc_token={self.framework_token}") + self.assertEqual(response.status, '200 OK') + + mailestone_id = response.json['data'][0]['id'] + with open(TARGET_EC_DIR + 'patch-milestone-met.http', 'wb') as self.app.file_obj: + response = self.app.patch_json( + f"/agreements/{self.agreement_id}/contracts/{contract_2_id}/milestones/{mailestone_id}?acc_token={self.framework_token}", + {'data': disqualification_milestone_data} + ) diff --git a/src/openprocurement/framework/electroniccatalogue/tests/agreement_blanks.py b/src/openprocurement/framework/electroniccatalogue/tests/agreement_blanks.py index 3eb0641ed0..8a1d4dab3e 100644 --- a/src/openprocurement/framework/electroniccatalogue/tests/agreement_blanks.py +++ b/src/openprocurement/framework/electroniccatalogue/tests/agreement_blanks.py @@ -10,9 +10,7 @@ from openprocurement.framework.electroniccatalogue.tests.base import ( test_electronicCatalogue_data, ban_milestone_data, - disqualification_milestone_data, ban_milestone_data_with_documents, - disqualification_milestone_data_with_documents, ) from openprocurement.framework.electroniccatalogue.utils import CONTRACT_BAN_DURATION, MILESTONE_CONTRACT_STATUSES diff --git a/src/openprocurement/framework/electroniccatalogue/tests/base.py b/src/openprocurement/framework/electroniccatalogue/tests/base.py index ae3e000cfa..0df04d5880 100644 --- a/src/openprocurement/framework/electroniccatalogue/tests/base.py +++ b/src/openprocurement/framework/electroniccatalogue/tests/base.py @@ -150,21 +150,7 @@ def get_cpb_ids_by_activity(): disqualification_milestone_data = { - "type": "disqualification" -} - -disqualification_milestone_data_with_documents = { - "type": "disqualification", - "documents": [ - { - "hash": "md5:00000000000000000000000000000000", - "title": "milestone.doc", - "format": "application/msword", - "datePublished": "2020-09-08T01:00:00+03:00", - "id": "cd52b90af77e4f5b8cb0f210e83987b5", - "dateModified": "2020-09-08T01:00:00+03:00" - } - ] + "status": "met" }