diff --git a/openprocurement_client/resources/lots.py b/openprocurement_client/resources/lots.py index e2db820..383ad9a 100644 --- a/openprocurement_client/resources/lots.py +++ b/openprocurement_client/resources/lots.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from openprocurement_client.clients import APIResourceClient -from openprocurement_client.constants import LOTS +from openprocurement_client.constants import LOTS, CONTRACTS class LotsClient(APIResourceClient): @@ -18,3 +18,14 @@ def patch_auction(self, lot_id, data, auction_id, access_token): return self.patch_resource_item_subitem( lot_id, {'data': data}, 'auctions', auction_id, access_token=access_token ) + + def patch_contract(self, lot_id, contract_id, access_token, data): + if not access_token: + # used by caravan + return self.patch_resource_item_subitem(lot_id, data, CONTRACTS, contract_id) + return self.patch_resource_item_subitem( + lot_id, data, CONTRACTS, contract_id, access_token=access_token + ) + + def get_contract(self, lot_id, contract_id): + return self.get_resource_item_subitem(lot_id, contract_id, depth_path=CONTRACTS)