Skip to content
Merged
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion openprocurement_client/resources/lots.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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)