Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/price quotation #14

Open
wants to merge 124 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
0efda33
Add ports to couchdb
yshalenyk Mar 31, 2020
a50f758
Init pricequotation tender
yshalenyk Mar 31, 2020
696b1c4
Define Item and ShortlistedFirm models
VDigitall Apr 2, 2020
fe003bc
Add new fields to Tender model
VDigitall Apr 2, 2020
86b15ef
Add test for switch tender to `active.tendering`
VDigitall Apr 2, 2020
1770e40
Add test to check if owner can edit what he is supposed to edit
hexponent Apr 2, 2020
5d4b293
Change db name for tests
VDigitall Apr 3, 2020
938bb8c
Update tests for chronograph
VDigitall Apr 3, 2020
6c19562
Fix all chronograph tests
VDigitall Apr 3, 2020
537b033
Add pricequotation to gitlab-ci
yshalenyk Apr 3, 2020
9dc9a03
Add test to check if owner cannot edit what he is supposed not to edit
hexponent Apr 3, 2020
9d30fb7
Add tests for cancell tender in `active.awarded` and `active.qualific…
VDigitall Apr 3, 2020
a866bac
Split owner_can_change test in several patches
hexponent Apr 6, 2020
ec3f61e
Split owner_cannot_change test in several patches
hexponent Apr 6, 2020
95c90ee
Rename `draft.invalid` to `draft.unsuccessful`
VDigitall Apr 8, 2020
7b66955
Fix couchdb connection for tests
yshalenyk Apr 3, 2020
2d493d6
Drop lots and complaints features
yshalenyk Apr 7, 2020
92a439e
Cleanup awards tests
yshalenyk Apr 8, 2020
3b00557
Refactor models to multiple modules
yshalenyk Apr 8, 2020
8032aff
Create new contract model
yshalenyk Apr 8, 2020
b4d14aa
Cleanup roles
yshalenyk Apr 8, 2020
67de52d
Drop meat and more cleanups
yshalenyk Apr 8, 2020
ff69274
Fix almost all tests
hexponent Apr 10, 2020
2bea24b
Remove tests that use disabled validations
hexponent Apr 13, 2020
33769ac
Fix couchdb url for pq tests
hexponent Apr 14, 2020
747cb55
Add proper mock patch to cancellation blanks
hexponent Apr 15, 2020
5f4f47d
Add check of cancellation status during chronograph tender patch
hexponent Apr 15, 2020
848b524
Add RequirementResponses to bid structure
hexponent Apr 15, 2020
88149fa
Extend priquotation procedure models
VDigitall Apr 16, 2020
df53890
Use different classes for types of RequirementResponses
hexponent Apr 16, 2020
0147e5c
Make requirementResponses required, adjust tests
hexponent Apr 16, 2020
5bfb8ff
Fix tests
hexponent Apr 16, 2020
4239ac1
Drop zope && add validation of criterion.requirementGroup and bid.req…
yshalenyk Apr 17, 2020
22cc890
Add documentation tests for pq from belowthreshold
hexponent Apr 22, 2020
5d5364b
Add awards if there are any bids, adjust documentation tests for pq
hexponent Apr 23, 2020
53cc093
add pricequotation to FIRST_STAGE_PROCUREMENT_TYPES
yshalenyk Apr 24, 2020
bd4c995
Drop field `code` in Criterion model
VDigitall Apr 27, 2020
ba5af27
Add smarter set_status for testing
yshalenyk Apr 28, 2020
d1240b3
Switch from generic types to plain strigs
yshalenyk Apr 28, 2020
1033648
Add missing files
yshalenyk Apr 28, 2020
a040b83
Add pq http files
hexponent Apr 29, 2020
2690228
Remove features
hexponent Apr 29, 2020
1ef17f1
Fix tests
yshalenyk Apr 30, 2020
a97d988
Remove unnecessary tests
hexponent Apr 30, 2020
a7bc43f
Fix documentation test
hexponent Apr 30, 2020
2684c44
Make profile in pricequotation required
yshalenyk Apr 30, 2020
6e99ed7
pricequotation: with bug in add_next_award if no bids left
yshalenyk Apr 30, 2020
8bf9223
pricequotation: cleanup views
yshalenyk Apr 30, 2020
ee6e873
pricequotation: cleanup tests
yshalenyk Apr 30, 2020
52247ef
Switch procurementMethod to selective
yshalenyk May 5, 2020
4e9d25e
fix tests and syntax error
yshalenyk May 5, 2020
53740de
Remove pq mention from belowthreshold utils
hexponent May 6, 2020
7152f70
Update docs with new procurementMethod
hexponent May 6, 2020
8e33670
cleanup code
yshalenyk May 6, 2020
9102336
Fix requirementResponses validation
yshalenyk May 8, 2020
b1eaacc
fix logging messages
yshalenyk May 8, 2020
24199d3
Fix creation pricequotation from plan
yshalenyk May 12, 2020
e996a1d
Fix plans tests configuration
yshalenyk May 12, 2020
9bcb3bd
Disable milestones for pricequotation
yshalenyk May 12, 2020
78e566e
Fix procurementMethod for pricequotation in plans
yshalenyk May 13, 2020
41d5223
Fix tests in pricequotation
yshalenyk May 13, 2020
2b5a1d8
pricequotation: update tenderPeriod validation
yshalenyk May 18, 2020
fd7777b
Fix tests after rebase
yshalenyk May 22, 2020
368021d
Implement new awarding
yshalenyk May 20, 2020
fbd9cb5
Update requirementResponses validation message
yshalenyk May 25, 2020
ce657da
Fix description of pricequotation configurator
yshalenyk May 25, 2020
a97dba9
Clean up new_rules
yshalenyk May 25, 2020
f976c28
value is required in pricequotation tender
yshalenyk May 25, 2020
abc7b46
Clean up docker compose
yshalenyk Jun 1, 2020
493458a
Fix docstring for pricequotation init handler
yshalenyk Jun 1, 2020
7c03ca0
Fix award cancellation flow
yshalenyk Jun 1, 2020
8eb7dc5
Fix tests
yshalenyk Jun 1, 2020
c9df891
Add qualification duration constant in pricequotation
yshalenyk Jun 2, 2020
ed5a103
Fix _acl_cancellation in pricequotation tender model
yshalenyk Jun 2, 2020
8e4d70d
Update pq sphinx documentation
hexponent May 27, 2020
e28efcc
Change first award cancellation in sphynx docs
hexponent May 28, 2020
d949d78
Add request to publish tender
hexponent May 28, 2020
52878dd
Add full data result of pq bot publishing
hexponent May 29, 2020
29219e4
Updated descriptions to requirment-responses, translations to uk
OHelesh Jun 1, 2020
baec5dc
Fix files path, rename files
hexponent Jun 2, 2020
9a21dbf
Add award cancellation by tender owner
hexponent Jun 2, 2020
1ac2b57
Fix contract generation after cancelled award
hexponent Jun 2, 2020
f5adf6f
Documentation adjustments
OHelesh Jun 3, 2020
825381b
Pricequotation: items classification and additionalClassifications al…
yshalenyk Jun 3, 2020
bc55325
Cleanup pending cancellation status in pricequotation
yshalenyk Jun 3, 2020
6e850a1
Fix creation of pricequotation from plan
yshalenyk Jun 4, 2020
dbe615e
Add more validators to pricequotation tender document resource
yshalenyk Jun 8, 2020
1f45040
Update contract permissions on pricequotation tender
yshalenyk Jun 8, 2020
992aa32
Update cancellation process in pricequotation
yshalenyk Jun 8, 2020
a1f19db
Refactor tests for pricequotation
yshalenyk Jun 9, 2020
9725221
Fixed tests
yshalenyk Jun 9, 2020
d359382
Cleanup code
yshalenyk Jun 9, 2020
78570a9
Added translation to Overview
OHelesh Jun 11, 2020
5d971bd
Update pq docs with classification changes
hexponent Jun 22, 2020
551d753
Add validation for profile value
VDigitall Jun 25, 2020
2c52187
Change error description when invalid profile id
VDigitall Jun 25, 2020
accfbd9
Pricequotation: add validation for publishing tender
yshalenyk Jun 25, 2020
e8e8fd6
Change tenderPeriod validation
VDigitall Jun 26, 2020
ae3f565
Update tests for SANDBOX_MODE
VDigitall Jun 26, 2020
d7aa462
Update allowed kinds for price quotation
yshalenyk Jun 30, 2020
0e13348
Move tenderPeriod validation to tender model
VDigitall Jul 1, 2020
524ed5a
Style fix
yshalenyk Jul 1, 2020
234058e
Fix publishing from draft in pricequotiation
yshalenyk Jul 2, 2020
c42734b
fix docs test "test_pricequotation.py"
stasivoleh Jun 22, 2020
a7bdbd1
fix "plan_blanks". Add "priceQuotation" to error's description
stasivoleh Jun 22, 2020
1a511df
fix "plan_status". Add "priceQuotation" to error's description
stasivoleh Jun 22, 2020
cf75f44
fix issue "UnicodeWarning: Unicode equal comparison failed to convert…
stasivoleh Jun 23, 2020
fc373a7
Add kind update validation in pricequotation
yshalenyk Jul 2, 2020
292f243
Allow tender_owner switch tender to draft.publishing only
VDigitall Jul 3, 2020
53e096a
Allow create tender in draft status only
VDigitall Jul 3, 2020
df5e143
Add field `unsuccessfulReason` for tender model
VDigitall Jul 6, 2020
b365590
Fix validation of requirementResponeses in pricequotation bid
yshalenyk Jul 6, 2020
7d69529
Update pq docs with classification changes
hexponent Jun 25, 2020
ecc83e0
Change validations order in post_bid view
VDigitall Jul 8, 2020
24c3e31
Fix bids sorting in pricequotation
yshalenyk Jul 10, 2020
a5eed42
Deletion of bids is not allowed in price quotation
yshalenyk Jul 10, 2020
12111bb
Fix award transitions in pricequotation
yshalenyk Jul 14, 2020
de5bf7b
Update pricequotation http files
yshalenyk Jul 20, 2020
2aa094a
change unsuccessfulReason data type
yshalenyk Sep 7, 2020
000df6f
Tender can be only unsuccessful after bid dismissal
yshalenyk Sep 8, 2020
3db8057
Fix max_value validation
yshalenyk Sep 10, 2020
e80284b
Add braces in validation of requirementResponse
yshalenyk Sep 10, 2020
db95a3e
Fix validation of maxValue
yshalenyk Sep 10, 2020
bbeecba
Add test for activating cancelled award
yshalenyk Sep 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix bids sorting in pricequotation
  • Loading branch information
yshalenyk committed Jul 10, 2020
commit 24c3e31d2022384a20f51b59c3e6c987530100e7
20 changes: 13 additions & 7 deletions src/openprocurement/tender/pricequotation/tests/tender_blanks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,6 @@ def first_bid_tender(self):
tender_id = self.tender_id
owner_token = self.tender_token
# create bid
self.app.authorization = ("Basic", ("broker", ""))
response = self.app.post_json(
"/tenders/{}/bids".format(tender_id),
{"data": {
Expand All @@ -1500,18 +1499,19 @@ def first_bid_tender(self):
"requirementResponses": test_requirement_response_valid
}}
)
bid_1 = response.json["data"]["id"]
bid_token1 = response.json["access"]["token"]

# create second bid
self.app.authorization = ("Basic", ("broker", ""))
response = self.app.post_json(
"/tenders/{}/bids".format(tender_id),
{"data": {
"tenderers": [test_organization],
"value": {"amount": 475},
"value": {"amount": 300},
"requirementResponses": test_requirement_response_valid
}}
)
bid_2 = response.json["data"]["id"]
bid_token2 = response.json["access"]["token"]
self.set_status('active.tendering', 'end')
resp = self.check_chronograph()
Expand All @@ -1520,17 +1520,23 @@ def first_bid_tender(self):
self.app.authorization = ("Basic", ("broker", ""))
response = self.app.get("/tenders/{}/awards?acc_token={}".format(tender_id, owner_token))
# get pending award
award_id = [i["id"] for i in response.json["data"] if i["status"] == "pending"][0]
award = [i for i in response.json["data"] if i["status"] == "pending"][0]
award_id = award['id']
self.assertEqual(award['bid_id'], bid_2)
self.assertEqual(award['value']['amount'], 300)
# set award as unsuccessful
self.app.patch_json(
"/tenders/{}/awards/{}?acc_token={}".format(tender_id, award_id, bid_token1),
"/tenders/{}/awards/{}?acc_token={}".format(tender_id, award_id, bid_token2),
{"data": {"status": "unsuccessful"}},
)
# get awards
self.app.authorization = ("Basic", ("broker", ""))
response = self.app.get("/tenders/{}/awards?acc_token={}".format(tender_id, owner_token))
# get pending award
award2_id = [i["id"] for i in response.json["data"] if i["status"] == "pending"][0]
award = [i for i in response.json["data"] if i["status"] == "pending"][0]
award2_id = award['id']
self.assertEqual(award['bid_id'], bid_1)
self.assertEqual(award['value']['amount'], 450)
self.assertNotEqual(award_id, award2_id)

# get awards
Expand All @@ -1540,7 +1546,7 @@ def first_bid_tender(self):
award_id = [i["id"] for i in response.json["data"] if i["status"] == "pending"][0]
# set award as active
self.app.patch_json(
"/tenders/{}/awards/{}?acc_token={}".format(tender_id, award_id, bid_token2),
"/tenders/{}/awards/{}?acc_token={}".format(tender_id, award_id, bid_token1),
{"data": {"status": "active"}}
)
# get contract id
Expand Down
4 changes: 2 additions & 2 deletions src/openprocurement/tender/pricequotation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def add_next_award(request):
a.bid_id for a in tender.awards
if a.status == "unsuccessful"
]
bids = [
bids = sorted([
bid for bid in tender.bids
if bid.id not in unsuccessful_awards
]
], key=lambda bid: bid.value.amount)
if bids:
bid = bids[0].serialize()
award = type(tender).awards.model_class(
Expand Down