Skip to content

Commit

Permalink
fix in docs description of contract disqualification
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim.pakhomov committed Sep 10, 2021
1 parent c8a524e commit 51b13a4
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 57 deletions.
19 changes: 19 additions & 0 deletions docs/source/agreements/http/frameworks/mailestone-view.http
Original file line number Diff line number Diff line change
@@ -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"
}
]
}

25 changes: 25 additions & 0 deletions docs/source/agreements/http/frameworks/patch-milestone-met.http
Original file line number Diff line number Diff line change
@@ -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"
}
}

This file was deleted.

8 changes: 6 additions & 2 deletions docs/source/agreements/tutorial_frameworks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
22 changes: 10 additions & 12 deletions docs/source/locale/uk/LC_MESSAGES/agreements/tutorial_frameworks.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\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 "Туторіал"
Expand All @@ -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 "Отримання реєстру"
Expand Down Expand Up @@ -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``:"

15 changes: 12 additions & 3 deletions docs/tests/test_agreements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down Expand Up @@ -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}
)
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 1 addition & 15 deletions src/openprocurement/framework/electroniccatalogue/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}


Expand Down

0 comments on commit 51b13a4

Please sign in to comment.