Skip to content

Commit

Permalink
stopping/stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Mar 30, 2016
1 parent bc33ccc commit 17f8d50
Show file tree
Hide file tree
Showing 23 changed files with 556 additions and 190 deletions.
43 changes: 43 additions & 0 deletions docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,16 @@ def test_award_complaints(self):
complaint3_token = response.json['access']['token']
complaint3_id = response.json['data']['id']

response = self.app.post_json('/tenders/{}/awards/{}/complaints'.format(self.tender_id, award_id), complaint_data)
self.assertEqual(response.status, '201 Created')
complaint4_token = response.json['access']['token']
complaint4_id = response.json['data']['id']

response = self.app.post_json('/tenders/{}/awards/{}/complaints'.format(self.tender_id, award_id), complaint_data)
self.assertEqual(response.status, '201 Created')
complaint5_token = response.json['access']['token']
complaint5_id = response.json['data']['id']

self.app.authorization = ('Basic', ('reviewer', ''))
with open('docs/source/tutorial/award-complaint-reject.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/awards/{}/complaints/{}'.format(self.tender_id, award_id, complaint2_id), {"data": {
Expand All @@ -591,6 +601,16 @@ def test_award_complaints(self):
}})
self.assertEqual(response.status, '200 OK')

response = self.app.patch_json('/tenders/{}/awards/{}/complaints/{}'.format(self.tender_id, award_id, complaint4_id), {"data": {
"status": "accepted"
}})
self.assertEqual(response.status, '200 OK')

response = self.app.patch_json('/tenders/{}/awards/{}/complaints/{}'.format(self.tender_id, award_id, complaint5_id), {"data": {
"status": "accepted"
}})
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/award-complaint-resolution-upload.http', 'w') as self.app.file_obj:
response = self.app.post('/tenders/{}/awards/{}/complaints/{}/documents'.format(self.tender_id, award_id, complaint1_id),
upload_files=[('file', u'ComplaintResolution.pdf', 'content')])
Expand All @@ -608,6 +628,13 @@ def test_award_complaints(self):
}})
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/award-complaint-accepted-stopped.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/awards/{}/complaints/{}'.format(self.tender_id, award_id, complaint5_id), {"data": {
"decision": "Тендер скасовується замовником",
"status": "stopped"
}})
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/award-complaints-list.http', 'w') as self.app.file_obj:
self.app.authorization = None
response = self.app.get('/tenders/{}/awards/{}/complaints'.format(self.tender_id, award_id))
Expand Down Expand Up @@ -637,6 +664,22 @@ def test_award_complaints(self):
}})
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/award-complaint-accepted-stopping.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/awards/{}/complaints/{}?acc_token={}'.format(self.tender_id, award_id, complaint4_id, complaint4_token), {"data": {
"cancellationReason": "Тендер скасовується замовником",
"status": "stopping"
}})
self.assertEqual(response.status, '200 OK')

self.app.authorization = ('Basic', ('reviewer', ''))
with open('docs/source/tutorial/award-complaint-stopping-stopped.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/awards/{}/complaints/{}'.format(self.tender_id, award_id, complaint4_id), {"data": {
"decision": "Тендер скасовується замовником",
"status": "stopped"
}})
self.assertEqual(response.status, '200 OK')

self.app.authorization = ('Basic', ('broker', ''))
award_id = new_award_id

self.app.patch_json('/tenders/{}/awards/{}?acc_token={}'.format(self.tender_id, award_id, owner_token), {"data": {
Expand Down
18 changes: 18 additions & 0 deletions docs/source/complaints-award.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,23 @@ Submitting complaint to new award
Cancelling Tender Award Complaint
=================================

Cancelling not accepted complaint
---------------------------------

.. include:: tutorial/award-complaint-cancel.http
:code:

Cancelling accepted complaint by Complainant
--------------------------------------------

.. include:: tutorial/award-complaint-accepted-stopping.http
:code:

.. include:: tutorial/award-complaint-stopping-stopped.http
:code:

Cancelling accepted complaint by Reviewer
-----------------------------------------

.. include:: tutorial/award-complaint-accepted-stopped.http
:code:
8 changes: 5 additions & 3 deletions docs/source/complaints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ Tender Award Complaints
digraph G {
subgraph cluster_complaint {
label = "complaint";
pending; satisfied; accepted;
pending; accepted; stopping; satisfied;
}
satisfied -> resolved;
edge[style=dashed];
draft -> pending;
{accepted,draft,pending} -> cancelled;
{draft,pending} -> cancelled;
accepted -> stopping;
edge[style=bold];
pending -> {accepted,invalid};
accepted -> {declined,satisfied};
stopping -> stopped;
accepted -> {declined,satisfied,stopped};
}

.. toctree::
Expand Down
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/2.1/tenders/638b8c94e5c14786a948e4efed6f812e/awards/bd45d36812214ae4913d64ed5dac10da/complaints/e1bed7add57c4be99f2f2352fec37b96 HTTP/1.0
PATCH /api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/7b57363f355c4513a4021b5d8195a9f7/complaints/b3bc7dbabb294930a8e1456b14869fb9 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/2.1/tenders/638b8c94e5c14786a948e4efed6f812e/awards/bd45d36812214ae4913d64ed5dac10da/complaints/e1bed7add57c4be99f2f2352fec37b96/documents/b226f4c726864731b68d79f75cec7244?download=8c5020c7295849cc943f3fcc83946927",
"url": "http://api-sandbox.openprocurement.org/api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/7b57363f355c4513a4021b5d8195a9f7/complaints/b3bc7dbabb294930a8e1456b14869fb9/documents/1c9ac43379fb4cb5b10404f78ac32a36?download=6d34cdf1456947569e2563dd85da22df",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-03-28T18:03:46.452855+03:00",
"id": "b226f4c726864731b68d79f75cec7244",
"dateModified": "2016-03-28T18:03:46.452897+03:00"
"datePublished": "2016-03-30T13:18:52.417895+03:00",
"id": "1c9ac43379fb4cb5b10404f78ac32a36",
"dateModified": "2016-03-30T13:18:52.417934+03:00"
}
],
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
Expand All @@ -50,13 +50,13 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Вінниця"
}
},
"dateAccepted": "2016-03-28T18:03:47.564202+03:00",
"dateSubmitted": "2016-03-28T18:03:46.686700+03:00",
"complaintID": "UA-2016-03-28-000001.1",
"date": "2016-03-28T18:03:46.247132+03:00",
"dateAccepted": "2016-03-30T13:18:53.502471+03:00",
"dateSubmitted": "2016-03-30T13:18:52.566498+03:00",
"complaintID": "UA-2016-03-30-000001.1",
"date": "2016-03-30T13:18:52.131839+03:00",
"acceptance": true,
"type": "complaint",
"id": "e1bed7add57c4be99f2f2352fec37b96"
"id": "b3bc7dbabb294930a8e1456b14869fb9"
}
}

54 changes: 54 additions & 0 deletions docs/source/tutorial/award-complaint-accepted-stopped.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
PATCH /api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/7b57363f355c4513a4021b5d8195a9f7/complaints/211b8399f2df470fb27add6e0e0ba100 HTTP/1.0
Authorization: Basic cmV2aWV3ZXI6
Content-Length: 217
Content-Type: application/json
Host: api-sandbox.openprocurement.org

{
"data": {
"status": "stopped",
"decision": "Тендер скасовується замовником"
}
}

Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "stopped",
"dateDecision": "2016-03-30T13:18:54.758873+03:00",
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
"title": "Недостатньо інформації",
"decision": "Тендер скасовується замовником",
"acceptance": true,
"dateCanceled": "2016-03-30T13:18:54.758904+03:00",
"dateAccepted": "2016-03-30T13:18:54.015054+03:00",
"author": {
"contactPoint": {
"email": "soleksuk@gmail.com",
"telephone": "+380 (432) 21-69-30",
"name": "Сергій Олексюк"
},
"identifier": {
"scheme": "UA-EDR",
"legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
"id": "13313462",
"uri": "http://sch10.edu.vn.ua/"
},
"name": "ДКП «Школяр»",
"address": {
"postalCode": "21100",
"countryName": "Україна",
"streetAddress": "вул. Островського, 33",
"region": "м. Вінниця",
"locality": "м. Вінниця"
}
},
"dateSubmitted": "2016-03-30T13:18:53.153198+03:00",
"complaintID": "UA-2016-03-30-000001.5",
"date": "2016-03-30T13:18:53.151736+03:00",
"type": "complaint",
"id": "211b8399f2df470fb27add6e0e0ba100"
}
}

53 changes: 53 additions & 0 deletions docs/source/tutorial/award-complaint-accepted-stopping.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
PATCH /api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/7b57363f355c4513a4021b5d8195a9f7/complaints/978a1cc3bed045329fb402302ec2999b?acc_token=5aa3e95446ea40fa88410127c7e45018 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 228
Content-Type: application/json
Host: api-sandbox.openprocurement.org

{
"data": {
"status": "stopping",
"cancellationReason": "Тендер скасовується замовником"
}
}

Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "stopping",
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
"author": {
"contactPoint": {
"email": "soleksuk@gmail.com",
"telephone": "+380 (432) 21-69-30",
"name": "Сергій Олексюк"
},
"identifier": {
"scheme": "UA-EDR",
"legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
"id": "13313462",
"uri": "http://sch10.edu.vn.ua/"
},
"name": "ДКП «Школяр»",
"address": {
"postalCode": "21100",
"countryName": "Україна",
"streetAddress": "вул. Островського, 33",
"region": "м. Вінниця",
"locality": "м. Вінниця"
}
},
"acceptance": true,
"cancellationReason": "Тендер скасовується замовником",
"dateCanceled": "2016-03-30T13:18:55.781475+03:00",
"dateAccepted": "2016-03-30T13:18:53.844736+03:00",
"dateSubmitted": "2016-03-30T13:18:53.000920+03:00",
"complaintID": "UA-2016-03-30-000001.4",
"date": "2016-03-30T13:18:52.999499+03:00",
"title": "Недостатньо інформації",
"type": "complaint",
"id": "978a1cc3bed045329fb402302ec2999b"
}
}

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/2.1/tenders/638b8c94e5c14786a948e4efed6f812e/awards/9f5f919b51c645e5ade6da27ae35d328/complaints/19407981757a465882bcbc3fc89bacc1?acc_token=fdcf9ff208ef4d1bb2b4f47fdbf12f5b HTTP/1.0
PATCH /api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/f12cffbb3ab8476ead380dee2e1287b0/complaints/23e5d42160a04ece9d5d33f7097f7614?acc_token=12b78be87fcf41e6aee62a8a83057fd9 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-28T18:03:50.495712+03:00",
"dateSubmitted": "2016-03-28T18:03:50.223536+03:00",
"complaintID": "UA-2016-03-28-000001.5",
"date": "2016-03-28T18:03:50.222072+03:00",
"dateCanceled": "2016-03-30T13:18:56.847735+03:00",
"dateSubmitted": "2016-03-30T13:18:56.617528+03:00",
"complaintID": "UA-2016-03-30-000001.7",
"date": "2016-03-30T13:18:56.616104+03:00",
"type": "complaint",
"id": "19407981757a465882bcbc3fc89bacc1"
"id": "23e5d42160a04ece9d5d33f7097f7614"
}
}

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/2.1/tenders/638b8c94e5c14786a948e4efed6f812e/awards/bd45d36812214ae4913d64ed5dac10da/complaints/e1bed7add57c4be99f2f2352fec37b96?acc_token=a3056e23411440aaa919a407e75f0aa2 HTTP/1.0
PATCH /api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/7b57363f355c4513a4021b5d8195a9f7/complaints/b3bc7dbabb294930a8e1456b14869fb9?acc_token=b151e72143944cdfb1119dafbf71fc3c 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/2.1/tenders/638b8c94e5c14786a948e4efed6f812e/awards/bd45d36812214ae4913d64ed5dac10da/complaints/e1bed7add57c4be99f2f2352fec37b96/documents/b226f4c726864731b68d79f75cec7244?download=8c5020c7295849cc943f3fcc83946927",
"url": "http://api-sandbox.openprocurement.org/api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/7b57363f355c4513a4021b5d8195a9f7/complaints/b3bc7dbabb294930a8e1456b14869fb9/documents/1c9ac43379fb4cb5b10404f78ac32a36?download=6d34cdf1456947569e2563dd85da22df",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-03-28T18:03:46.452855+03:00",
"id": "b226f4c726864731b68d79f75cec7244",
"dateModified": "2016-03-28T18:03:46.452897+03:00"
"datePublished": "2016-03-30T13:18:52.417895+03:00",
"id": "1c9ac43379fb4cb5b10404f78ac32a36",
"dateModified": "2016-03-30T13:18:52.417934+03:00"
}
],
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
Expand All @@ -50,11 +50,11 @@ Content-Type: application/json; charset=UTF-8
"locality": "м. Вінниця"
}
},
"dateSubmitted": "2016-03-28T18:03:46.686700+03:00",
"complaintID": "UA-2016-03-28-000001.1",
"date": "2016-03-28T18:03:46.247132+03:00",
"dateSubmitted": "2016-03-30T13:18:52.566498+03:00",
"complaintID": "UA-2016-03-30-000001.1",
"date": "2016-03-30T13:18:52.131839+03:00",
"type": "complaint",
"id": "e1bed7add57c4be99f2f2352fec37b96"
"id": "b3bc7dbabb294930a8e1456b14869fb9"
}
}

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/2.1/tenders/638b8c94e5c14786a948e4efed6f812e/awards/bd45d36812214ae4913d64ed5dac10da/complaints/0d65b91af1f246968ca14f2a0b5091b5 HTTP/1.0
PATCH /api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/7b57363f355c4513a4021b5d8195a9f7/complaints/38e5d2fac83e4b5aae562254afda4285 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-28T18:03:48.474093+03:00",
"dateDecision": "2016-03-30T13:18:54.574419+03:00",
"description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
"author": {
"contactPoint": {
Expand All @@ -39,13 +39,13 @@ Content-Type: application/json; charset=UTF-8
}
},
"acceptance": true,
"dateAccepted": "2016-03-28T18:03:47.797224+03:00",
"dateSubmitted": "2016-03-28T18:03:47.142806+03:00",
"complaintID": "UA-2016-03-28-000001.3",
"date": "2016-03-28T18:03:47.141362+03:00",
"dateAccepted": "2016-03-30T13:18:53.675993+03:00",
"dateSubmitted": "2016-03-30T13:18:52.864838+03:00",
"complaintID": "UA-2016-03-30-000001.3",
"date": "2016-03-30T13:18:52.863417+03:00",
"title": "Недостатньо інформації",
"type": "complaint",
"id": "0d65b91af1f246968ca14f2a0b5091b5"
"id": "38e5d2fac83e4b5aae562254afda4285"
}
}

10 changes: 5 additions & 5 deletions docs/source/tutorial/award-complaint-newaward.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST /api/2.1/tenders/638b8c94e5c14786a948e4efed6f812e/awards?acc_token=9e41e01773c848deaaf6ffc06b0d7f32 HTTP/1.0
POST /api/2.2/tenders/46876893e50141d69933ba1e00181006/awards?acc_token=ab09244e256442a4a21e1280248f4a00 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 1284
Content-Type: application/json
Expand Down Expand Up @@ -42,12 +42,12 @@ Host: api-sandbox.openprocurement.org

Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/2.1/tenders/638b8c94e5c14786a948e4efed6f812e/awards/9f5f919b51c645e5ade6da27ae35d328
Location: http://api-sandbox.openprocurement.org/api/2.2/tenders/46876893e50141d69933ba1e00181006/awards/f12cffbb3ab8476ead380dee2e1287b0
{
"data": {
"status": "pending",
"complaintPeriod": {
"startDate": "2016-03-28T18:03:49.231023+03:00"
"startDate": "2016-03-30T13:18:55.387092+03:00"
},
"suppliers": [
{
Expand Down Expand Up @@ -77,8 +77,8 @@ Location: http://api-sandbox.openprocurement.org/api/2.1/tenders/638b8c94e5c1478
"amount": 475000.0,
"valueAddedTaxIncluded": true
},
"date": "2016-03-28T18:03:49.229549+03:00",
"id": "9f5f919b51c645e5ade6da27ae35d328"
"date": "2016-03-30T13:18:55.385682+03:00",
"id": "f12cffbb3ab8476ead380dee2e1287b0"
}
}

0 comments on commit 17f8d50

Please sign in to comment.