Skip to content

Commit

Permalink
Merge branch 'a147484942466775_change_date_signed'
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksymiv committed Oct 6, 2016
2 parents a0e9dd3 + 041ef5a commit ce52892
Show file tree
Hide file tree
Showing 25 changed files with 290 additions and 276 deletions.
6 changes: 5 additions & 1 deletion docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def setUp(self):
self.couchdb_server = self.app.app.registry.couchdb_server
self.db = self.app.app.registry.db

def tearDown(self):
self.couchdb_server.delete(self.db.name)

def test_docs(self):

self.app.authorization = ('Basic', ('broker', ''))
Expand Down Expand Up @@ -152,6 +155,7 @@ def test_docs(self):
with open('docs/source/tutorial/contract-credentials.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/contracts/{}/credentials?acc_token={}'.format(test_contract_data['id'], owner_token))
self.assertEqual(response.status, '200 OK')
self.app.get(request_path)
contract_token = response.json['access']['token']
contract_id = test_contract_data['id']

Expand Down Expand Up @@ -238,7 +242,7 @@ def test_docs(self):
# apply contract change
with open('docs/source/tutorial/apply-contract-change.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/contracts/{}/changes/{}?acc_token={}'.format(contract_id, change['id'], contract_token),
{'data': {'status': 'active'}})
{'data': {'status': 'active', 'dateSigned': get_now().isoformat()}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')

Expand Down
3 changes: 3 additions & 0 deletions docs/source/standard/util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ Schema
:date:
string, :ref:`date`, auto-generated

:dateSigned:
string, :ref:`date`

:contractNumber:
string

Expand Down
14 changes: 7 additions & 7 deletions docs/source/tutorial/add-contract-change-document.http
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
POST /api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/documents?acc_token=f029dc150f36407aae5b6443198f92d2 HTTP/1.0
POST /api/2.3/contracts/d85316fca03a448cabc556f6367726e2/documents?acc_token=54ff017bad3549e995208fde9d41da29 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 199
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy231285807329$
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy205768167109$
Host: api-sandbox.openprocurement.org

Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/documents/5c543881feb84a498bf2d87c5e0a43c9
Location: http://api-sandbox.openprocurement.org/api/2.3/contracts/d85316fca03a448cabc556f6367726e2/documents/c0135e9855984cd39410ba654101c7ce
{
"data": {
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/documents/5c543881feb84a498bf2d87c5e0a43c9?download=a1e17786ad1f457c900a3be787e58602",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/d85316fca03a448cabc556f6367726e2/documents/c0135e9855984cd39410ba654101c7ce?download=2b72424b562d41a78e0b8b0a6c9ed0fe",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2016-05-31T13:04:41.869480+03:00",
"id": "5c543881feb84a498bf2d87c5e0a43c9",
"dateModified": "2016-05-31T13:04:41.869528+03:00"
"datePublished": "2016-10-06T11:41:15.627743+03:00",
"id": "c0135e9855984cd39410ba654101c7ce",
"dateModified": "2016-10-06T11:41:15.627787+03:00"
}
}

6 changes: 3 additions & 3 deletions docs/source/tutorial/add-contract-change.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST /api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/changes?acc_token=f029dc150f36407aae5b6443198f92d2 HTTP/1.0
POST /api/2.3/contracts/d85316fca03a448cabc556f6367726e2/changes?acc_token=54ff017bad3549e995208fde9d41da29 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 267
Content-Type: application/json
Expand Down Expand Up @@ -26,8 +26,8 @@ Content-Type: application/json; charset=UTF-8
],
"rationale_en": "Contract change cause",
"rationale": "Опис причини змін контракту",
"date": "2016-05-31T13:04:41.340124+03:00",
"id": "90b9821517e24688a8146868020fd7e0"
"date": "2016-10-06T11:41:15.285638+03:00",
"id": "3ba8592459904c73bf05d7bc48e7083c"
}
}

48 changes: 24 additions & 24 deletions docs/source/tutorial/add-contract-item.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875?acc_token=f029dc150f36407aae5b6443198f92d2 HTTP/1.0
PATCH /api/2.3/contracts/d85316fca03a448cabc556f6367726e2?acc_token=54ff017bad3549e995208fde9d41da29 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 1178
Content-Type: application/json
Expand Down Expand Up @@ -30,8 +30,8 @@ DATA:
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2016-06-02T13:04:36.269519+03:00",
"endDate": "2016-06-05T13:04:36.269519+03:00"
"startDate": "2016-10-08T11:41:10.967073+03:00",
"endDate": "2016-10-11T11:41:10.967073+03:00"
},
"unit": {
"code": "44617100-9",
Expand All @@ -56,13 +56,13 @@ Content-Type: application/json; charset=UTF-8
"documents": [
{
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/documents/5c543881feb84a498bf2d87c5e0a43c9?download=a1e17786ad1f457c900a3be787e58602",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/d85316fca03a448cabc556f6367726e2/documents/c0135e9855984cd39410ba654101c7ce?download=2b72424b562d41a78e0b8b0a6c9ed0fe",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2016-05-31T13:04:41.869480+03:00",
"id": "5c543881feb84a498bf2d87c5e0a43c9",
"relatedItem": "90b9821517e24688a8146868020fd7e0",
"dateModified": "2016-05-31T13:04:41.869528+03:00"
"datePublished": "2016-10-06T11:41:15.627743+03:00",
"id": "c0135e9855984cd39410ba654101c7ce",
"relatedItem": "3ba8592459904c73bf05d7bc48e7083c",
"dateModified": "2016-10-06T11:41:15.627787+03:00"
}
],
"items": [
Expand All @@ -88,10 +88,10 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2016-06-02T13:04:36.269519+03:00",
"endDate": "2016-06-05T13:04:36.269519+03:00"
"startDate": "2016-10-08T11:41:10.967073+03:00",
"endDate": "2016-10-11T11:41:10.967073+03:00"
},
"id": "5c226a158a0b47c498b0148582cc7e5d",
"id": "47c2cd63f8324f61bfdd82241b860408",
"unit": {
"code": "44617100-9",
"name": "item"
Expand Down Expand Up @@ -120,10 +120,10 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2016-06-02T13:04:36.269519+03:00",
"endDate": "2016-06-05T13:04:36.269519+03:00"
"startDate": "2016-10-08T11:41:10.967073+03:00",
"endDate": "2016-10-11T11:41:10.967073+03:00"
},
"id": "23a28ae16efb42adb862ef7fbcf217c2",
"id": "5c8f7e8e78ac4b499bde67864993b538",
"unit": {
"code": "44617100-9",
"name": "item"
Expand Down Expand Up @@ -153,11 +153,11 @@ Content-Type: application/json; charset=UTF-8
}
],
"period": {
"startDate": "2016-05-31T13:04:42.023541+03:00",
"endDate": "2016-06-30T13:04:42.023582+03:00"
"startDate": "2016-10-06T11:41:15.720242+03:00",
"endDate": "2016-11-05T11:41:15.720282+03:00"
},
"dateSigned": "2016-05-31T13:04:40.779728+03:00",
"id": "3626499d3dc843f3809ca17b79d3d875",
"dateSigned": "2016-10-06T11:41:14.838145+03:00",
"id": "d85316fca03a448cabc556f6367726e2",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
Expand All @@ -178,9 +178,9 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Київ"
}
},
"contractID": "UA-2016-05-31-000001-1",
"contractID": "UA-2016-10-06-000001-1",
"owner": "broker",
"awardID": "a30c88b025b54d7880fb2dbe10dfc351",
"awardID": "0fe3968c3b6441b6b8825243591d446b",
"changes": [
{
"status": "pending",
Expand All @@ -190,12 +190,12 @@ Content-Type: application/json; charset=UTF-8
],
"rationale_en": "Contract change cause",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2016-05-31T13:04:41.340124+03:00",
"id": "90b9821517e24688a8146868020fd7e0"
"date": "2016-10-06T11:41:15.285638+03:00",
"id": "3ba8592459904c73bf05d7bc48e7083c"
}
],
"dateModified": "2016-05-31T13:04:42.285355+03:00",
"tender_id": "57cdaeec15e1489f9b12b88a2a7a5769"
"dateModified": "2016-10-06T11:41:15.923861+03:00",
"tender_id": "9df8920066d142c9929feedb60feb68c"
}
}

12 changes: 7 additions & 5 deletions docs/source/tutorial/apply-contract-change.http
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
PATCH /api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/changes/90b9821517e24688a8146868020fd7e0?acc_token=f029dc150f36407aae5b6443198f92d2 HTTP/1.0
PATCH /api/2.3/contracts/d85316fca03a448cabc556f6367726e2/changes/3ba8592459904c73bf05d7bc48e7083c?acc_token=54ff017bad3549e995208fde9d41da29 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 30
Content-Length: 80
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"status": "active"
"status": "active",
"dateSigned": "2016-10-06T11:41:16.243354+03:00"
}
}

Expand All @@ -20,9 +21,10 @@ Content-Type: application/json; charset=UTF-8
"priceReduction"
],
"rationale_en": "Contract change cause",
"dateSigned": "2016-10-06T11:41:16.243354+03:00",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2016-05-31T13:04:42.669724+03:00",
"id": "90b9821517e24688a8146868020fd7e0"
"date": "2016-10-06T11:41:16.269024+03:00",
"id": "3ba8592459904c73bf05d7bc48e7083c"
}
}

22 changes: 11 additions & 11 deletions docs/source/tutorial/contract-credentials.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/credentials?acc_token=f729a63612c0430d90bfa0a398eff1fb HTTP/1.0
PATCH /api/2.3/contracts/d85316fca03a448cabc556f6367726e2/credentials?acc_token=36e4bf6891c343118504746775a6d15d HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 0
Content-Type: application/json
Expand All @@ -8,7 +8,7 @@ Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"access": {
"token": "f029dc150f36407aae5b6443198f92d2"
"token": "54ff017bad3549e995208fde9d41da29"
},
"data": {
"status": "active",
Expand Down Expand Up @@ -40,10 +40,10 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2016-06-02T13:04:36.269519+03:00",
"endDate": "2016-06-05T13:04:36.269519+03:00"
"startDate": "2016-10-08T11:41:10.967073+03:00",
"endDate": "2016-10-11T11:41:10.967073+03:00"
},
"id": "5c226a158a0b47c498b0148582cc7e5d",
"id": "47c2cd63f8324f61bfdd82241b860408",
"unit": {
"code": "44617100-9",
"name": "item"
Expand Down Expand Up @@ -72,8 +72,8 @@ Content-Type: application/json; charset=UTF-8
}
}
],
"dateSigned": "2016-05-31T13:04:40.779728+03:00",
"dateModified": "2016-05-31T13:04:41.146946+03:00",
"dateSigned": "2016-10-06T11:41:14.838145+03:00",
"dateModified": "2016-10-06T11:41:15.141126+03:00",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
Expand All @@ -94,11 +94,11 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Київ"
}
},
"contractID": "UA-2016-05-31-000001-1",
"contractID": "UA-2016-10-06-000001-1",
"owner": "broker",
"awardID": "a30c88b025b54d7880fb2dbe10dfc351",
"id": "3626499d3dc843f3809ca17b79d3d875",
"tender_id": "57cdaeec15e1489f9b12b88a2a7a5769"
"awardID": "0fe3968c3b6441b6b8825243591d446b",
"id": "d85316fca03a448cabc556f6367726e2",
"tender_id": "9df8920066d142c9929feedb60feb68c"
}
}

20 changes: 10 additions & 10 deletions docs/source/tutorial/contract-documents.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GET /api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/documents?acc_token=f029dc150f36407aae5b6443198f92d2 HTTP/1.0
GET /api/2.3/contracts/d85316fca03a448cabc556f6367726e2/documents?acc_token=54ff017bad3549e995208fde9d41da29 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org

Expand All @@ -8,22 +8,22 @@ Content-Type: application/json; charset=UTF-8
"data": [
{
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/documents/5c543881feb84a498bf2d87c5e0a43c9?download=a1e17786ad1f457c900a3be787e58602",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/d85316fca03a448cabc556f6367726e2/documents/c0135e9855984cd39410ba654101c7ce?download=2b72424b562d41a78e0b8b0a6c9ed0fe",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2016-05-31T13:04:41.869480+03:00",
"id": "5c543881feb84a498bf2d87c5e0a43c9",
"relatedItem": "90b9821517e24688a8146868020fd7e0",
"dateModified": "2016-05-31T13:04:41.869528+03:00"
"datePublished": "2016-10-06T11:41:15.627743+03:00",
"id": "c0135e9855984cd39410ba654101c7ce",
"relatedItem": "3ba8592459904c73bf05d7bc48e7083c",
"dateModified": "2016-10-06T11:41:15.627787+03:00"
},
{
"title": "contract.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/3626499d3dc843f3809ca17b79d3d875/documents/2d6848c3cfff49349e20de76ba48044f?download=0a2ddb7b5d7d44168af8b020d720cf0f",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/d85316fca03a448cabc556f6367726e2/documents/fca8a8dfbd724137a3b9405e4e4140a5?download=39498df45f6d4950b27737498c6aeb43",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2016-05-31T13:04:42.857846+03:00",
"id": "2d6848c3cfff49349e20de76ba48044f",
"dateModified": "2016-05-31T13:04:42.857885+03:00"
"datePublished": "2016-10-06T11:41:16.388368+03:00",
"id": "fca8a8dfbd724137a3b9405e4e4140a5",
"dateModified": "2016-10-06T11:41:16.388408+03:00"
}
]
}
Expand Down

0 comments on commit ce52892

Please sign in to comment.