Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/documentation'
Browse files Browse the repository at this point in the history
  • Loading branch information
annawzz committed Oct 6, 2017
2 parents c152e58 + ee1a4eb commit 0d60238
Show file tree
Hide file tree
Showing 19 changed files with 706 additions and 240 deletions.
48 changes: 39 additions & 9 deletions docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1587,20 +1587,25 @@ def test_multiple_lots(self):

# add lots
with open('docs/source/multiple_lots_tutorial/tender-add-lot.http', 'w') as self.app.file_obj:
response = self.app.post_json('/tenders/{}/lots?acc_token={}'.format(tender_id, owner_token), {'data': test_lots[0]})
response = self.app.post_json('/tenders/{}/lots?acc_token={}'.format(tender_id, owner_token),
{'data': test_lots[0]})
self.assertEqual(response.status, '201 Created')
lot_id1 = response.json['data']['id']

response = self.app.post_json('/tenders/{}/lots?acc_token={}'.format(tender_id, owner_token), {'data': test_lots[1]})
self.assertEqual(response.status, '201 Created')
lot_id2 = response.json['data']['id']
# add second lot
with open('docs/source/multiple_lots_tutorial/tender-add-lot2.http', 'w') as self.app.file_obj:
response = self.app.post_json('/tenders/{}/lots?acc_token={}'.format(tender_id, owner_token),
{'data': test_lots[1]})
self.assertEqual(response.status, '201 Created')
lot_id2 = response.json['data']['id']

# add relatedLot for item
with open('docs/source/multiple_lots_tutorial/tender-add-relatedLot-to-item.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}?acc_token={}'.format(tender_id, owner_token),
{"data": {"items": [{'relatedLot': lot_id1}, {'relatedLot': lot_id2}]}})
self.assertEqual(response.status, '200 OK')

# we need to make two requests to get list of tenders. Because first request gives empty list.
response = self.app.get(request_path)
with open('docs/source/multiple_lots_tutorial/tender-listing-no-auth.http', 'w') as self.app.file_obj:
self.app.authorization = None
response = self.app.get(request_path)
Expand Down Expand Up @@ -1656,7 +1661,8 @@ def test_multiple_lots(self):
bid2_token = response.json['access']['token']

with open('docs/source/multiple_lots_tutorial/tender-invalid-all-bids.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/lots/{}?acc_token={}'.format(tender_id, lot_id2, owner_token), {'data': {'minValue': {'amount': 400}}})
response = self.app.patch_json('/tenders/{}?acc_token={}'.format(tender_id, owner_token),
{'data': {"NBUdiscountRate": 0.26}})
self.assertEqual(response.status, '200 OK')

with open('docs/source/multiple_lots_tutorial/bid-lot1-invalid-view.http', 'w') as self.app.file_obj:
Expand All @@ -1666,13 +1672,37 @@ def test_multiple_lots(self):
with open('docs/source/multiple_lots_tutorial/bid-lot1-update-view.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/bids/{}?acc_token={}'.format(tender_id, bid1_id, bid1_token),
{'data': {'lotValues': [{"subcontractingDetails": "ДКП «Орфей»",
"value": {"amount": 500}, 'relatedLot': lot_id1}], 'status': 'pending'}})
"value": {
'annualCostsReduction': [200] + [1000] * 20,
'yearlyPaymentsPercentage': 0.87,
'contractDuration': {
"years": 7
}
},
'relatedLot': lot_id1}], 'status': 'pending'}})
self.assertEqual(response.status, '200 OK')


with open('docs/source/multiple_lots_tutorial/bid-lot2-update-view.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/bids/{}?acc_token={}'.format(tender_id, bid2_id, bid2_token),
{'data': {'lotValues': [{"value": {"amount": 500}, 'relatedLot': lot_id1}], 'status': 'pending'}})
{'data': {
'lotValues': [
{"value": {'annualCostsReduction': [700] + [1600] * 20,
'yearlyPaymentsPercentage': 0.9,
'contractDuration': {
"years": 7
}
},
'relatedLot': lot_id1},
{"subcontractingDetails": "ДКП «Укр Прінт», Україна",
"value": {'annualCostsReduction': [600] + [1200] * 20,
'yearlyPaymentsPercentage': 0.96,
'contractDuration': {
"years": 9
}
},
'relatedLot': lot_id2}
],
'status': 'pending'}})
self.assertEqual(response.status, '200 OK')
# switch to active.pre-qualification
self.time_shift('active.pre-qualification')
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Contents:

overview
tutorial
multiple_lots_tutorial
standard/index.rst


Expand Down
123 changes: 123 additions & 0 deletions docs/source/multiple_lots_tutorial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
.. _mulitlot_tutorial:

Multiple Lots Tutorial
======================


Creating tender
---------------

Let's create tender:

.. include:: multiple_lots_tutorial/tender-post-attempt-json-data.http
:code:

Now we can see that new object was created. Response code is `201`
and `Location` response header reports the location of the created object. The
body of response reveals the information about the created tender: its internal
`id` (that matches the `Location` segment), its official `tenderID` and
`dateModified` datestamp stating the moment in time when tender was last
modified. Note that tender is created with `active.tendering` status.

The peculiarity of the ESCO procedure is that ``procurementMethodType`` was changed to ``esco``.
Also, new fields ``NBUdiscountRate``, ``minimalStepPercentage``, ``fundingKind``, ``yearlyPaymentsPercentageRange`` were added to tender object.

There is also no opportunity to set up ``enquiryPeriod``, it will be assigned automatically.

Adding lots
---------------

Tender can contain several different lots. We can add lot using the following way:

.. include:: multiple_lots_tutorial/tender-add-lot.http
:code:

Let's add second lot to our tender:

.. include:: multiple_lots_tutorial/tender-add-lot2.http
:code:

Also you will need to update tender data about item's related lots:

.. include:: multiple_lots_tutorial/tender-add-relatedLot-to-item.http
:code:

View tender listing:

.. include:: multiple_lots_tutorial/tender-listing-no-auth.http
:code:

or view tender:

.. include:: multiple_lots_tutorial/tender-view.http
:code:



Registering bid
---------------

Tender status ``active.tendering`` allows registration of bids.

Bidder can register a bid for lot №1:

.. include:: multiple_lots_tutorial/bid-lot1.http
:code:

Bidder can register bids for all lots:

.. include:: multiple_lots_tutorial/bid-lot2.http
:code:

Then bidder should upload technical and private documents of proposal.

We can update tender during ``active.tendering`` period. Bids will be invalid after updating tender. For example, let's change ``NBUdiscountRate`` to 0.26.

.. include:: multiple_lots_tutorial/tender-invalid-all-bids.http
:code:

Here is the bidder's proposal after tender was updated. It's ``status`` is `invalid`.

.. include:: multiple_lots_tutorial/bid-lot1-invalid-view.http
:code:

Firstly bidder has to renew bid, even if he was placing a bid just for a lot №1.

.. include:: multiple_lots_tutorial/bid-lot1-update-view.http
:code:

Then bidder has to renew bid for both lots.

.. include:: multiple_lots_tutorial/bid-lot2-update-view.http
:code:


Bid Qualification
-----------------

ESCO procedure requires bid's value qualification.

Let's view tender:

.. include:: multiple_lots_tutorial/tender-view-pre-qualification.http
:code:

Let's list qualifications:

.. include:: multiple_lots_tutorial/qualifications-view.http
:code:

Approve bid's value through qualification objects:

.. include:: multiple_lots_tutorial/tender-activate-qualifications.http
:code:


Procuring entity approves qualifications by switching to next status:

.. include:: multiple_lots_tutorial/tender-view-pre-qualification-stand-still.http
:code:

There is 10 day stand-still period set in `qualificationPeriod`.


4 changes: 2 additions & 2 deletions docs/source/multiple_lots_tutorial/bid-lot1-invalid-view.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GET /api/2.4/tenders/b204841c7ee844019a1038571b96b55a/bids/3434c61229b84da2a54e1d942aab149b?acc_token=7c1cdef8852b4963827ba7180881a626 HTTP/1.0
GET /api/2.4/tenders/032ad48817a74526a52bbdc065449884/bids/5e7484de25494044b2f974592af01d5f?acc_token=6691078b7bb245308b8c71474b328c8c HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org

Expand All @@ -7,7 +7,7 @@ Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "invalid",
"id": "3434c61229b84da2a54e1d942aab149b"
"id": "5e7484de25494044b2f974592af01d5f"
}
}

46 changes: 36 additions & 10 deletions docs/source/multiple_lots_tutorial/bid-lot1-update-view.http
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PATCH /api/2.4/tenders/b204841c7ee844019a1038571b96b55a/bids/3434c61229b84da2a54e1d942aab149b?acc_token=7c1cdef8852b4963827ba7180881a626 HTTP/1.0
PATCH /api/2.4/tenders/032ad48817a74526a52bbdc065449884/bids/5e7484de25494044b2f974592af01d5f?acc_token=6691078b7bb245308b8c71474b328c8c HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 214
Content-Length: 418
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
Expand All @@ -9,9 +9,35 @@ DATA:
"status": "pending",
"lotValues": [
{
"relatedLot": "0b447ad702e64138b2c550dfe583c7f2",
"relatedLot": "0e0d16f25ed5424a9dc07eeee9976392",
"value": {
"amount": 500
"contractDuration": {
"years": 7
},
"yearlyPaymentsPercentage": 0.87,
"annualCostsReduction": [
200,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000,
1000
]
},
"subcontractingDetails": "ДКП «Орфей»"
}
Expand All @@ -27,19 +53,19 @@ Content-Type: application/json; charset=UTF-8
"selfEligible": true,
"lotValues": [
{
"relatedLot": "0b447ad702e64138b2c550dfe583c7f2",
"date": "2017-10-03T11:18:05.725574+03:00",
"relatedLot": "0e0d16f25ed5424a9dc07eeee9976392",
"date": "2017-10-06T17:05:15.214917+03:00",
"status": "pending",
"value": {
"yearlyPaymentsPercentage": 0.87,
"valueAddedTaxIncluded": true,
"currency": "UAH",
"amount": 6051.86301369863,
"amount": 6059.01,
"contractDuration": {
"days": 0,
"years": 7
},
"amountPerformance": 1483.9856174439371,
"amountPerformance": 1121.86,
"annualCostsReduction": [
200.0,
1000.0,
Expand Down Expand Up @@ -90,8 +116,8 @@ Content-Type: application/json; charset=UTF-8
}
}
],
"date": "2017-10-03T11:18:05.725015+03:00",
"id": "3434c61229b84da2a54e1d942aab149b"
"date": "2017-10-06T17:05:15.214276+03:00",
"id": "5e7484de25494044b2f974592af01d5f"
}
}

20 changes: 10 additions & 10 deletions docs/source/multiple_lots_tutorial/bid-lot1.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST /api/2.4/tenders/b204841c7ee844019a1038571b96b55a/bids HTTP/1.0
POST /api/2.4/tenders/032ad48817a74526a52bbdc065449884/bids HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 1188
Content-Type: application/json
Expand All @@ -10,7 +10,7 @@ DATA:
"selfQualified": true,
"lotValues": [
{
"relatedLot": "0b447ad702e64138b2c550dfe583c7f2",
"relatedLot": "0e0d16f25ed5424a9dc07eeee9976392",
"value": {
"contractDuration": {
"years": 7
Expand Down Expand Up @@ -70,29 +70,29 @@ DATA:

Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/2.4/tenders/b204841c7ee844019a1038571b96b55a/bids/3434c61229b84da2a54e1d942aab149b
Location: http://api-sandbox.openprocurement.org/api/2.4/tenders/032ad48817a74526a52bbdc065449884/bids/5e7484de25494044b2f974592af01d5f
{
"access": {
"token": "7c1cdef8852b4963827ba7180881a626"
"token": "6691078b7bb245308b8c71474b328c8c"
},
"data": {
"status": "pending",
"selfEligible": true,
"lotValues": [
{
"relatedLot": "0b447ad702e64138b2c550dfe583c7f2",
"date": "2017-10-03T11:18:05.725574+03:00",
"relatedLot": "0e0d16f25ed5424a9dc07eeee9976392",
"date": "2017-10-06T17:05:15.214917+03:00",
"status": "pending",
"value": {
"yearlyPaymentsPercentage": 0.87,
"valueAddedTaxIncluded": true,
"currency": "UAH",
"amount": 6051.86301369863,
"amount": 6059.01,
"contractDuration": {
"days": 0,
"years": 7
},
"amountPerformance": 1483.9856174439371,
"amountPerformance": 1484.98,
"annualCostsReduction": [
200.0,
1000.0,
Expand Down Expand Up @@ -143,8 +143,8 @@ Location: http://api-sandbox.openprocurement.org/api/2.4/tenders/b204841c7ee8440
}
}
],
"date": "2017-10-03T11:18:05.725015+03:00",
"id": "3434c61229b84da2a54e1d942aab149b"
"date": "2017-10-06T17:05:15.214276+03:00",
"id": "5e7484de25494044b2f974592af01d5f"
}
}

0 comments on commit 0d60238

Please sign in to comment.