Skip to content

Commit

Permalink
Rename contract status to pending.winner-signing
Browse files Browse the repository at this point in the history
  • Loading branch information
VDigitall committed Mar 26, 2020
1 parent 4fe6ee9 commit f90bf3d
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 63 deletions.
2 changes: 1 addition & 1 deletion src/openprocurement/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ class Contract(Model):
description = StringType() # Contract description
description_en = StringType()
description_ru = StringType()
status = StringType(choices=["pending", "pending.winnerSigning", "terminated", "active", "cancelled"], default="pending")
status = StringType(choices=["pending", "pending.winner-signing", "terminated", "active", "cancelled"], default="pending")
period = ModelType(Period)
value = ModelType(Value)
dateSigned = IsoDateTimeType()
Expand Down
76 changes: 38 additions & 38 deletions src/openprocurement/tender/belowthreshold/tests/contract_blanks.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@ def patch_tender_contract_status_by_owner(self):
self.app.authorization = ("Basic", ("broker", ""))
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}},
{"data": {"status": "pending.winner-signing"}},
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, contract_id, self.tender_token),
Expand Down Expand Up @@ -604,7 +604,7 @@ def patch_tender_contract_status_by_supplier(self):
self.app.authorization = ("Basic", ("broker", ""))
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, contract_id, bid_token),
{"data": {"status": "pending.winnerSigning"}},
{"data": {"status": "pending.winner-signing"}},
status=403
)
self.assertEqual(response.status, "403 Forbidden")
Expand All @@ -627,10 +627,10 @@ def patch_tender_contract_status_by_supplier(self):
# Tender onwer
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}},
{"data": {"status": "pending.winner-signing"}},
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")


# Supplier
Expand Down Expand Up @@ -684,7 +684,7 @@ def patch_tender_contract_status_by_others(self):
self.app.authorization = ("Basic", ("broker", ""))
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, contract_id, bid_token),
{"data": {"status": "pending.winnerSigning"}},
{"data": {"status": "pending.winner-signing"}},
status=403
)
self.assertEqual(response.status, "403 Forbidden")
Expand All @@ -693,10 +693,10 @@ def patch_tender_contract_status_by_others(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, contract_id, bid_token),
Expand Down Expand Up @@ -970,10 +970,10 @@ def create_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.post(
"/tenders/{}/contracts/{}/documents?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
Expand Down Expand Up @@ -1082,10 +1082,10 @@ def create_tender_contract_document_by_supplier(self):
# Tender owner
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

# Supplier
response = self.app.post(
Expand Down Expand Up @@ -1191,10 +1191,10 @@ def create_tender_contract_document_by_others(self):
# Tender owner
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

# Bid onwer
response = self.app.post(
Expand Down Expand Up @@ -1254,10 +1254,10 @@ def put_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.put(
"/tenders/{}/contracts/{}/documents/{}?acc_token={}".format(
Expand Down Expand Up @@ -1387,10 +1387,10 @@ def put_tender_contract_document_by_supplier(self):
# Tender owner
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

# Supplier
response = self.app.post(
Expand Down Expand Up @@ -1517,10 +1517,10 @@ def put_tender_contract_document_by_others(self):
# Tender owner
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

# Bid owner
response = self.app.post(
Expand All @@ -1545,10 +1545,10 @@ def patch_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.patch_json(
"/tenders/{}/contracts/{}/documents/{}?acc_token={}".format(
Expand Down Expand Up @@ -1647,10 +1647,10 @@ def patch_tender_contract_document_by_supplier(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.post(
"/tenders/{}/contracts/{}/documents?acc_token={}".format(self.tender_id, self.contract_id, bid_token),
Expand Down Expand Up @@ -1717,10 +1717,10 @@ def patch_tender_contract_document_by_supplier(self):
def lot2_create_tender_contract_document(self):
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.post(
"/tenders/{}/contracts/{}/documents?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
Expand Down Expand Up @@ -1791,10 +1791,10 @@ def lot2_create_tender_contract_document_by_supplier(self):
# Tender owner
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

# Supplier
response = self.app.post(
Expand Down Expand Up @@ -1851,10 +1851,10 @@ def lot2_create_tender_contract_document_by_others(self):
# Tender owner
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

# Bid owner
response = self.app.post(
Expand Down Expand Up @@ -1891,10 +1891,10 @@ def lot2_put_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.put(
"/tenders/{}/contracts/{}/documents/{}?acc_token={}".format(
Expand Down Expand Up @@ -1969,10 +1969,10 @@ def lot2_put_tender_contract_document_by_supplier(self):
# Tender owner
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

# Supplier
response = self.app.post(
Expand Down Expand Up @@ -2044,10 +2044,10 @@ def lot2_patch_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.patch_json(
"/tenders/{}/contracts/{}/documents/{}?acc_token={}".format(
Expand Down Expand Up @@ -2112,10 +2112,10 @@ def lot2_patch_tender_contract_document_by_supplier(self):
# Tender owner
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

# Supplier
response = self.app.post(
Expand Down
4 changes: 2 additions & 2 deletions src/openprocurement/tender/belowthreshold/views/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def patch(self):
contract_status = self.request.context.status
apply_patch(self.request, save=False, src=self.request.context.serialize())
if contract_status != self.request.context.status and \
(contract_status not in ("pending", "pending.winnerSigning",) or \
self.request.context.status not in ("active", "pending", "pending.winnerSigning",)):
(contract_status not in ("pending", "pending.winner-signing",) or \
self.request.context.status not in ("active", "pending", "pending.winner-signing",)):
raise_operation_error(self.request, "Can't update contract status")
if self.request.context.status == "active" and not self.request.context.dateSigned:
self.request.context.dateSigned = get_now()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def validate_contract_document(self, operation):
]
):
raise_operation_error(self.request, "Can {} document only in active lot status".format(operation))
if self.request.validated["contract"].status not in ["pending", "pending.winnerSigning", "active"]:
if self.request.validated["contract"].status not in ["pending", "pending.winner-signing", "active"]:
raise_operation_error(self.request, "Can't {} document in current contract status".format(operation))
return True

Expand Down
24 changes: 12 additions & 12 deletions src/openprocurement/tender/cfaselectionua/tests/contract_blanks.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ def create_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.post(
"/tenders/{}/contracts/{}/documents?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
Expand Down Expand Up @@ -718,10 +718,10 @@ def put_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.put(
"/tenders/{}/contracts/{}/documents/{}?acc_token={}".format(
Expand Down Expand Up @@ -840,10 +840,10 @@ def patch_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.patch_json(
"/tenders/{}/contracts/{}/documents/{}?acc_token={}".format(
Expand Down Expand Up @@ -919,10 +919,10 @@ def patch_tender_contract_document(self):
def lot2_create_tender_contract_document(self):
response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.post(
"/tenders/{}/contracts/{}/documents?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
Expand Down Expand Up @@ -995,10 +995,10 @@ def lot2_put_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.put(
"/tenders/{}/contracts/{}/documents/{}?acc_token={}".format(
Expand Down Expand Up @@ -1063,10 +1063,10 @@ def lot2_patch_tender_contract_document(self):

response = self.app.patch_json(
"/tenders/{}/contracts/{}?acc_token={}".format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "pending.winnerSigning"}}
{"data": {"status": "pending.winner-signing"}}
)
self.assertEqual(response.status, "200 OK")
self.assertEqual(response.json["data"]["status"], "pending.winnerSigning")
self.assertEqual(response.json["data"]["status"], "pending.winner-signing")

response = self.app.patch_json(
"/tenders/{}/contracts/{}/documents/{}?acc_token={}".format(
Expand Down
4 changes: 2 additions & 2 deletions src/openprocurement/tender/cfaselectionua/views/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def patch(self):
contract_status = self.request.context.status
apply_patch(self.request, save=False, src=self.request.context.serialize())
if contract_status != self.request.context.status and \
(contract_status not in ("pending", "pending.winnerSigning",) or \
self.request.context.status not in ("active", "pending", "pending.winnerSigning",)):
(contract_status not in ("pending", "pending.winner-signing",) or \
self.request.context.status not in ("active", "pending", "pending.winner-signing",)):
raise_operation_error(self.request, "Can't update contract status")
if self.request.context.status == "active" and not self.request.context.dateSigned:
self.request.context.dateSigned = get_now()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def validate_contract_document(self, operation):
]
):
raise_operation_error(self.request, "Can {} document only in active lot status".format(operation))
if self.request.validated["contract"].status not in ["pending", "pending.winnerSigning", "active"]:
if self.request.validated["contract"].status not in ["pending", "pending.winner-signing", "active"]:
raise_operation_error(self.request, "Can't {} document in current contract status".format(operation))
return True

Expand Down
Loading

0 comments on commit f90bf3d

Please sign in to comment.