Skip to content

Commit

Permalink
Merge pull request #29 from VolVoz/master
Browse files Browse the repository at this point in the history
tutorial updated
  • Loading branch information
vmaksymiv committed Mar 21, 2016
2 parents aca4a26 + 97339fe commit 6e28643
Show file tree
Hide file tree
Showing 49 changed files with 840 additions and 391 deletions.
39 changes: 38 additions & 1 deletion docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
import json
import os
from copy import deepcopy
from datetime import timedelta, datetime

import openprocurement.tender.limited.tests.base as base_test
from openprocurement.api.tests.base import PrefixedRequestClass
from openprocurement.tender.limited.tests.tender import BaseTenderWebTest
from webtest import TestApp

now = datetime.now()
test_tender_data = {
"dateModified": "2016-01-14T16:48:35.636859+02:00",
"id": "2d06f1999dcf436fb61ccd0168702459",
Expand All @@ -26,7 +28,18 @@
"scheme": "CPV"
},
"description": "Послуги шкільних їдалень",
"id": "2dc54675d6364e2baffbc0f8e74432ac"
"id": "2dc54675d6364e2baffbc0f8e74432ac",
"deliveryDate": {
"startDate": (now + timedelta(days=2)).isoformat(),
"endDate": (now + timedelta(days=5)).isoformat()
},
"deliveryAddress": {
"countryName": u"Україна",
"postalCode": "79000",
"region": u"м. Київ",
"locality": u"м. Київ",
"streetAddress": u"вул. Банкова 1"
}
}
],
"owner": "broker",
Expand Down Expand Up @@ -292,6 +305,30 @@ def test_docs(self):
self.tender_id, owner_token))
self.contract_id = response.json['data'][0]['id']

#### Set contract value

with open('docs/source/tutorial/tender-contract-set-contract-value.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/contracts/{}?acc_token={}'.format(
self.tender_id, self.contract_id, owner_token), {"data": {"value": {"amount": 238}}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.json['data']['value']['amount'], 238)

#### Setting contract signature date
#

with open('docs/source/tutorial/tender-contract-sign-date.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/contracts/{}?acc_token={}'.format(
self.tender_id, self.contract_id, owner_token), {'data': {"dateSigned": now.isoformat()} })
self.assertEqual(response.status, '200 OK')

#### Setting contract period

period_dates = {"period": {"startDate": (now).isoformat(), "endDate": (now + timedelta(days=365)).isoformat()}}
with open('docs/source/tutorial/tender-contract-period.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/contracts/{}?acc_token={}'.format(
self.tender_id, self.contract_id, owner_token), {'data': {'period': period_dates["period"]}})
self.assertEqual(response.status, '200 OK')

#### Uploading Contract documentation
#

Expand Down
29 changes: 29 additions & 0 deletions docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,35 @@ Award confirmation for **negotiation.quick** procedure:

The difference between ``startDate`` and ``endDate`` in ``complaintPeriod`` record for **negotiation.quick** is 5 days.

Setting contract value
-----------------------

By default contract value is set based on the award, but there is a possibility to set custom contract value.

If you want to **lower contract value**, you can insert new one into the `amount` field.

.. include:: tutorial/tender-contract-set-contract-value.http
:code:

`200 OK` response was returned. The value was modified successfully.

Setting contract signature date
-------------------------------

There is a possibility to set custom contract signature date. You can insert appropriate date into the `dateSigned` field.

If this date is not set, it will be auto-generated on the date of contract registration.

.. include:: tutorial/tender-contract-sign-date.http
:code:

Setting contract validity period
--------------------------------

Setting contract validity period is optional, but if it is needed, you can set appropriate `startDate` and `endDate`.

.. include:: tutorial/tender-contract-period.http
:code:

Uploading contract documentation
--------------------------------
Expand Down
22 changes: 11 additions & 11 deletions docs/source/tutorial/active-cancellation.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/0.12/tenders/20a01aaf77b54546bf0d964dddf4c478/cancellations/92e2ba138e6840eb84583e62abe6a06b?acc_token=a27778dbf2c94d8cb9f105d38ab1703c HTTP/1.0
PATCH /api/2.1/tenders/1d91eb0b469947d18921f02e1d767d9e/cancellations/d10b08a2e807438291109c78cd38adb1?acc_token=35a8eb46a7154037922423e312183957 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 30
Content-Type: application/json
Expand All @@ -19,29 +19,29 @@ Content-Type: application/json; charset=UTF-8
{
"description": "Changed description",
"title": "Notice.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/20a01aaf77b54546bf0d964dddf4c478/cancellations/92e2ba138e6840eb84583e62abe6a06b/documents/5a9e7c61083249a1b290b3e04096b0bd?download=9da61d1824fa490abf59388d13122bd4",
"url": "http://api-sandbox.openprocurement.org/api/2.1/tenders/1d91eb0b469947d18921f02e1d767d9e/cancellations/d10b08a2e807438291109c78cd38adb1/documents/fc0e5f9db3ff44fbbcac856f0975bf52?download=d4622d3d2ed247bebc9c636f1b94816f",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-03-17T16:49:29.668162+02:00",
"id": "5a9e7c61083249a1b290b3e04096b0bd",
"dateModified": "2016-03-17T16:49:29.668201+02:00"
"datePublished": "2016-03-21T12:46:42.516056+02:00",
"id": "fc0e5f9db3ff44fbbcac856f0975bf52",
"dateModified": "2016-03-21T12:46:42.516098+02:00"
},
{
"description": "Changed description",
"title": "Notice-2.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/20a01aaf77b54546bf0d964dddf4c478/cancellations/92e2ba138e6840eb84583e62abe6a06b/documents/5a9e7c61083249a1b290b3e04096b0bd?download=3c52fc14b1f04a6a8fff93956e3bfa98",
"url": "http://api-sandbox.openprocurement.org/api/2.1/tenders/1d91eb0b469947d18921f02e1d767d9e/cancellations/d10b08a2e807438291109c78cd38adb1/documents/fc0e5f9db3ff44fbbcac856f0975bf52?download=435b2489dfbb44aa8599b16080e8a055",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-03-17T16:49:29.668162+02:00",
"id": "5a9e7c61083249a1b290b3e04096b0bd",
"dateModified": "2016-03-17T16:49:29.966978+02:00"
"datePublished": "2016-03-21T12:46:42.516056+02:00",
"id": "fc0e5f9db3ff44fbbcac856f0975bf52",
"dateModified": "2016-03-21T12:46:42.968394+02:00"
}
],
"reason": "cancellation reason",
"reasonType": "unsuccessful",
"date": "2016-03-17T16:49:29.375968+02:00",
"date": "2016-03-21T12:46:42.061066+02:00",
"cancellationOf": "tender",
"id": "92e2ba138e6840eb84583e62abe6a06b"
"id": "d10b08a2e807438291109c78cd38adb1"
}
}

20 changes: 10 additions & 10 deletions docs/source/tutorial/award-complaint-accept.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/2220bbdc24c14fb9a5ac790092b68576 HTTP/1.0
PATCH /api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/d7c25fe98a5f4d57921d8550f7f28017 HTTP/1.0
Authorization: Basic cmV2aWV3ZXI6
Content-Length: 32
Content-Type: application/json
Expand All @@ -19,12 +19,12 @@ Content-Type: application/json; charset=UTF-8
{
"author": "complaint_owner",
"title": "Complaint_Attachement.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/2220bbdc24c14fb9a5ac790092b68576/documents/a60c0483755f425c8f33c9df00da2c7c?download=953f698246924aceb1c53c6b82469034",
"url": "http://api-sandbox.openprocurement.org/api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/d7c25fe98a5f4d57921d8550f7f28017/documents/2287f750c96c4b32995f2af705399e14?download=112b58fce25f41c4958ea9c9be45d830",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-03-17T16:49:35.916679+02:00",
"id": "a60c0483755f425c8f33c9df00da2c7c",
"dateModified": "2016-03-17T16:49:35.916718+02:00"
"datePublished": "2016-03-21T12:46:50.072540+02:00",
"id": "2287f750c96c4b32995f2af705399e14",
"dateModified": "2016-03-21T12:46:50.072580+02:00"
}
],
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
Expand All @@ -50,13 +50,13 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Вінниця"
}
},
"dateAccepted": "2016-03-17T16:49:36.742848+02:00",
"dateSubmitted": "2016-03-17T16:49:36.094351+02:00",
"complaintID": "UA-2016-03-17-000001.1",
"date": "2016-03-17T16:49:35.783395+02:00",
"dateAccepted": "2016-03-21T12:46:51.287586+02:00",
"dateSubmitted": "2016-03-21T12:46:50.316764+02:00",
"complaintID": "UA-2016-03-21-000001.1",
"date": "2016-03-21T12:46:49.864012+02:00",
"acceptance": true,
"type": "complaint",
"id": "2220bbdc24c14fb9a5ac790092b68576"
"id": "d7c25fe98a5f4d57921d8550f7f28017"
}
}

12 changes: 6 additions & 6 deletions docs/source/tutorial/award-complaint-cancel.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/03d60e96090b424e8a3b6cfe93acd830?acc_token=d5557233dde4449b9fa3ae96fb16451d HTTP/1.0
PATCH /api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/6d08eb733e144ba4ae7fa90523d8b653?acc_token=a767f6de8297449e9f4f22b043816bd3 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 150
Content-Type: application/json
Expand Down Expand Up @@ -40,12 +40,12 @@ Content-Type: application/json; charset=UTF-8
},
"title": "Недостатньо інформації",
"cancellationReason": "Умови виправлено",
"dateCanceled": "2016-03-17T16:49:37.881122+02:00",
"dateSubmitted": "2016-03-17T16:49:37.707537+02:00",
"complaintID": "UA-2016-03-17-000001.4",
"date": "2016-03-17T16:49:37.705898+02:00",
"dateCanceled": "2016-03-21T12:46:52.843541+02:00",
"dateSubmitted": "2016-03-21T12:46:52.603767+02:00",
"complaintID": "UA-2016-03-21-000001.4",
"date": "2016-03-21T12:46:52.602378+02:00",
"type": "complaint",
"id": "03d60e96090b424e8a3b6cfe93acd830"
"id": "6d08eb733e144ba4ae7fa90523d8b653"
}
}

18 changes: 9 additions & 9 deletions docs/source/tutorial/award-complaint-complaint.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/2220bbdc24c14fb9a5ac790092b68576?acc_token=84d419f21a624b81b3b31c5f959dbd66 HTTP/1.0
PATCH /api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/d7c25fe98a5f4d57921d8550f7f28017?acc_token=f7591f1954364fd9acb2085767c5ea9c HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 31
Content-Type: application/json
Expand All @@ -19,12 +19,12 @@ Content-Type: application/json; charset=UTF-8
{
"author": "complaint_owner",
"title": "Complaint_Attachement.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/2220bbdc24c14fb9a5ac790092b68576/documents/a60c0483755f425c8f33c9df00da2c7c?download=953f698246924aceb1c53c6b82469034",
"url": "http://api-sandbox.openprocurement.org/api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/d7c25fe98a5f4d57921d8550f7f28017/documents/2287f750c96c4b32995f2af705399e14?download=112b58fce25f41c4958ea9c9be45d830",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-03-17T16:49:35.916679+02:00",
"id": "a60c0483755f425c8f33c9df00da2c7c",
"dateModified": "2016-03-17T16:49:35.916718+02:00"
"datePublished": "2016-03-21T12:46:50.072540+02:00",
"id": "2287f750c96c4b32995f2af705399e14",
"dateModified": "2016-03-21T12:46:50.072580+02:00"
}
],
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
Expand All @@ -50,11 +50,11 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Вінниця"
}
},
"dateSubmitted": "2016-03-17T16:49:36.094351+02:00",
"complaintID": "UA-2016-03-17-000001.1",
"date": "2016-03-17T16:49:35.783395+02:00",
"dateSubmitted": "2016-03-21T12:46:50.316764+02:00",
"complaintID": "UA-2016-03-21-000001.1",
"date": "2016-03-21T12:46:49.864012+02:00",
"type": "complaint",
"id": "2220bbdc24c14fb9a5ac790092b68576"
"id": "d7c25fe98a5f4d57921d8550f7f28017"
}
}

14 changes: 7 additions & 7 deletions docs/source/tutorial/award-complaint-decline.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/3965ae6a93cf4b6194e86d45dc6d7da1 HTTP/1.0
PATCH /api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/d3c53222505d448c9889f517cc577842 HTTP/1.0
Authorization: Basic cmV2aWV3ZXI6
Content-Length: 32
Content-Type: application/json
Expand All @@ -15,7 +15,7 @@ Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "declined",
"dateDecision": "2016-03-17T16:49:37.386136+02:00",
"dateDecision": "2016-03-21T12:46:52.178228+02:00",
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
"author": {
"contactPoint": {
Expand All @@ -39,13 +39,13 @@ Content-Type: application/json; charset=UTF-8
}
},
"acceptance": true,
"dateAccepted": "2016-03-17T16:49:36.889748+02:00",
"dateSubmitted": "2016-03-17T16:49:36.418935+02:00",
"complaintID": "UA-2016-03-17-000001.3",
"date": "2016-03-17T16:49:36.417344+02:00",
"dateAccepted": "2016-03-21T12:46:51.499502+02:00",
"dateSubmitted": "2016-03-21T12:46:50.780730+02:00",
"complaintID": "UA-2016-03-21-000001.3",
"date": "2016-03-21T12:46:50.779350+02:00",
"title": "Недостатньо інформації",
"type": "complaint",
"id": "3965ae6a93cf4b6194e86d45dc6d7da1"
"id": "d3c53222505d448c9889f517cc577842"
}
}

12 changes: 6 additions & 6 deletions docs/source/tutorial/award-complaint-reject.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/af5dadb2dee641fa976dc6db9cbc124d HTTP/1.0
PATCH /api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/f72cc9199f9542ed8d10bf96ff7ed01f HTTP/1.0
Authorization: Basic cmV2aWV3ZXI6
Content-Length: 31
Content-Type: application/json
Expand All @@ -15,7 +15,7 @@ Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "invalid",
"dateDecision": "2016-03-17T16:49:36.599200+02:00",
"dateDecision": "2016-03-21T12:46:51.068257+02:00",
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
"author": {
"contactPoint": {
Expand All @@ -39,12 +39,12 @@ Content-Type: application/json; charset=UTF-8
}
},
"acceptance": false,
"dateSubmitted": "2016-03-17T16:49:36.252876+02:00",
"complaintID": "UA-2016-03-17-000001.2",
"date": "2016-03-17T16:49:36.251467+02:00",
"dateSubmitted": "2016-03-21T12:46:50.545516+02:00",
"complaintID": "UA-2016-03-21-000001.2",
"date": "2016-03-21T12:46:50.544124+02:00",
"title": "Недостатньо інформації",
"type": "complaint",
"id": "af5dadb2dee641fa976dc6db9cbc124d"
"id": "f72cc9199f9542ed8d10bf96ff7ed01f"
}
}

16 changes: 8 additions & 8 deletions docs/source/tutorial/award-complaint-resolution-upload.http
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
POST /api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/2220bbdc24c14fb9a5ac790092b68576/documents HTTP/1.0
POST /api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/d7c25fe98a5f4d57921d8550f7f28017/documents HTTP/1.0
Authorization: Basic cmV2aWV3ZXI6
Content-Length: 199
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy831487605984$
Content-Length: 201
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy0349630796965$
Host: api-sandbox.openprocurement.org

Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/2220bbdc24c14fb9a5ac790092b68576/documents/12de24bb47754c37a6811b8c1f840154
Location: http://api-sandbox.openprocurement.org/api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/d7c25fe98a5f4d57921d8550f7f28017/documents/0e339a7d16744228b84ccd3109f9fe7a
{
"data": {
"author": "aboveThresholdReviewers",
"title": "ComplaintResolution.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/76435c934efe457db2739f92307121a9/awards/77f3c02645264dd9aa9f37abdda0e0ff/complaints/2220bbdc24c14fb9a5ac790092b68576/documents/12de24bb47754c37a6811b8c1f840154?download=1843fc9ad399450292577809c8c55ddc",
"url": "http://api-sandbox.openprocurement.org/api/2.1/tenders/bcdd7283c7b3402a839f05d2222fb37b/awards/a01d35aadb0e4581a0640c3d7979dc2c/complaints/d7c25fe98a5f4d57921d8550f7f28017/documents/0e339a7d16744228b84ccd3109f9fe7a?download=bf80aa5af7fa45f69d885399dba8ab63",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-03-17T16:49:37.045085+02:00",
"id": "12de24bb47754c37a6811b8c1f840154",
"dateModified": "2016-03-17T16:49:37.045124+02:00"
"datePublished": "2016-03-21T12:46:51.744226+02:00",
"id": "0e339a7d16744228b84ccd3109f9fe7a",
"dateModified": "2016-03-21T12:46:51.744266+02:00"
}
}

0 comments on commit 6e28643

Please sign in to comment.