Skip to content

Commit

Permalink
Merge pull request #137 from Crown-Commercial-Service/feature/NDMP-96…
Browse files Browse the repository at this point in the history
…-update-frameworks-to-have-framework-award-form-content

NDMP-96 - Update the create agreement method to require the signed agreement details
  • Loading branch information
tim-s-ccs authored Oct 1, 2024
2 parents 6afd8f1 + ebae936 commit c264128
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Records breaking changes from major version bumps

## 27.0.0

Require the agreement details when creating a framework agreement

## 26.0.0

Rename Supplier Evaluation methods to Lot Questions Response
Expand Down
2 changes: 1 addition & 1 deletion dmapiclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '26.7.0'
__version__ = '27.0.0'

from .errors import APIError, HTTPError, InvalidResponse # noqa
from .errors import REQUEST_ERROR_STATUS_CODE, REQUEST_ERROR_MESSAGE # noqa
Expand Down
8 changes: 6 additions & 2 deletions dmapiclient/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,11 +1089,15 @@ def get_supplier_framework_agreement(self, framework_slug):
return self._get(
"/agreements/{}".format(framework_slug))

def create_framework_agreement(self, supplier_id, framework_slug, user=None):
def create_framework_agreement(self, supplier_id, framework_slug, signed_agreement_details, user=None):
return self._post_with_updated_by(
"/agreements",
data={
"agreement": {"supplierId": supplier_id, "frameworkSlug": framework_slug},
"agreement": {
"supplierId": supplier_id,
"frameworkSlug": framework_slug,
"signedAgreementDetails": signed_agreement_details
},
},
user=user
)
Expand Down
19 changes: 17 additions & 2 deletions tests/test_data_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2401,11 +2401,26 @@ def test_create_framework_agreement(self, data_client, rmock):
json={"agreement": {'details': 'here'}},
status_code=201)

result = data_client.create_framework_agreement(10, 'g-cloud-8', "user@example.com")
result = data_client.create_framework_agreement(
10,
'g-cloud-8',
{
"signerName": "Rex",
"signerRole": "Driver of the Aegis"
},
"user@example.com"
)

assert result == {"agreement": {'details': 'here'}}
assert rmock.last_request.json() == {
"agreement": {"supplierId": 10, "frameworkSlug": "g-cloud-8"},
"agreement": {
"supplierId": 10,
"frameworkSlug": "g-cloud-8",
"signedAgreementDetails": {
"signerName": "Rex",
"signerRole": "Driver of the Aegis"
}
},
"updated_by": "user@example.com",
}

Expand Down

0 comments on commit c264128

Please sign in to comment.