Blame view

op_robot_tests/tests_files/brokers/openprocurement_client.robot 118 KB
Taras Kozlovskyi authored
1
*** Settings ***
2
Library  openprocurement_client_helper.py
3
Library  openprocurement_client.utils
Taras Kozlovskyi authored
4
5
Taras Kozlovskyi authored
6
*** Keywords ***
7
Отримати internal id по UAid
8 9 10
  [Arguments]  ${username}  ${tender_uaid}
  Log  ${username}
  Log  ${tender_uaid}
11 12 13
  Log Many  ${USERS.users['${username}'].id_map}
  ${status}=  Run Keyword And Return Status  Dictionary Should Contain Key  ${USERS.users['${username}'].id_map}  ${tender_uaid}
  Run Keyword And Return If  ${status}  Get From Dictionary  ${USERS.users['${username}'].id_map}  ${tender_uaid}
14 15
  Call Method  ${USERS.users['${username}'].client}  get_tenders
  ${tender_id}=  Wait Until Keyword Succeeds  5x  30 sec  get_tender_id_by_uaid  ${tender_uaid}  ${USERS.users['${username}'].client}
16
  Set To Dictionary  ${USERS.users['${username}'].id_map}  ${tender_uaid}  ${tender_id}
Leits authored
17
  [return]  ${tender_id}
18
19
20 21 22 23 24 25 26
Отримати internal id плану по UAid
  [Arguments]  ${username}  ${tender_uaid}
  Log  ${username}
  Log  ${tender_uaid}
  Log Many  ${USERS.users['${username}'].id_map}
  ${status}=  Run Keyword And Return Status  Dictionary Should Contain Key  ${USERS.users['${username}'].id_map}  ${tender_uaid}
  Run Keyword And Return If  ${status}  Get From Dictionary  ${USERS.users['${username}'].id_map}  ${tender_uaid}
AlexDiatlov authored
27 28
  Call Method  ${USERS.users['${username}'].plan_client}  get_plans
  ${tender_id}=  Wait Until Keyword Succeeds  5x  30 sec  get_plan_id_by_uaid  ${tender_uaid}  ${USERS.users['${username}'].plan_client}
29 30 31 32
  Set To Dictionary  ${USERS.users['${username}'].id_map}  ${tender_uaid}  ${tender_id}
  [return]  ${tender_id}

33 34 35 36 37 38 39 40 41 42 43 44 45
Отримати internal id об'єкта моніторингу по UAid
  [Arguments]  ${username}  ${monitoring_uaid}
  Log  ${username}
  Log  ${monitoring_uaid}
  Log Many  ${USERS.users['${username}'].id_map}
  ${status}=  Run Keyword And Return Status  Dictionary Should Contain Key  ${USERS.users['${username}'].id_map}  ${monitoring_uaid}
  Run Keyword And Return If  ${status}  Get From Dictionary  ${USERS.users['${username}'].id_map}  ${monitoring_uaid}
  Call Method  ${USERS.users['${username}'].dasu_client}  get_monitorings
  ${monitoring_id}=  Wait Until Keyword Succeeds  5x  30 sec  get_monitoring_id_by_uaid  ${monitoring_uaid}  ${USERS.users['${username}'].dasu_client}
  Set To Dictionary  ${USERS.users['${username}'].id_map}  ${monitoring_uaid}  ${monitoring_id}
  [return]  ${monitoring_id}

46 47 48 49 50 51 52 53 54 55 56 57 58
Отримати internal id угоди по UAid
  [Arguments]  ${username}  ${agreement_uaid}
  Log  ${username}
  Log  ${agreement_uaid}
  Log Many  ${USERS.users['${username}'].id_map}
  ${status}=  Run Keyword And Return Status  Dictionary Should Contain Key  ${USERS.users['${username}'].id_map}  ${agreement_uaid}
  Run Keyword And Return If  ${status}  Get From Dictionary  ${USERS.users['${username}'].id_map}  ${agreement_uaid}
  Call Method  ${USERS.users['${username}'].agreement_client}  get_agreements
  ${agreement_id}=  Wait Until Keyword Succeeds  5x  30 sec  get_agreement_id_by_uaid  ${agreement_uaid}  ${USERS.users['${username}'].agreement_client}
  Set To Dictionary  ${USERS.users['${username}'].id_map}  ${agreement_uaid}  ${agreement_id}
  [return]  ${agreement_id}

Taras Kozlovskyi authored
59
Підготувати клієнт для користувача
60
  [Arguments]  ${username}
61 62 63
  [Documentation]  Відкрити браузер, створити об’єкти api wrapper і
  ...              ds api wrapper, приєднати їх атрибутами до користувача, тощо
  Log  ${RESOURCE}
64
  Log  ${API_HOST_URL}
65
  Log  ${API_VERSION}
66 67 68 69 70
  Log  ${DS_HOST_URL}
  ${auth_ds_all}=  get variable value  ${USERS.users.${username}.auth_ds}
  ${auth_ds}=  set variable  ${auth_ds_all.${RESOURCE}}
  Log  ${auth_ds}
71
  ${ds_config}=  Create Dictionary  host_url=${ds_host_url}  auth_ds=${auth_ds}
AlexDiatlov authored
72 73 74 75 76 77 78 79
  ${plan_api_wrapper}=  prepare_plan_api_wrapper  ${USERS.users['${username}'].api_key}  PLANS  ${API_HOST_URL}  ${API_VERSION}
  ${tender_api_wrapper}=  prepare_api_wrapper  ${USERS.users['${username}'].api_key}  TENDERS  ${API_HOST_URL}  ${API_VERSION}  ${ds_config}
  ${tender_create_wrapper}=  prepare_tender_create_wrapper
  ...  ${USERS.users['${username}'].api_key}
  ...  PLANS
  ...  ${API_HOST_URL}
  ...  ${API_VERSION}
  ...  ${ds_config}
qa-user-1 authored
80 81 82 83 84 85 86
  ${dasu_api_wraper}=  prepare_dasu_api_wrapper
  ...  ${DASU_RESOURCE}
  ...  ${DASU_API_HOST_URL}
  ...  ${DASU_API_VERSION}
  ...  ${USERS.users['${username}'].auth_dasu[0]}
  ...  ${USERS.users['${username}'].auth_dasu[1]}
  ...  ${ds_config}
87
  ${agreement_wrapper}=  prepare_agreement_api_wrapper  ${USERS.users['${username}'].api_key}  AGREEMENTS  ${API_HOST_URL}  ${API_VERSION}  ${ds_config}
AlexDiatlov authored
88 89 90
  Set To Dictionary  ${USERS.users['${username}']}  client=${tender_api_wrapper}
  Set To Dictionary  ${USERS.users['${username}']}  plan_client=${plan_api_wrapper}
  Set To Dictionary  ${USERS.users['${username}']}  tender_create_client=${tender_create_wrapper}
91
  Set To Dictionary  ${USERS.users['${username}']}  agreement_client=${agreement_wrapper}
92
  Set To Dictionary  ${USERS.users['${username}']}  dasu_client=${dasu_api_wraper}
93
  Set To Dictionary  ${USERS.users['${username}']}  access_token=${EMPTY}
94 95
  ${id_map}=  Create Dictionary
  Set To Dictionary  ${USERS.users['${username}']}  id_map=${id_map}
96
  Log  ${EDR_HOST_URL}
97 98
  Log  ${EDR_VERSION}
  ${edr_wrapper}=  prepare_edr_wrapper  ${EDR_HOST_URL}  ${EDR_VERSION}  ${USERS.users['${username}'].auth_edr[0]}  ${USERS.users['${username}'].auth_edr[1]}
99
  Set To Dictionary  ${USERS.users['${username}']}  edr_client=${edr_wrapper}
100
  #Variables for contracting_management module
101
  ${contract_api_wrapper}=  prepare_contract_api_wrapper  ${USERS.users['${username}'].api_key}  CONTRACTS  ${api_host_url}  ${api_version}  ${ds_config}
102 103
  Set To Dictionary  ${USERS.users['${username}']}  contracting_client=${contract_api_wrapper}
  Set To Dictionary  ${USERS.users['${username}']}  contract_access_token=${EMPTY}
104 105
  Set To Dictionary  ${USERS.users['${username}']}  agreement_access_token=${EMPTY}
  ${contracts_id_map}=  Create Dictionary
106 107
  ${contracts_id_map}=  Create Dictionary
  Set To Dictionary  ${USERS.users['${username}']}  contracts_id_map=${contracts_id_map}
Taras Kozlovskyi authored
108
  Log Variables
109
110
Leits authored
111 112 113 114 115 116
Завантажити документ
  [Arguments]  ${username}  ${filepath}  ${tender_uaid}
  Log  ${username}
  Log  ${tender_uaid}
  Log  ${filepath}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
117
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
118 119 120 121
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  upload_document
  ...      ${filepath}
  ...      ${tender.data.id}
  ...      access_token=${tender.access.token}
Leits authored
122
  Log object data   ${reply}  reply
123
  #return here is needed to have uploaded doc data in `Завантажити документ в лот` keyword
124
  [return]  ${reply}
Leits authored
125 126

127 128 129 130 131 132 133 134
Отримати інформацію із документа
  [Arguments]  ${username}  ${tender_uaid}  ${doc_id}  ${field}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  Log  ${document}
  [Return]  ${document['${field}']}

135 136 137 138 139 140 141 142 143
Отримати інформацію про документ
  [Arguments]  ${username}  ${tender_uaid}  ${doc_id}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  ${file_properties}=  Call Method  ${USERS.users['${username}'].client}  get_file_properties  ${document.url}  ${document.hash}
  Log  ${file_properties}
  [return]  ${file_properties}

Leits authored
144
Отримати документ
145
  [Arguments]  ${username}  ${tender_uaid}  ${doc_id}
Leits authored
146
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
147 148 149
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  ${filename}=  download_file_from_url  ${document.url}  ${OUTPUT_DIR}${/}${document.title}
  [return]  ${filename}
Leits authored
150 151

152 153 154 155 156 157 158
Отримати вміст документа
  [Arguments]  ${username}  ${url}
  ${file_name}=  download_file_from_url  ${url}  ${OUTPUT_DIR}${/}file
  ${file_contents}=  Get File  ${OUTPUT_DIR}${/}${file_name}
  [return]  ${file_contents}

Leits authored
159
Отримати посилання на аукціон для глядача
160
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}=${Empty}
Leits authored
161
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
162 163 164 165
  ${object_with_url}=  get_object_by_id  ${tender.data}  ${lot_id}  lots  id
  Log  ${object_with_url}
  ${auctionUrl}=  Get Variable Value  ${object_with_url['auctionUrl']}
  [Return]  ${auctionUrl}
Leits authored
166
167 168 169 170

Отримати посилання на аукціон для учасника
  [Arguments]  ${username}  ${tender_uaid}  ${relatedLot}=${Empty}
  ${bid}=  openprocurement_client.Отримати пропозицію  ${username}  ${tender_uaid}
171 172 173 174
  ${object_with_url}=  get_object_by_id  ${bid.data}  ${relatedLot}  lotValues  relatedLot
  Log  ${object_with_url}
  ${participationUrl}=  Get Variable Value  ${object_with_url['participationUrl']}
  [Return]  ${participationUrl}
175
Leits authored
176 177 178 179
##############################################################################
#             Tender operations
##############################################################################
180
Підготувати дані для оголошення тендера
181
  [Documentation]  Це слово використовується в майданчиків, тому потрібно, щоб воно було і тут
182
  [Arguments]  ${username}  ${tender_data}  ${role_name}
183
  [return]  ${tender_data}
184
185
186 187 188 189 190
Перевірити наявність повідомлення
  [Arguments]  ${username}  ${msg}
  Log  ${\n}${msg}${\n}  WARN

Taras Kozlovskyi authored
191
Створити тендер
192
  [Arguments]  ${username}  ${tender_data}
AlexDiatlov authored
193
  ${file_path}=  Get Variable Value  ${ARTIFACT_FILE}  artifact_plan.yaml
AlexDiatlov authored
194 195 196 197 198 199 200
  ${ARTIFACT}=  load_data_from  ${file_path}
  Log  ${ARTIFACT.tender_owner_access_token}
  Log  ${ARTIFACT.tender_id}
  ${tender}=  Call Method  ${USERS.users['${username}'].tender_create_client}  create_tender
  ...      ${ARTIFACT.tender_id}
  ...      ${tender_data}
  ...      access_token=${ARTIFACT.tender_owner_access_token}
201
  Log  ${tender}
202
  ${access_token}=  Get Variable Value  ${tender.access.token}
203 204
  ${status}=  Set Variable If  'open' in '${MODE}'  active.tendering  ${EMPTY}
  ${status}=  Set Variable If  'below' in '${MODE}'  active.enquiries  ${status}
205
  ${status}=  Set Variable If  'selection' in '${MODE}'  draft.pending  ${status}
206 207
  ${status}=  Set Variable If  '${status}'=='${EMPTY}'  active   ${status}
  Set To Dictionary  ${tender['data']}  status=${status}
208 209 210 211
  ${tender}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
212
  Log  ${tender}
213
  Log  ${\n}${API_HOST_URL}/api/${API_VERSION}/tenders/${tender.data.id}${\n}  WARN
214 215
  Set To Dictionary  ${USERS.users['${username}']}   access_token=${access_token}
  Set To Dictionary  ${USERS.users['${username}']}   tender_data=${tender}
216 217
  Log   ${USERS.users['${username}'].tender_data}
  [return]  ${tender.data.tenderID}
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239


Створити тендер другого етапу
  [Arguments]  ${username}  ${tender_data}
  ${tender}=  Call Method  ${USERS.users['${username}'].client}  create_tender  ${tender_data}
  Log  ${tender}
  ${access_token}=  Get Variable Value  ${tender.access.token}
  ${status}=  Set Variable If  'open' in '${MODE}'  active.tendering  ${EMPTY}
  ${status}=  Set Variable If  'below' in '${MODE}'  active.enquiries  ${status}
  ${status}=  Set Variable If  'selection' in '${MODE}'  draft.pending  ${status}
  ${status}=  Set Variable If  '${status}'=='${EMPTY}'  active   ${status}
  Set To Dictionary  ${tender['data']}  status=${status}
  ${tender}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
  Log  ${tender}
  Log  ${\n}${API_HOST_URL}/api/${API_VERSION}/tenders/${tender.data.id}${\n}  WARN
  Set To Dictionary  ${USERS.users['${username}']}   access_token=${access_token}
  Set To Dictionary  ${USERS.users['${username}']}   tender_data=${tender}
  Log   ${USERS.users['${username}'].tender_data}
  [return]  ${tender.data.tenderID}
240
241
242 243 244 245 246 247 248 249 250 251 252 253 254
Створити об'єкт моніторингу
  [Arguments]  ${username}  ${monitoring_data}
  ${monitoring}=  Call Method  ${USERS.users['${username}'].dasu_client}  create_monitoring  ${monitoring_data}
  Log  ${monitoring}
  ${access_token}=  Get Variable Value  ${monitoring.access.token}
  Log  ${\n}${DASU_API_HOST_URL}/api/${DASU_API_VERSION}/monitorings/${monitoring.data.id}${\n}  WARN
  Set To Dictionary  ${USERS.users['${username}']}   access_token=${access_token}
  Set To Dictionary  ${USERS.users['${username}']}   monitoring_data=${monitoring}
  Log   ${USERS.users['${username}'].monitoring_data}
  [return]  ${monitoring.data.monitoring_id}


Оприлюднити рішення про початок моніторингу
255
  [Arguments]  ${username}  ${monitoring_uaid}  ${file_path}  ${monitoring_data}
ivanka12 authored
256
  ${document}=  Call Method  ${USERS.users['${username}'].dasu_client}  upload_obj_document  ${file_path}
257 258 259
  ${documents}=  Create List
  Append To List  ${documents}  ${document.data}
  Set To Dictionary  ${monitoring_data.data.decision}  documents=${documents}
260
  Log  ${monitoring_data}
ivanka12 authored
261 262
  ${monitoring_id}=  Set Variable  ${USERS.users['${username}'].monitoring_data.data.id}
  ${reply}=  Call Method  ${USERS.users['${username}'].dasu_client}  patch_monitoring  ${monitoring_data}  ${monitoring_id}
263
  Log  ${reply}
264
  Set To Dictionary  ${USERS.users['${dasu_user}'].initial_data.data}  decision=${monitoring_data.data.decision}
265 266 267 268
  Set To Dictionary  ${USERS.users['${username}']}   monitoring_data=${reply}
  [return]  ${reply}

269 270
Створити план
  [Arguments]  ${username}  ${tender_data}
AlexDiatlov authored
271
  ${tender}=  Call Method  ${USERS.users['${username}'].plan_client}  create_plan  ${tender_data}
272 273
  Log  ${tender}
  ${access_token}=  Get Variable Value  ${tender.access.token}
AlexDiatlov authored
274
  ${tender}=  Call Method  ${USERS.users['${username}'].plan_client}  patch_plan
275 276 277
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
278 279 280 281 282 283 284 285
  Log  ${tender}
  Log  ${\n}${API_HOST_URL}/api/${API_VERSION}/plans/${tender.data.id}${\n}  WARN
  Set To Dictionary  ${USERS.users['${username}']}   access_token=${access_token}
  Set To Dictionary  ${USERS.users['${username}']}   tender_data=${tender}
  Log   ${USERS.users['${username}'].tender_data}
  [return]  ${tender.data.planID}

286 287
Отримати список тендерів
  [Arguments]  ${username}
288 289
  @{tenders_feed}=  get_tenders_feed  ${USERS.users['${username}'].client}
  [return]  @{tenders_feed}
290 291 292 293


Отримати тендер по внутрішньому ідентифікатору
  [Arguments]  ${username}  ${internalid}  ${save_key}=tender_data
Leits authored
294 295
  ${tender}=  Call Method  ${USERS.users['${username}'].client}  get_tender  ${internalid}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
Krokop authored
296
  Set To Dictionary  ${USERS.users['${username}']}  ${save_key}=${tender}
297
  ${tender}=  munch_dict  arg=${tender}
Leits authored
298
  Log  ${tender}
299
  [return]   ${tender}
300
301
302 303 304
Пошук тендера по ідентифікатору
  [Arguments]  ${username}  ${tender_uaid}  ${save_key}=tender_data
  ${internalid}=  openprocurement_client.Отримати internal id по UAid  ${username}  ${tender_uaid}
smithumble authored
305 306
  ${tender}=  openprocurement_client.Отримати тендер по внутрішньому ідентифікатору  ${username}  ${internalid}  ${save_key}
  [return]  ${tender}
307 308

309 310 311 312 313 314 315 316 317 318
Пошук об'єкта моніторингу по ідентифікатору
  [Arguments]  ${username}  ${monitoring_uaid}  ${save_key}=monitoring_data
  ${internalid}=  openprocurement_client.Отримати internal id об'єкта моніторингу по UAid  ${username}  ${monitoring_uaid}
  ${monitoring}=  Call Method  ${USERS.users['${username}'].dasu_client}  get_monitoring  ${internalid}
  Set To Dictionary  ${USERS.users['${username}']}  ${save_key}=${monitoring}
  ${monitoring}=  munch_dict  arg=${monitoring}
  Log  ${monitoring}
  [return]   ${monitoring}

319 320 321 322 323 324 325 326 327 328
Пошук угоди по ідентифікатору
  [Arguments]  ${username}  ${agreement_uaid}  ${save_key}=agreement_data
  ${internalid}=  openprocurement_client.Отримати internal id угоди по UAid  ${username}  ${agreement_uaid}
  ${agreement}=  Call Method  ${USERS.users['${username}'].agreement_client}  get_agreement  ${internalid}
  Set To Dictionary  ${USERS.users['${username}']}  ${save_key}=${agreement}
  ${agreement}=  munch_dict  arg=${agreement}
  Log  ${agreement}
  [return]   ${agreement}

329
Отримати доступ до об'єкта моніторингу
330
  [Arguments]  ${username}  ${monitoring_uaid}  ${save_key}=monitoring
331 332
  ${token}=  Set Variable  ${USERS.users['${username}'].access_token}
  ${internalid}=  openprocurement_client.Отримати internal id об'єкта моніторингу по UAid  ${username}  ${monitoring_uaid}
333
  ${monitoring}=  Call Method  ${USERS.users['${username}'].dasu_client}  patch_credentials  ${internalid}  ${token}
334 335 336 337 338 339
  Set To Dictionary  ${USERS.users['${username}']}  ${save_key}=${monitoring}
  Log  ${USERS.users['${username}'].monitoring_data}
  ${monitoring}=  munch_dict  arg=${monitoring}
  [return]   ${monitoring}

340
Додати учасника процесу моніторингу
341 342 343 344 345 346 347 348 349 350 351 352
  [Arguments]  ${username}  ${monitoring_uaid}  ${party_data}
  ${monitoring}=  openprocurement_client.Пошук об'єкта моніторингу по ідентифікатору  ${username}  ${monitoring_uaid}
  Log  ${monitoring}
  ${party}=  Call Method  ${USERS.users['${username}'].dasu_client}  create_party  ${monitoring}  ${party_data}
  Log  ${party}
  ${monitoring}=  openprocurement_client.Пошук об'єкта моніторингу по ідентифікатору  ${username}  ${monitoring_uaid}
  Set To Dictionary  ${USERS.users['${username}']}   monitoring_data=${monitoring}
  Log  ${USERS.users['${username}'].monitoring_data}
  [return]  ${monitoring}


Запитати в замовника пояснення
353
  [Arguments]  ${username}  ${monitoring_uaid}  ${post_data}
354
  ${monitoring}=  openprocurement_client.Пошук об'єкта моніторингу по ідентифікатору  ${username}  ${monitoring_uaid}
355 356
  ${post}=  Call Method  ${USERS.users['${username}'].dasu_client}  create_post  ${monitoring}  ${post_data}
  Log  ${post}
357 358 359 360 361 362
  ${monitoring}=  openprocurement_client.Пошук об'єкта моніторингу по ідентифікатору  ${username}  ${monitoring_uaid}
  Set To Dictionary  ${USERS.users['${username}']}   monitoring_data=${monitoring}
  Log  ${USERS.users['${username}'].monitoring_data}
  [return]  ${monitoring}

363 364 365 366 367 368
Надати відповідь користувачем ДАСУ
  [Arguments]  ${username}  ${monitoring_uaid}  ${post_data}
  ${monitoring}=  openprocurement_client.Запитати в замовника пояснення  ${username}  ${monitoring_uaid}  ${post_data}
  [return]  ${monitoring}

369
Надати пояснення замовником
370
  [Arguments]  ${username}  ${monitoring_uaid}  ${post_data}
371 372
  Log  ${USERS.users['${username}'].access_token}
  ${monitoring}=  openprocurement_client.Отримати доступ до об'єкта моніторингу  ${username}  ${monitoring_uaid}
373 374 375
  ${post}=  Call Method  ${USERS.users['${username}'].dasu_client}  create_post  ${monitoring}  ${post_data}
  Log  ${post}
  [return]  ${post}
376 377 378 379


Змінити статус об’єкта моніторингу
  [Arguments]  ${username}  ${monitoring_uaid}  ${status_data}
ivanka12 authored
380 381
  ${monitoring_id}=  Set Variable  ${USERS.users['${username}'].monitoring_data.data.id}
  ${reply}=  Call Method  ${USERS.users['${username}'].dasu_client}  patch_monitoring  ${status_data}  ${monitoring_id}
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397
  Log  ${reply}
  Set To Dictionary  ${USERS.users['${username}']}  monitoring_data=${reply}
  [return]  ${reply}


Оприлюднити рішення про усунення порушення
  [Arguments]  ${username}  ${monitoring_uaid}  ${report_data}
  ${monitoring}=  openprocurement_client.Пошук об'єкта моніторингу по ідентифікатору  ${username}  ${monitoring_uaid}
  ${reply}=  Call Method  ${USERS.users['${username}'].dasu_client}  patch_monitoring  ${report_data}  ${monitoring.data.id}
  Log  ${reply}
  Set To Dictionary  ${USERS.users['${username}']}  monitoring_data=${reply}
  [return]  ${reply}


Надати звіт про усунення порушення замовником
  [Arguments]  ${username}  ${monitoring_uaid}  ${resolution_data}  ${file_path}
ivanka12 authored
398
  ${reply}=  Call Method  ${USERS.users['${username}'].dasu_client}  upload_obj_document  ${file_path}
399 400 401 402
  ${documents}=  Create List
  Append To List  ${documents}  ${reply.data}
  Set To Dictionary  ${resolution_data.data}  documents=${documents}
  Log  ${resolution_data}
403
  ${resolution}=  Call Method  ${USERS.users['${username}'].dasu_client}  patch_eliminationReport  ${USERS.users['${username}'].monitoring}  ${resolution_data}
404 405 406 407 408 409
  Log  ${resolution}
  [return]  ${resolution}


Зазначити, що порушення було оскаржено в суді
  [Arguments]  ${username}  ${monitoring_uaid}  ${appeal_data}  ${file_path}
ivanka12 authored
410
  ${reply}=  Call Method  ${USERS.users['${username}'].dasu_client}  upload_obj_document  ${filepath}
411 412 413 414
  ${documents}=  Create List
  Append To List  ${documents}  ${reply.data}
  Set To Dictionary  ${appeal_data.data}  documents=${documents}
  Log  ${appeal_data}
415
  ${appeal}=  Call Method  ${USERS.users['${username}'].dasu_client}  patch_appeal  ${USERS.users['${username}'].monitoring}  ${appeal_data}
416 417 418 419 420
  Log  ${appeal}
  [return]  ${appeal}


Надати пояснення замовником з власної ініціативи
421 422 423 424
  [Arguments]  ${username}  ${monitoring_uaid}  ${post_data}
  ${post}=  Call Method  ${USERS.users['${username}'].dasu_client}  create_post  ${USERS.users['${username}'].monitoring}  ${post_data}
  Log  ${post}
  [return]  ${post}
425 426 427 428 429 430 431 432 433 434 435


Надати висновок про наявність/відсутність порушення в тендері
  [Arguments]  ${username}  ${monitoring_uaid}  ${conclusion_data}
  ${monitoring}=  openprocurement_client.Пошук об'єкта моніторингу по ідентифікатору  ${username}  ${monitoring_uaid}
  ${reply}=  Call Method  ${USERS.users['${username}'].dasu_client}  patch_monitoring  ${conclusion_data}  ${monitoring.data.id}
  Log  ${reply}
  Set To Dictionary  ${USERS.users['${username}']}   monitoring_data=${reply}
  [return]  ${reply}

436 437
Отримати список планів
  [Arguments]  ${username}
AlexDiatlov authored
438
  @{plans_feed}=  get_plans_feed  ${USERS.users['${username}'].plan_client}
439
  [return]  @{plans_feed}
440 441 442 443


Отримати план по внутрішньому ідентифікатору
  [Arguments]  ${username}  ${internalid}  ${save_key}=tender_data
AlexDiatlov authored
444
  ${tender}=  Call Method  ${USERS.users['${username}'].plan_client}  get_plan  ${internalid}
445 446 447 448 449 450 451
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
  Set To Dictionary  ${USERS.users['${username}']}  ${save_key}=${tender}
  ${tender}=  munch_dict  arg=${tender}
  Log  ${tender}
  [return]   ${tender}

452 453 454
Пошук плану по ідентифікатору
  [Arguments]  ${username}  ${tender_uaid}  ${save_key}=tender_data
  ${internalid}=  openprocurement_client.Отримати internal id плану по UAid  ${username}  ${tender_uaid}
smithumble authored
455 456
  ${tender}=  openprocurement_client.Отримати план по внутрішньому ідентифікатору  ${username}  ${internalid}  ${save_key}
  [return]  ${tender}
457 458

Krokop authored
459
Отримати тендер другого етапу та зберегти його
460 461 462
  [Arguments]  ${username}  ${tender_uaid}
  ${internalid}=  openprocurement_client.Отримати internal id по UAid  ${username}  ${tender_uaid}
  ${response}=  Call Method  ${USERS.users['${username}'].client}  patch_credentials  ${internalid}  ${USERS.users['${username}'].access_token}
463 464
  ${tender}=  set_access_key  ${response}  ${response.access.token}
  Set To Dictionary  ${USERS.users['${username}']}   access_token=${response.access.token}
465
  Set To Dictionary  ${USERS.users['${username}']}  second_stage_data=${response}
466
  Log  ${tender.data.tenderID}
.  
Krokop authored
467
468
469
Оновити сторінку з тендером
470
  [Arguments]  ${username}  ${tender_uaid}
Leits authored
471
  openprocurement_client.Пошук тендера по ідентифікатору    ${username}  ${tender_uaid}
472
473
474 475 476 477 478
Оновити сторінку з планом
  [Arguments]  ${username}  ${tender_uaid}
  openprocurement_client.Пошук плану по ідентифікатору  ${username}  ${tender_uaid}

479 480 481 482 483
Оновити сторінку з об'єктом моніторингу
  [Arguments]  ${username}  ${monitoring_uaid}
  openprocurement_client.Пошук об'єкта моніторингу по ідентифікатору  ${username}  ${monitoring_uaid}

484
Отримати інформацію із тендера
485
  [Arguments]  ${username}  ${tender_uaid}  ${field_name}
486 487
  openprocurement_client.Пошук тендера по ідентифікатору
  ...      ${username}
488
  ...      ${tender_uaid}
489 490 491 492 493 494 495 496

  ${status}  ${field_value}=  Run keyword and ignore error
  ...      Get from object
  ...      ${USERS.users['${username}'].tender_data.data}
  ...      ${field_name}
  Run Keyword if  '${status}' == 'PASS'  Return from keyword   ${field_value}

  Fail  Field not found: ${field_name}
497
498
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
Отримати інформацію із плану
  [Arguments]  ${username}  ${tender_uaid}  ${field_name}
  openprocurement_client.Пошук плану по ідентифікатору
  ...      ${username}
  ...      ${tender_uaid}

  ${status}  ${field_value}=  Run keyword and ignore error
  ...      Get from object
  ...      ${USERS.users['${username}'].tender_data.data}
  ...      ${field_name}
  Run Keyword if  '${status}' == 'PASS'  Return from keyword   ${field_value}

  Fail  Field not found: ${field_name}

514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
Отримати інформацію із об'єкта моніторингу
  [Arguments]  ${username}  ${monitoring_uaid}  ${field_name}
  openprocurement_client.Пошук об'єкта моніторингу по ідентифікатору
  ...      ${username}
  ...      ${monitoring_uaid}

  ${status}  ${field_value}=  Run keyword and ignore error
  ...      Get from object
  ...      ${USERS.users['${username}'].monitoring_data.data}
  ...      ${field_name}
  Run Keyword if  '${status}' == 'PASS'  Return from keyword   ${field_value}

  Fail  Field not found: ${field_name}

529
Внести зміни в тендер
530 531
  [Arguments]  ${username}  ${tender_uaid}  ${fieldname}  ${fieldvalue}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
kvik authored
532
  ${prev_value}=  Отримати дані із тендера  ${username}  ${tender_uaid}  ${fieldname}
533
  Set_To_Object  ${tender.data}   ${fieldname}   ${fieldvalue}
Leits authored
534
  ${procurementMethodType}=  Get From Object  ${tender.data}  procurementMethodType
Leits authored
535
  Run Keyword If  '${procurementMethodType}' == 'aboveThresholdUA' or '${procurementMethodType}' == 'aboveThresholdEU'
Leits authored
536
  ...      Remove From Dictionary  ${tender.data}  enquiryPeriod
537
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
538 539 540 541
  ${tender}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
kvik authored
542
  Run Keyword And Expect Error  *  Порівняти об'єкти  ${prev_value}  ${tender.data.${fieldname}}
543
  Set_To_Object   ${USERS.users['${username}'].tender_data}   ${fieldname}   ${fieldvalue}
544
545 546 547 548 549 550

Внести зміни в план
  [Arguments]  ${username}  ${tender_uaid}  ${fieldname}  ${fieldvalue}
  ${tender}=  openprocurement_client.Пошук плану по ідентифікатору  ${username}  ${tender_uaid}
  Set_To_Object  ${tender.data}   ${fieldname}   ${fieldvalue}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
AlexDiatlov authored
551
  ${tender}=  Call Method  ${USERS.users['${username}'].plan_client}  patch_plan
552 553 554
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
555 556
  Set_To_Object   ${USERS.users['${username}'].tender_data}   ${fieldname}   ${fieldvalue}
Leits authored
557 558 559
##############################################################################
#             Item operations
##############################################################################
560
561 562
Додати предмет закупівлі
  [Arguments]  ${username}  ${tender_uaid}  ${item}
563
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
564
  Append To List  ${tender.data['items']}  ${item}
565 566 567 568
  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
569
570
571 572 573 574
Додати предмет закупівлі в план
  [Arguments]  ${username}  ${tender_uaid}  ${item}
  ${tender}=  openprocurement_client.Пошук плану по ідентифікатору  ${username}  ${tender_uaid}
  Append To List  ${tender.data['items']}  ${item}
AlexDiatlov authored
575
  Call Method  ${USERS.users['${username}'].plan_client}  patch_plan
576 577 578
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
579
AlexDiatlov authored
580
581
Отримати інформацію із предмету
582
  [Arguments]  ${username}  ${tender_uaid}  ${item_id}  ${field_name}
583
  ${field_name}=  Отримати шлях до поля об’єкта  ${username}  ${field_name}  ${item_id}
584
  Run Keyword And Return  openprocurement_client.Отримати інформацію із тендера  ${username}  ${tender_uaid}  ${field_name}
585 586

587
Видалити предмет закупівлі
588
  [Arguments]  ${username}  ${tender_uaid}  ${item_id}  ${lot_id}=${Empty}
589
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
590 591
  ${item_index}=  get_object_index_by_id  ${tender.data['items']}  ${item_id}
  Remove From List  ${tender.data['items']}  ${item_index}
592 593 594 595
  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
596
kvik authored
597
598 599 600 601 602
Видалити предмет закупівлі плану
  [Arguments]  ${username}  ${tender_uaid}  ${item_id}  ${lot_id}=${Empty}
  ${tender}=  openprocurement_client.Пошук плану по ідентифікатору  ${username}  ${tender_uaid}
  ${item_index}=  get_object_index_by_id  ${tender.data['items']}  ${item_id}
  Remove From List  ${tender.data['items']}  ${item_index}
AlexDiatlov authored
603
  Call Method  ${USERS.users['${username}'].plan_client}  patch_plan
604 605 606
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
kvik authored
607 608

Видалити поле з донора
kvik authored
609
  [Arguments]  ${username}  ${tender_uaid}  ${funders_index}  ${field_name}
kvik authored
610
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
kvik authored
611
  Delete From Dictionary  ${tender.data['funders'][${funders_index}]}  ${field_name}
kvik authored
612
  Log  ${tender.data['funders'][${funders_index}]}
613 614 615 616
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
kvik authored
617
  Dictionary Should Not Contain Path  ${reply.data['funders'][${funders_index}]}  ${field_name}
kvik authored
618 619 620 621 622 623 624


Видалити донора
  [Arguments]  ${username}  ${tender_uaid}  ${funders_index}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  Remove From List  ${tender.data.funders}  ${funders_index}
  Log  ${tender}
625 626 627 628
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
kvik authored
629 630 631 632 633 634 635 636 637
  Log  ${reply}


Додати донора
  [Arguments]  ${username}  ${tender_uaid}  ${funders_data}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  Set To Dictionary  ${tender.data}  funders=@{EMPTY}
  Append To List  ${tender.data.funders}  ${funders_data}
  Log  ${tender}
638 639 640 641
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
kvik authored
642
643 644 645
##############################################################################
#             Lot operations
##############################################################################
Leits authored
646 647

Створити лот
Leits authored
648 649
  [Arguments]  ${username}  ${tender_uaid}  ${lot}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
650 651 652 653
  ${reply}=  Call Method  ${USERS.users['${username}'].client}   create_lot
  ...      ${tender.data.id}
  ...      ${lot}
  ...      access_token=${tender.access.token}
654
  #return here is needed to have created lot id in `Створити лот з предметом закупівлі` keyword
Leits authored
655 656 657
  [return]  ${reply}

658 659 660 661 662 663 664
Створити лот із предметом закупівлі
  [Arguments]  ${username}  ${tender_uaid}  ${lot}  ${item}
  ${reply}=  openprocurement_client.Створити лот  ${username}  ${tender_uaid}  ${lot}
  ${lot_id}=  get_id_from_object  ${lot.data}
  openprocurement_client.Додати предмет закупівлі в лот  ${username}  ${tender_uaid}  ${lot_id}  ${item}

Leits authored
665
Отримати інформацію із лоту
666
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}  ${field_name}
Leits authored
667
  ${field_name}=  Отримати шлях до поля об’єкта  ${username}  ${field_name}  ${lot_id}
668
  Run Keyword And Return  openprocurement_client.Отримати інформацію із тендера  ${username}  ${tender_uaid}  ${field_name}
Leits authored
669
670
Leits authored
671
Змінити лот
Leits authored
672 673 674 675 676
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}   ${fieldname}  ${fieldvalue}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${lot_index}=  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
  ${lot}=  Create Dictionary  data=${tender.data.lots[${lot_index}]}
  Set_To_Object   ${lot.data}   ${fieldname}   ${fieldvalue}
677 678 679 680 681
  ${reply}=  Call Method   ${USERS.users['${username}'].client}  patch_lot
  ...      ${tender.data.id}
  ...      ${lot}
  ...      ${lot.data.id}
  ...      access_token=${tender.access.token}
Leits authored
682 683 684 685 686 687 688 689 690


Додати предмет закупівлі в лот
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}  ${item}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${lot_index}=  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
  ${lot_id}=  Get Variable Value  ${tender.data.lots[${lot_index}].id}
  Set_To_Object   ${item}   relatedLot   ${lot_id}
  Append To List   ${tender.data['items']}   ${item}
691 692 693 694
  Call Method   ${USERS.users['${username}'].client}   patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
Leits authored
695 696

Leits authored
697
Завантажити документ в лот
698 699
  [Arguments]  ${username}  ${filepath}  ${tender_uaid}  ${lot_id}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
Leits authored
700 701
  ${lot_index}=  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
  ${lot_id}=  Get Variable Value  ${tender.data.lots[${lot_index}].id}
702
  ${doc}=  openprocurement_client.Завантажити документ  ${username}  ${filepath}  ${tender_uaid}
703
  ${lot_doc}=  test_lot_document_data  ${doc}  ${lot_id}
704 705 706 707 708
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_document
  ...      ${tender.data.id}
  ...      ${lot_doc}
  ...      ${lot_doc.data.id}
  ...      access_token=${tender.access.token}
Leits authored
709
710
Leits authored
711
Видалити лот
Leits authored
712 713 714 715
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${lot_index}=  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
  ${lot}=  Create Dictionary  data=${tender.data.lots[${lot_index}]}
716 717 718 719
  :FOR  ${item}  IN  @{tender.data['items']}
  \  ${item_id}=  get_id_from_object  ${item}
  \  Run Keyword If  '${item.relatedLot}'=='${lot.data.id}'
  \  ...     openprocurement_client.Видалити предмет закупівлі  ${username}  ${tender_uaid}  ${item_id}
Leits authored
720 721 722
  ${reply}=  Call Method  ${USERS.users['${username}'].client}   delete_lot   ${tender}    ${lot}

Leits authored
723 724 725
Скасувати лот
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}  ${cancellation_reason}  ${document}  ${new_description}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
ivanka12 authored
726
  ${lot_index}=  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
Leits authored
727
  ${lot_id}=  Get Variable Value  ${tender.data.lots[${lot_index}].id}
728 729 730 731
  ${data}=  Create dictionary
  ...      reason=${cancellation_reason}
  ...      cancellationOf=lot
  ...      relatedLot=${lot_id}
Leits authored
732 733 734 735 736 737 738 739 740 741 742 743
  ${cancellation_data}=  Create dictionary  data=${data}
  ${cancellation_data}=  munch_dict  arg=${cancellation_data}
  ${cancel_reply}=  Call Method  ${USERS.users['${username}'].client}  create_cancellation  ${tender}  ${cancellation_data}
  ${cancellation_id}=  Set variable  ${cancel_reply.data.id}

  ${document_id}=  openprocurement_client.Завантажити документацію до запиту на скасування  ${username}  ${tender_uaid}  ${cancellation_id}  ${document}

  openprocurement_client.Змінити опис документа в скасуванні  ${username}  ${tender_uaid}  ${cancellation_id}  ${document_id}  ${new_description}

  openprocurement_client.Підтвердити скасування закупівлі  ${username}  ${tender_uaid}  ${cancellation_id}

744 745 746 747 748 749 750 751 752
Отримати інформацію з документа до лоту
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}  ${doc_id}  ${field}
  openprocurement_client.Отримати інформацію з документа  ${username}  ${tender_uaid}  ${doc_id}  ${field}


Отримати документ до лоту
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}  ${doc_id}
  Run Keyword And Return  openprocurement_client.Отримати документ  ${username}  ${tender_uaid}  ${doc_id}
Leits authored
753
##############################################################################
754 755 756 757 758 759 760
#             Feature operations
##############################################################################

Додати неціновий показник на тендер
  [Arguments]  ${username}  ${tender_uaid}  ${feature}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  Append To List  ${tender.data['features']}  ${feature}
761 762 763 764
  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
765 766 767 768 769 770 771 772 773


Додати неціновий показник на предмет
  [Arguments]  ${username}  ${tender_uaid}  ${feature}  ${item_id}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${item_index}=  get_object_index_by_id  ${tender.data['items']}  ${item_id}
  ${item_id}=  Get Variable Value  ${tender.data['items'][${item_index}].id}
  Set To Dictionary  ${feature}  relatedItem=${item_id}
  Append To List  ${tender.data['features']}  ${feature}
774 775 776 777
  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
778 779 780 781 782 783 784 785 786


Додати неціновий показник на лот
  [Arguments]  ${username}  ${tender_uaid}  ${feature}  ${lot_id}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${lot_index}=  get_object_index_by_id  ${tender.data['lots']}  ${lot_id}
  ${lot_id}=  Get Variable Value  ${tender.data['lots'][${lot_index}].id}
  Set To Dictionary  ${feature}  relatedItem=${lot_id}
  Append To List  ${tender.data['features']}  ${feature}
787 788 789 790
  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
791 792 793


Отримати інформацію із нецінового показника
794
  [Arguments]  ${username}  ${tender_uaid}  ${feature_id}  ${field_name}
795
  ${field_name}=  Отримати шлях до поля об’єкта  ${username}  ${field_name}  ${feature_id}
796
  Run Keyword And Return  openprocurement_client.Отримати інформацію із тендера  ${username}  ${tender_uaid}  ${field_name}
797 798 799


Видалити неціновий показник
800
  [Arguments]  ${username}  ${tender_uaid}  ${feature_id}
801 802 803
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${feature_index}=  get_object_index_by_id  ${tender.data['features']}  ${feature_id}
  Remove From List  ${tender.data['features']}  ${feature_index}
804 805 806 807
  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
808 809 810


##############################################################################
Leits authored
811 812 813 814 815 816 817 818 819
#             Questions
##############################################################################

Задати запитання на предмет
  [Arguments]  ${username}  ${tender_uaid}  ${item_id}  ${question}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${item_index}=  get_object_index_by_id  ${tender.data['items']}  ${item_id}
  ${item_id}=  Get Variable Value  ${tender.data['items'][${item_index}].id}
  ${question}=  test_related_question  ${question}  item  ${item_id}
820 821 822 823
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  create_question
  ...      ${tender.data.id}
  ...      ${question}
  ...      access_token=${tender.access.token}
Leits authored
824 825 826 827 828 829 830 831


Задати запитання на лот
  [Arguments]  ${username}  ${tender_uaid}  ${lot_id}  ${question}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${lot_index}=  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
  ${lot_id}=  Get Variable Value  ${tender.data.lots[${lot_index}].id}
  ${question}=  test_related_question  ${question}  lot  ${lot_id}
832 833 834 835
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  create_question
  ...      ${tender.data.id}
  ...      ${question}
  ...      access_token=${tender.access.token}
Leits authored
836 837 838 839 840


Задати запитання на тендер
  [Arguments]  ${username}  ${tender_uaid}  ${question}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
841 842 843 844
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  create_question
  ...      ${tender.data.id}
  ...      ${question}
  ...      access_token=${tender.access.token}
Leits authored
845 846 847


Отримати інформацію із запитання
848
  [Arguments]  ${username}  ${tender_uaid}  ${question_id}  ${field_name}
Leits authored
849
  ${field_name}=  Отримати шлях до поля об’єкта  ${username}  ${field_name}  ${question_id}
850
  Run Keyword And Return  openprocurement_client.Отримати інформацію із тендера  ${username}  ${tender_uaid}  ${field_name}
Leits authored
851 852 853 854


Відповісти на запитання
  [Arguments]  ${username}  ${tender_uaid}  ${answer_data}  ${question_id}
Leits authored
855
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
Leits authored
856
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
857
  ${answer_data.data.id}=  openprocurement_client.Отримати інформацію із запитання  ${username}  ${tender_uaid}  ${question_id}  id
858 859 860 861 862
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_question
  ...      ${tender.data.id}
  ...      ${answer_data}
  ...      ${answer_data.data.id}
  ...      access_token=${tender.access.token}
863
864
##############################################################################
865
#             Claims
866
##############################################################################
mykhaly authored
867
868 869 870 871 872
Отримати internal id по UAid для скарги
  [Arguments]  ${tender}  ${complaintID}
  ${complaint_internal_id}=  get_complaint_internal_id  ${tender}  ${complaintID}
  [Return]  ${complaint_internal_id}
mykhaly authored
873
#Ключові слова типу `* про виправлення умов закупівлі` додані для сумісності з майданчиками
874
mykhaly authored
875
Створити чернетку вимоги про виправлення умов закупівлі
876 877 878 879 880 881 882 883 884
  [Documentation]  Створює вимогу у статусі "draft"
  [Arguments]  ${username}  ${tender_uaid}  ${claim}
  Log  ${claim}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору
  ...      ${username}
  ...      ${tender_uaid}
  ${reply}=  Call Method
  ...      ${USERS.users['${username}'].client}
  ...      create_complaint
885
  ...      ${tender.data.id}
886
  ...      ${claim}
887
  ...      access_token=${tender.access.token}
888
  Log  ${reply}
889 890
  Set To Dictionary  ${USERS.users['${username}']}  complaint_access_token=${reply.access.token}
  [return]  ${reply.data.complaintID}
891 892

893 894 895 896 897 898 899 900 901 902 903 904 905 906 907
Створити чернетку вимоги про виправлення умов лоту
  [Documentation]  Створює вимогу у статусі "draft"
  [Arguments]  ${username}  ${tender_uaid}  ${claim}  ${lot_id}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору
  ...      ${username}
  ...      ${tender_uaid}
  ${lot_index}=  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
  Set to dictionary  ${claim.data}  relatedLot=${tender.data.lots[${lot_index}].id}
  ${complaintID}=  openprocurement_client.Створити чернетку вимоги про виправлення умов закупівлі
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${claim}
  [return]  ${complaintID}

mykhaly authored
908 909 910 911 912 913 914 915 916 917 918
Створити чернетку вимоги про виправлення визначення переможця
  [Documentation]  Створює вимогу у статусі "draft"
  [Arguments]  ${username}  ${tender_uaid}  ${claim}  ${award_index}
  Log  ${claim}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору
  ...      ${username}
  ...      ${tender_uaid}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
  ${reply}=  Call Method
  ...      ${USERS.users['${username}'].client}
  ...      create_award_complaint
919
  ...      ${tender.data.id}
mykhaly authored
920 921
  ...      ${claim}
  ...      ${tender.data.awards[${award_index}].id}
922
  ...      access_token=${tender.access.token}
mykhaly authored
923 924 925 926 927 928
  Log  ${reply}
  Set To Dictionary  ${USERS.users['${username}']}  complaint_access_token=${reply.access.token}
  Log  ${USERS.users['${username}'].complaint_access_token}
  [return]  ${reply.data.complaintID}

mykhaly authored
929
Створити вимогу про виправлення умов закупівлі
mykhaly authored
930 931 932
  [Documentation]  Створює вимогу у статусі "claim"
  ...      Можна створити вимогу як з документацією, так і без неї
  [Arguments]  ${username}  ${tender_uaid}  ${claim}  ${document}=${None}
933
934
  ${complaintID}=  openprocurement_client.Створити чернетку вимоги про виправлення умов закупівлі
mykhaly authored
935 936 937
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${claim}
938 939 940

  ${status}=  Run keyword and return status  Should not be equal  ${document}  ${None}
  Log  ${status}
941
  Run keyword if  ${status} == ${True}  openprocurement_client.Завантажити документацію до вимоги
942 943 944
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
mykhaly authored
945
  ...      ${document}
946 947 948

  ${data}=  Create Dictionary  status=claim
  ${confirmation_data}=  Create Dictionary  data=${data}
949
  openprocurement_client.Подати вимогу
950 951 952 953
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
  ...      ${confirmation_data}
mykhaly authored
954 955 956 957 958 959 960
  [return]  ${complaintID}


Створити вимогу про виправлення умов лоту
  [Documentation]  Створює вимогу у статусі "claim"
  ...      Можна створити вимогу як з документацією, так і без неї
  ...      Якщо lot_index == None, то створюється вимога про виправлення умов тендера.
961
  [Arguments]  ${username}  ${tender_uaid}  ${claim}  ${lot_id}  ${document}=${None}
962
  ${complaintID}=  openprocurement_client.Створити чернетку вимоги про виправлення умов лоту
mykhaly authored
963 964 965
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${claim}
966
  ...      ${lot_id}
mykhaly authored
967 968 969

  ${status}=  Run keyword and return status  Should not be equal  ${document}  ${None}
  Log  ${status}
970
  Run keyword if  ${status} == ${True}  openprocurement_client.Завантажити документацію до вимоги
mykhaly authored
971 972 973 974 975 976 977
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
  ...      ${document}

  ${data}=  Create Dictionary  status=claim
  ${confirmation_data}=  Create Dictionary  data=${data}
978
  openprocurement_client.Подати вимогу
mykhaly authored
979 980 981 982 983 984 985 986
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
  ...      ${confirmation_data}

  [return]  ${complaintID}

mykhaly authored
987 988 989 990
Створити вимогу про виправлення визначення переможця
  [Documentation]  Створює вимогу у статусі "claim"
  ...      Можна створити вимогу як з документацією, так і без неї
  [Arguments]  ${username}  ${tender_uaid}  ${claim}  ${award_index}  ${document}=${None}
991
  ${complaintID}=  openprocurement_client.Створити чернетку вимоги про виправлення визначення переможця
mykhaly authored
992 993 994 995 996 997 998
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${claim}
  ...      ${award_index}

  ${status}=  Run keyword and return status  Should not be equal  ${document}  ${None}
  Log  ${status}
999
  Run keyword if  ${status} == ${True}  openprocurement_client.Завантажити документацію до вимоги про виправлення визначення переможця
mykhaly authored
1000 1001 1002 1003 1004 1005
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
  ...      ${award_index}
  ...      ${document}
ivanka12 authored
1006
  ${status}=  Set variable  claim
1007
  ${data}=  Create Dictionary  status=${status}
mykhaly authored
1008
  ${confirmation_data}=  Create Dictionary  data=${data}
1009
  openprocurement_client.Подати вимогу про виправлення визначення переможця
mykhaly authored
1010 1011 1012 1013 1014 1015 1016 1017 1018
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
  ...      ${award_index}
  ...      ${confirmation_data}

  [return]  ${complaintID}

1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050
Створити скаргу про виправлення визначення переможця
  [Documentation]  Створює скаргу у статусі "pending"
  ...      Можна створити скаргу як з документацією, так і без неї
  [Arguments]  ${username}  ${tender_uaid}  ${claim}  ${award_index}  ${document}=${None}
  ${complaintID}=  openprocurement_client.Створити чернетку вимоги про виправлення визначення переможця
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${claim}
  ...      ${award_index}

  ${status}=  Run keyword and return status  Should not be equal  ${document}  ${None}
  Log  ${status}
  Run keyword if  ${status} == ${True}  openprocurement_client.Завантажити документацію до вимоги про виправлення визначення переможця
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
  ...      ${award_index}
  ...      ${document}

  ${status}=  Set variable  pending
  ${data}=  Create Dictionary  status=${status}
  ${confirmation_data}=  Create Dictionary  data=${data}
  openprocurement_client.Подати вимогу про виправлення визначення переможця
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
  ...      ${award_index}
  ...      ${confirmation_data}

  [return]  ${complaintID}

1051
Завантажити документацію до вимоги
1052
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${document}
1053
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1054
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1055
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
1056 1057 1058 1059 1060
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  upload_complaint_document
  ...      ${document}
  ...      ${tender.data.id}
  ...      ${complaint_internal_id}
  ...      access_token=${USERS.users['${username}'].complaint_access_token}
1061 1062 1063 1064
  Log  ${tender}
  Log  ${reply}

mykhaly authored
1065 1066 1067 1068 1069 1070 1071
Завантажити документацію до вимоги про виправлення визначення переможця
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${award_index}  ${document}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору
  ...      ${username}
  ...      ${tender_uaid}
  Log  ${USERS.users['${username}'].complaint_access_token}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1072
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
1073 1074 1075 1076 1077 1078
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  upload_award_complaint_document
  ...      ${document}
  ...      ${tender.data.id}
  ...      ${tender.data.awards[${award_index}].id}
  ...      ${complaint_internal_id}
  ...      access_token=${USERS.users['${username}'].complaint_access_token}
mykhaly authored
1079 1080 1081 1082
  Log  ${tender}
  Log  ${reply}

1083 1084
Подати вимогу
  [Documentation]  Переводить вимогу зі статусу "draft" у статус "claim"
1085
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${confirmation_data}
1086
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1087
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1088
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
1089
  Set To Dictionary  ${confirmation_data.data}  id=${complaint_internal_id}
1090 1091 1092 1093 1094
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_complaint
  ...      ${tender.data.id}
  ...      ${confirmation_data}
  ...      ${complaint_internal_id}
  ...      access_token=${USERS.users['${username}'].complaint_access_token}
1095 1096 1097 1098
  Log  ${tender}
  Log  ${reply}

mykhaly authored
1099 1100 1101 1102 1103 1104 1105
Подати вимогу про виправлення визначення переможця
  [Documentation]  Переводить вимогу зі статусу "draft" у статус "claim"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${award_index}  ${confirmation_data}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору
  ...      ${username}
  ...      ${tender_uaid}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1106
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
mykhaly authored
1107
  Set To Dictionary  ${confirmation_data.data}  id=${complaint_internal_id}
1108 1109 1110 1111 1112 1113
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award_complaint
  ...      ${tender.data.id}
  ...      ${confirmation_data}
  ...      ${tender.data.awards[${award_index}].id}
  ...      ${complaint_internal_id}
  ...      access_token=${tender.access.token}
mykhaly authored
1114 1115 1116 1117
  Log  ${tender}
  Log  ${reply}

mykhaly authored
1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
Відповісти на вимогу про виправлення умов закупівлі
  [Documentation]  Переводить вимогу зі статусу "claim" у статус "answered"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${answer_data}
  openprocurement_client.Відповісти на вимогу про виправлення умов лоту
  ...      ${username}
  ...      ${tender_uaid}
  ...      ${complaintID}
  ...      ${answer_data}


Відповісти на вимогу про виправлення умов лоту
1129
  [Documentation]  Переводить вимогу зі статусу "claim" у статус "answered"
1130
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${answer_data}
1131
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1132
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
1133
  Set To Dictionary  ${answer_data.data}  id=${complaint_internal_id}
1134 1135 1136 1137 1138
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_complaint
  ...      ${tender.data.id}
  ...      ${answer_data}
  ...      ${complaint_internal_id}
  ...      access_token=${tender.access.token}
1139
  log  ${tender}
1140 1141 1142
  Log  ${reply}

mykhaly authored
1143 1144 1145 1146
Відповісти на вимогу про виправлення визначення переможця
  [Documentation]  Переводить вимогу зі статусу "claim" у статус "answered"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${answer_data}  ${award_index}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1147
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
mykhaly authored
1148
  Set To Dictionary  ${answer_data.data}  id=${complaint_internal_id}
1149 1150 1151 1152 1153 1154
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award_complaint
  ...      ${tender.data.id}
  ...      ${answer_data}
  ...      ${tender.data.awards[${award_index}].id}
  ...      ${complaint_internal_id}
  ...      access_token=${tender.access.token}
mykhaly authored
1155 1156 1157 1158
  log  ${tender}
  Log  ${reply}

mykhaly authored
1159 1160 1161 1162 1163 1164 1165
Підтвердити вирішення вимоги про виправлення умов закупівлі
  [Documentation]  Переводить вимогу зі статусу "answered" у статус "resolved"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${confirmation_data}
  openprocurement_client.Підтвердити вирішення вимоги про виправлення умов лоту  ${username}  ${tender_uaid}  ${complaintID}  ${confirmation_data}


Підтвердити вирішення вимоги про виправлення умов лоту
1166
  [Documentation]  Переводить вимогу зі статусу "answered" у статус "resolved"
1167
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${confirmation_data}
1168
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1169
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1170
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
1171
  Set To Dictionary  ${confirmation_data.data}  id=${complaint_internal_id}
1172 1173 1174 1175 1176
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_complaint
  ...      ${tender.data.id}
  ...      ${confirmation_data}
  ...      ${complaint_internal_id}
  ...      access_token=${tender.access.token}
1177 1178 1179
  Log  ${reply}

mykhaly authored
1180 1181 1182 1183 1184
Підтвердити вирішення вимоги про виправлення визначення переможця
  [Documentation]  Переводить вимогу зі статусу "answered" у статус "resolved"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${confirmation_data}  ${award_index}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1185
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
mykhaly authored
1186
  Set To Dictionary  ${confirmation_data.data}  id=${complaint_internal_id}
1187 1188 1189 1190 1191 1192
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award_complaint
  ...      ${tender.data.id}
  ...      ${confirmation_data}
  ...      ${tender.data.awards[${award_index}].id}
  ...      ${complaint_internal_id}
  ...      access_token=${USERS.users['${username}'].complaint_access_token}
mykhaly authored
1193 1194 1195
  Log  ${reply}

mykhaly authored
1196 1197 1198 1199 1200 1201 1202
Скасувати вимогу про виправлення умов закупівлі
  [Documentation]  Переводить вимогу в статус "canceled"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${cancellation_data}
  openprocurement_client.Скасувати вимогу про виправлення умов лоту  ${username}  ${tender_uaid}  ${complaintID}  ${cancellation_data}


Скасувати вимогу про виправлення умов лоту
1203
  [Documentation]  Переводить вимогу в статус "canceled"
1204
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${cancellation_data}
1205
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1206
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1207
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
1208
  Set To Dictionary  ${cancellation_data.data}  id=${complaint_internal_id}
1209 1210 1211 1212 1213
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_complaint
  ...      ${tender.data.id}
  ...      ${cancellation_data}
  ...      ${complaint_internal_id}
  ...      access_token=${USERS.users['${username}'].complaint_access_token}
1214 1215 1216
  Log  ${reply}

mykhaly authored
1217 1218 1219 1220 1221
Скасувати вимогу про виправлення визначення переможця
  [Documentation]  Переводить вимогу в статус "canceled"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${cancellation_data}  ${award_index}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1222
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
mykhaly authored
1223
  Set To Dictionary  ${cancellation_data.data}  id=${complaint_internal_id}
1224 1225 1226 1227 1228 1229
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award_complaint
  ...      ${tender.data.id}
  ...      ${cancellation_data}
  ...      ${tender.data.awards[${award_index}].id}
  ...      ${complaint_internal_id}
  ...      access_token=${USERS.users['${username}'].complaint_access_token}
mykhaly authored
1230 1231 1232
  Log  ${reply}

mykhaly authored
1233 1234 1235 1236 1237 1238 1239
Перетворити вимогу про виправлення умов закупівлі в скаргу
  [Documentation]  Переводить вимогу у статус "pending"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${escalating_data}
  openprocurement_client.Перетворити вимогу про виправлення умов лоту в скаргу  ${username}  ${tender_uaid}  ${complaintID}  ${escalating_data}


Перетворити вимогу про виправлення умов лоту в скаргу
mykhaly authored
1240
  [Documentation]  Переводить вимогу у статус "pending"
1241
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${escalating_data}
1242
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1243
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1244
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
1245
  Set To Dictionary  ${escalating_data.data}  id=${complaint_internal_id}
1246 1247 1248 1249 1250
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_complaint
  ...      ${tender.data.id}
  ...      ${escalating_data}
  ...      ${complaint_internal_id}
  ...      access_token=${USERS.users['${username}'].complaint_access_token}
1251 1252
  Log  ${reply}
mykhaly authored
1253 1254 1255 1256 1257 1258

Перетворити вимогу про виправлення визначення переможця в скаргу
  [Documentation]  Переводить вимогу у статус "pending"
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${escalating_data}  ${award_index}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].complaint_access_token}
1259
  ${complaint_internal_id}=  openprocurement_client.Отримати internal id по UAid для скарги  ${tender}  ${complaintID}
mykhaly authored
1260
  Set To Dictionary  ${escalating_data.data}  id=${complaint_internal_id}
1261 1262 1263 1264 1265 1266
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award_complaint
  ...      ${tender.data.id}
  ...      ${escalating_data}
  ...      ${tender.data.awards[${award_index}].id}
  ...      ${complaint_internal_id}
  ...      access_token=${USERS.users['${username}'].complaint_access_token}
mykhaly authored
1267 1268
  Log  ${reply}
1269
1270 1271 1272 1273
Отримати інформацію із скарги
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${field_name}  ${award_index}=${None}
  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${complaints}=  Get Variable Value  ${USERS.users['${username}'].tender_data.data.awards[${award_index}].complaints}  ${USERS.users['${username}'].tender_data.data.complaints}
1274
  ${complaint_index}=  get_complaint_index_by_complaintID  ${complaints}  ${complaintID}
1275
  ${field_value}=  Get Variable Value  ${complaints[${complaint_index}]['${field_name}']}
1276 1277 1278
  [Return]  ${field_value}

1279
Отримати інформацію із документа до скарги
mykhaly authored
1280
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${doc_id}  ${field_name}  ${award_id}=${None}
1281 1282 1283 1284
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  Log  ${document}
  [Return]  ${document['${field_name}']}
1285
1286 1287

Отримати документ до скарги
1288
  [Arguments]  ${username}  ${tender_uaid}  ${complaintID}  ${doc_id}  ${award_id}=${None}
1289 1290 1291 1292
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  ${filename}=  download_file_from_url  ${document.url}  ${OUTPUT_DIR}${/}${document.title}
  [return]  ${filename}
1293
1294
##############################################################################
Leits authored
1295 1296 1297
#             Bid operations
##############################################################################
1298
Перевірити учасника за ЄДРПОУ
1299 1300 1301 1302 1303
  [Arguments]  ${username}  ${edrpou}
  ${reply}=  Call Method  ${USERS.users['${username}'].edr_client}  verify_member  ${edrpou}
  Log  ${reply}

Leits authored
1304
Подати цінову пропозицію
1305
  [Arguments]  ${username}  ${tender_uaid}  ${bid}  ${lots_ids}=${None}  ${features_ids}=${None}
1306
  ${verify_response}=  Run As  ${username}  Перевірити учасника за ЄДРПОУ  ${bid.data.tenderers[0].identifier.id}
1307
  Log  ${verify_response}
Leits authored
1308
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1309 1310
  ${lots_ids}=  Run Keyword IF  ${lots_ids}  Set Variable  ${lots_ids}
  ...     ELSE  Create List
1311 1312 1313 1314
  : FOR    ${index}    ${lot_id}    IN ENUMERATE    @{lots_ids}
  \    ${lot_index}=  get_object_index_by_id  ${tender.data.lots}  ${lot_id}
  \    ${lot_id}=  Get Variable Value  ${tender.data.lots[${lot_index}].id}
  \    Set To Dictionary  ${bid.data.lotValues[${index}]}  relatedLot=${lot_id}
1315 1316
  ${features_ids}=  Run Keyword IF  ${features_ids}  Set Variable  ${features_ids}
  ...     ELSE  Create List
1317 1318 1319 1320
  : FOR    ${index}    ${feature_id}    IN ENUMERATE    @{features_ids}
  \    ${feature_index}=  get_object_index_by_id  ${tender.data.features}  ${feature_id}
  \    ${code}=  Get Variable Value  ${tender.data.features[${feature_index}].code}
  \    Set To Dictionary  ${bid.data.parameters[${index}]}  code=${code}
1321
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  create_bid  ${tender.data.id}  ${bid}
1322
  Log  ${reply}
OrysiaDrabych authored
1323 1324 1325
  Set To Dictionary  ${USERS.users['${username}']}  bid_access_token=${reply.access.token}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].bid_access_token}
  ${procurementMethodType}=  Get variable value  ${USERS.users['${username}'].tender_data.data.procurementMethodType}
ivanka12 authored
1326
  ${methods}=  Create List  competitiveDialogueUA  competitiveDialogueEU  competitiveDialogueEU.stage2  aboveThresholdEU  closeFrameworkAgreementUA  esco
1327
  ${status}=  Set Variable If  '${procurementMethodType}' in ${methods}  pending  active
1328
  Set To Dictionary  ${reply['data']}  status=${status}
1329 1330 1331 1332 1333
  ${reply_active}=  Call Method  ${USERS.users['${username}'].client}  patch_bid
  ...     ${tender.data.id}
  ...     ${reply}
  ...     ${reply.data.id}
  ...     access_token=${tender.access.token}
1334
  Set To Dictionary  ${USERS.users['${username}']}  access_token=${reply['access']['token']}
Leits authored
1335
  Set To Dictionary   ${USERS.users['${username}'].bidresponses['bid'].data}  id=${reply['data']['id']}
1336
  Log  ${reply_active}
1337 1338
  Set To Dictionary  ${USERS.users['${username}']}  bid_id=${reply['data']['id']}
  Log  ${reply}
Leits authored
1339 1340 1341 1342 1343 1344 1345


Змінити цінову пропозицію
  [Arguments]  ${username}  ${tender_uaid}  ${fieldname}  ${fieldvalue}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${bid}=  openprocurement_client.Отримати пропозицію  ${username}  ${tender_uaid}
  Set_To_Object  ${bid.data}   ${fieldname}   ${fieldvalue}
mykhaly authored
1346
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}']['access_token']}
1347 1348 1349 1350 1351
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_bid
  ...     ${tender.data.id}
  ...     ${bid}
  ...     ${bid.data.id}
  ...     access_token=${tender.access.token}
Leits authored
1352 1353 1354 1355 1356 1357
  Log  ${reply}


Скасувати цінову пропозицію
  [Arguments]  ${username}  ${tender_uaid}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1358
  ${bid_id}=  openprocurement_client.Отримати інформацію із пропозиції  ${username}  ${tender_uaid}  id
1359 1360 1361 1362
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  delete_bid
  ...     ${tender.data.id}
  ...     ${bid_id}
  ...     access_token=${USERS.users['${username}']['access_token']}
Leits authored
1363 1364
  Log  ${reply}
mykhaly authored
1365
Leits authored
1366
Завантажити документ в ставку
1367
  [Arguments]  ${username}  ${path}  ${tender_uaid}  ${doc_name}=documents  ${doc_type}=${None}
mykhaly authored
1368
  ${bid_id}=  Get Variable Value   ${USERS.users['${username}'].bidresponses['bid'].data.id}
Leits authored
1369
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
mykhaly authored
1370
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}']['access_token']}
1371 1372 1373 1374
  ${response}=  Call Method  ${USERS.users['${username}'].client}  upload_bid_document
  ...      ${path}
  ...      ${tender.data.id}
  ...      ${bid_id}
1375
  ...      doc_type=${doc_type}
1376
  ...      access_token=${tender.access.token}
1377
  ...      subitem_name=${doc_name}
1378 1379 1380
  ${uploaded_file} =  Create Dictionary
  ...      filepath=${path}
  ...      upload_response=${response}
Leits authored
1381 1382 1383 1384 1385
  Log object data   ${uploaded_file}
  [return]  ${uploaded_file}


Змінити документ в ставці
1386
  [Arguments]  ${username}  ${tender_uaid}  ${path}  ${doc_id}  ${doc_type}=documents
mykhaly authored
1387
  ${bid_id}=  Get Variable Value   ${USERS.users['${username}'].bidresponses['bid'].data.id}
1388
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
mykhaly authored
1389
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}']['access_token']}
1390 1391
  ${bid}=  openprocurement_client.Отримати пропозицію  ${username}  ${tender_uaid}
  ${bid_doc}=  get_document_by_id  ${bid.data}  ${doc_id}
1392 1393 1394 1395 1396 1397
  ${response}=  Call Method  ${USERS.users['${username}'].client}  update_bid_document
  ...      ${path}
  ...      ${tender.data.id}
  ...      ${bid_id}
  ...      ${bid_doc['id']}
  ...      access_token=${tender.access.token}
1398 1399 1400
  ${uploaded_file} =  Create Dictionary
  ...      filepath=${path}
  ...      upload_response=${response}
Leits authored
1401 1402 1403 1404 1405
  Log object data   ${uploaded_file}
  [return]  ${uploaded_file}


Змінити документацію в ставці
1406
  [Arguments]  ${username}  ${tender_uaid}  ${doc_data}  ${doc_id}
mykhaly authored
1407
  ${bid_id}=  Get Variable Value   ${USERS.users['${username}'].bidresponses['bid'].data.id}
1408
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
mykhaly authored
1409
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}']['access_token']}
1410 1411
  ${bid}=  openprocurement_client.Отримати пропозицію  ${username}  ${tender_uaid}
  ${bid_doc}=  get_document_by_id  ${bid.data}  ${doc_id}
1412 1413 1414 1415 1416 1417
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_bid_document
  ...      ${tender.data.id}
  ...      ${doc_data}
  ...      ${bid_id}
  ...      ${bid_doc['id']}
  ...      access_token=${tender.access.token}
Leits authored
1418 1419 1420 1421 1422


Отримати пропозицію
  [Arguments]  ${username}  ${tender_uaid}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1423 1424
  ${bid_id}=  Get Variable Value  ${USERS.users['${username}'].bid_id}
  ${token}=  Get Variable Value  ${USERS.users['${username}'].access_token}
1425 1426 1427 1428
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  get_bid
  ...      ${tender.data.id}
  ...      ${bid_id}
  ...      access_token=${token}
Leits authored
1429
  ${reply}=  munch_dict  arg=${reply}
Leits authored
1430 1431 1432
  [return]  ${reply}

1433 1434 1435 1436 1437 1438
Отримати інформацію із пропозиції
  [Arguments]  ${username}  ${tender_uaid}  ${field}
  ${bid}=  openprocurement_client.Отримати пропозицію  ${username}  ${tender_uaid}
  [return]  ${bid.data.${field}}

Leits authored
1439
##############################################################################
1440
#             Qualification operations
Leits authored
1441 1442
##############################################################################
Krokop authored
1443 1444 1445 1446 1447

Отримати список документів по прекваліфікації
  [Documentation]
  ...       [Arguments] Username, tender uaid, qualification id
  ...       [Description] Return all qualification documents by id
Krokop authored
1448
  ...       [Return] Reply from API
Krokop authored
1449 1450
  [Arguments]  ${username}  ${tender_uaid}  ${qualification_id}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1451 1452 1453 1454
  ${doc_list}=  Call Method  ${USERS.users['${username}'].client}  get_qualification_documents
  ...      ${tender.data.id}
  ...      ${qualification_id}
  ...      access_token=${tender.access.token}
Krokop authored
1455 1456 1457 1458 1459 1460 1461 1462
  Log  ${doc_list}
  [Return]  ${doc_list}


Отримати список документів по кваліфікації
  [Documentation]
  ...       [Arguments] Username, tender uaid, award id
  ...       [Description] Return all awards documents by id
Krokop authored
1463
  ...       [Return] Reply from API
Krokop authored
1464 1465
  [Arguments]  ${username}  ${tender_uaid}  ${award_id}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1466 1467 1468 1469
  ${doc_list}=  Call Method  ${USERS.users['${username}'].client}  get_awards_documents
  ...      ${tender.data.id}
  ...      ${award_id}
  ...      access_token=${tender.access.token}
Krokop authored
1470 1471 1472 1473
  Log  ${doc_list}
  [Return]  ${doc_list}

1474
Отримати останній документ прекваліфікації з типом registerExtract
Krokop authored
1475 1476
  [Documentation]
  ...       [Arguments]  Username, tender uaid, qualification id
Krokop authored
1477 1478
  ...       [Description] Check documentType in last pre-quailfication document
  ...       [Return] Last document from pre-quailfication
Krokop authored
1479 1480
  [Arguments]  ${username}  ${tender_uaid}  ${qualification_id}
  ${docs}=  Run As  ${username}  Отримати список документів по прекваліфікації  ${tender_uaid}  ${qualification_id}
1481
  :FOR  ${item}  IN  @{docs['data']}
1482 1483 1484 1485
  \  ${status}  ${_}=  Run Keyword And Ignore Error  Dictionary Should Contain Key  ${item}  documentType
  \  Run Keyword If  '${status}' == 'PASS'  Exit For Loop
  Log  ${item}
  [Return]  ${item}
Krokop authored
1486 1487

1488
Отримати останній документ кваліфікації з типом registerExtract
Krokop authored
1489 1490 1491
  [Documentation]
  ...       [Arguments]  Username, tender uaid, award id
  ...       [Description] Check documentType in last award document
Krokop authored
1492
  ...       [Return] Last document for
Krokop authored
1493 1494
  [Arguments]  ${username}  ${tender_uaid}  ${award_id}
  ${docs}=  Run As  ${username}  Отримати список документів по кваліфікації  ${tender_uaid}  ${award_id}
1495
  :FOR  ${item}  IN  @{docs['data']}
1496 1497 1498 1499
  \  ${status}  ${_}=  Run Keyword And Ignore Error  Dictionary Should Contain Key  ${item}  documentType
  \  Run Keyword If  '${status}' == 'PASS'  Exit For Loop
  Log  ${item}
  [Return]  ${item}
Krokop authored
1500 1501

Leits authored
1502 1503 1504 1505 1506
Завантажити документ рішення кваліфікаційної комісії
  [Documentation]
  ...      [Arguments] Username, tender uaid, qualification number and document to upload
  ...      [Description] Find tender using uaid,  and call upload_qualification_document
  ...      [Return] Reply of API
1507
  [Arguments]  ${username}  ${document}  ${tender_uaid}  ${award_num}
1508
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1509 1510 1511 1512 1513
  ${doc}=  Call Method  ${USERS.users['${username}'].client}  upload_award_document
  ...      ${document}
  ...      ${tender.data.id}
  ...      ${tender.data.awards[${award_num}].id}
  ...      access_token=${tender.access.token}
1514
  Log  ${doc}
Leits authored
1515
1516
Leits authored
1517 1518 1519
Підтвердити постачальника
  [Documentation]
  ...      [Arguments] Username, tender uaid and number of the award to confirm
1520
  ...      Find tender using uaid, create dict with confirmation data and call patch_award
Leits authored
1521 1522
  ...      [Return] Nothing
  [Arguments]  ${username}  ${tender_uaid}  ${award_num}
1523
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
Leits authored
1524
  ${award}=  create_data_dict  data.status  active
1525
  Set To Dictionary  ${award.data}  id=${tender.data.awards[${award_num}].id}
1526
  Run Keyword IF  'open' in '${MODE}'
1527 1528 1529
  ...      Set To Dictionary  ${award.data}
  ...      qualified=${True}
  ...      eligible=${True}
1530 1531 1532 1533 1534
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award
  ...      ${tender.data.id}
  ...      ${award}
  ...      ${award.data.id}
  ...      access_token=${tender.access.token}
Leits authored
1535 1536
  Log  ${reply}
1537
1538
Дискваліфікувати постачальника
Leits authored
1539 1540 1541 1542
  [Documentation]
  ...      [Arguments] Username, tender uaid and award number
  ...      [Description] Find tender using uaid, create data dict with unsuccessful status and call patch_award
  ...      [Return] Reply of API
Leits authored
1543 1544
  [Arguments]  ${username}  ${tender_uaid}  ${award_num}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
Leits authored
1545
  ${award}=  create_data_dict   data.status  unsuccessful
1546
  Set To Dictionary  ${award.data}  id=${tender.data.awards[${award_num}].id}
1547 1548 1549 1550 1551
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award
  ...      ${tender.data.id}
  ...      ${award}
  ...      ${award.data.id}
  ...      access_token=${tender.access.token}
Leits authored
1552 1553 1554
  Log  ${reply}
  [Return]  ${reply}
1555
Leits authored
1556 1557 1558 1559 1560
Скасування рішення кваліфікаційної комісії
  [Documentation]
  ...      [Arguments] Username, tender uaid and award number
  ...      [Description] Find tender using uaid, create data dict with unsuccessful status and call patch_award
  ...      [Return] Reply of API
Leits authored
1561 1562
  [Arguments]  ${username}  ${tender_uaid}  ${award_num}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
Leits authored
1563
  ${award}=  create_data_dict   data.status  cancelled
1564
  Set To Dictionary  ${award.data}  id=${tender.data.awards[${award_num}].id}
1565 1566 1567 1568 1569
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_award
  ...      ${tender.data.id}
  ...      ${award}
  ...      ${award.data.id}
  ...      access_token=${tender.access.token}
Leits authored
1570 1571 1572
  Log  ${reply}

##############################################################################
1573 1574 1575
#             Limited procurement
##############################################################################
1576
Створити постачальника, додати документацію і підтвердити його
1577
  [Documentation]
1578
  ...      [Arguments] Username, tender uaid and supplier data
1579
  ...      Find tender using uaid and call create_award, add documentation to that award and update his status to active
1580
  ...      [Return] Nothing
1581
  [Arguments]  ${username}  ${tender_uaid}  ${supplier_data}  ${document}
1582
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1583
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  create_award  ${tender}  ${supplier_data}
1584
  Log  ${reply}
1585
  ${supplier_number}=  Set variable  0
1586
  openprocurement_client.Завантажити документ рішення кваліфікаційної комісії  ${username}  ${document}  ${tender_uaid}  ${supplier_number}
1587
  openprocurement_client.Підтвердити постачальника  ${username}  ${tender_uaid}  ${supplier_number}
1588 1589

1590
Скасувати закупівлю
1591
  [Documentation]
1592 1593 1594
  ...      [Arguments] Username, tender uaid, cancellation reason,
  ...      document and new description of document
  ...      [Description] Find tender using uaid, set cancellation reason, get data from cancel_tender
1595
  ...      and call create_cancellation
1596
  ...      After that add document to cancellation and change description of document
1597
  ...      [Return] Nothing
1598
  [Arguments]  ${username}  ${tender_uaid}  ${cancellation_reason}  ${document}  ${new_description}
1599
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1600 1601 1602
  ${data}=  Create dictionary  reason=${cancellation_reason}
  ${cancellation_data}=  Create dictionary  data=${data}
  ${cancellation_data}=  munch_dict  arg=${cancellation_data}
1603 1604 1605 1606
  ${cancel_reply}=  Call Method  ${USERS.users['${username}'].client}  create_cancellation
  ...      ${tender.data.id}
  ...      ${cancellation_data}
  ...      access_token=${tender.access.token}
1607 1608
  ${cancellation_id}=  Set variable  ${cancel_reply.data.id}
1609
  ${document_id}=  openprocurement_client.Завантажити документацію до запиту на скасування  ${username}  ${tender_uaid}  ${cancellation_id}  ${document}
1610
1611
  openprocurement_client.Змінити опис документа в скасуванні  ${username}  ${tender_uaid}  ${cancellation_id}  ${document_id}  ${new_description}
1612
1613
  openprocurement_client.Підтвердити скасування закупівлі  ${username}  ${tender_uaid}  ${cancellation_id}
1614 1615 1616


Завантажити документацію до запиту на скасування
1617
  [Documentation]
1618 1619 1620 1621
  ...      [Arguments] Username, tender uaid, cancellation id and document to upload
  ...      [Description] Find tender using uaid, and call upload_cancellation_document
  ...      [Return] ID of added document
  [Arguments]  ${username}  ${tender_uaid}  ${cancellation_id}  ${document}
1622
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1623 1624 1625 1626 1627
  ${doc_reply}=  Call Method  ${USERS.users['${username}'].client}  upload_cancellation_document
  ...      ${document}
  ...      ${tender.data.id}
  ...      ${cancellation_id}
  ...      access_token=${tender.access.token}
1628 1629
  Log  ${doc_reply}
  [Return]  ${doc_reply.data.id}
1630 1631 1632


Змінити опис документа в скасуванні
1633
  [Documentation]
1634 1635
  ...      [Arguments] Username, tender uaid, cancellation id, document id and new description of document
  ...      [Description] Find tender using uaid, create dict with data about description and call
1636 1637
  ...      patch_cancellation_document
  ...      [Return] Nothing
1638 1639
  [Arguments]  ${username}  ${tender_uaid}  ${cancellation_id}  ${document_id}  ${new_description}
  ${field}=  Set variable  description
1640
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1641 1642
  ${temp}=  Create Dictionary  ${field}=${new_description}
  ${data}=  Create Dictionary  data=${temp}
1643 1644 1645 1646 1647 1648
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_cancellation_document
  ...      ${tender.data.id}
  ...      ${data}
  ...      ${cancellation_id}
  ...      ${document_id}
  ...      access_token=${tender.access.token}
1649
  Log  ${reply}
1650 1651 1652


Підтвердити скасування закупівлі
1653 1654
  [Documentation]
  ...      [Arguments] Username, tender uaid, cancellation number
1655
  ...      Find tender using uaid, get cancellation test_confirmation data and call patch_cancellation
1656
  ...      [Return] Nothing
1657
  [Arguments]  ${username}  ${tender_uaid}  ${cancel_id}
1658
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1659
  ${data}=  test_confirm_data  ${cancel_id}
1660
  Log  ${data}
1661 1662 1663 1664 1665
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_cancellation
  ...      ${tender.data.id}
  ...      ${data}
  ...      ${data.data.id}
  ...      access_token=${tender.access.token}
1666
  Log  ${reply}
1667 1668

1669
Отримати інформацію із документа до скасування
1670
  [Arguments]  ${username}  ${tender_uaid}  ${cancel_id}  ${doc_id}  ${field_name}
1671 1672 1673 1674 1675 1676 1677
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  Log  ${document}
  [Return]  ${document['${field_name}']}


Отримати документ до скасування
1678
  [Arguments]  ${username}  ${tender_uaid}  ${cancel_id}  ${doc_id}
1679 1680 1681 1682 1683
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  ${filename}=  download_file_from_url  ${document.url}  ${OUTPUT_DIR}${/}${document.title}
  [return]  ${filename}
AlexDiatlov authored
1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713

Скасувати план
  [Arguments]  ${username}  ${tender_uaid}  ${cancellation_reason}
  ${tender}=  openprocurement_client.Пошук плану по ідентифікатору  ${username}  ${tender_uaid}
  ${data}=  Create dictionary  cancellation=${cancellation_reason}
  ${cancellation_data}=  Create dictionary  data=${data}
  ${cancellation_data}=  munch_dict  arg=${cancellation_data}
  ${cancel_reply}=  Call Method  ${USERS.users['${username}'].plan_client}  patch_plan
  ...      ${tender.data.id}
  ...      ${cancellation_data}
  ...      access_token=${tender.access.token}
  ${cancellation_id}=  Set variable  ${cancel_reply.data.id}
  openprocurement_client.Підтвердити скасування плану  ${username}  ${tender_uaid}  ${cancellation_id}


Підтвердити скасування плану
  [Documentation]
  ...      [Arguments] Username, tender uaid
  ...      Find plan using uaid, get cancellation test_confirmation data and call patch_plan
  ...      [Return] Nothing
  [Arguments]  ${username}  ${tender_uaid}  ${cancellation_id}
  ${tender}=  openprocurement_client.Пошук плану по ідентифікатору  ${username}  ${tender_uaid}
  ${data}=  test_confirm_plan_cancel_data
  Log  ${data}
  ${reply}=  Call Method  ${USERS.users['${username}'].plan_client}  patch_plan
  ...      ${tender.data.id}
  ...      ${data}
  ...      access_token=${tender.access.token}
  Log  ${reply}
Leits authored
1714 1715 1716 1717 1718 1719 1720 1721 1722
##############################################################################
#             OpenUA procedure
##############################################################################

Підтвердити кваліфікацію
  [Documentation]
  ...      [Arguments] Username, tender uaid and qualification number
  ...      [Description] Find tender using uaid, create data dict with active status and call patch_qualification
  ...      [Return] Reply of API
Leits authored
1723 1724
  [Arguments]  ${username}  ${tender_uaid}  ${qualification_num}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
Leits authored
1725
  ${qualification}=  create_data_dict   data.status  active
Leits authored
1726
  Set To Dictionary  ${qualification.data}  id=${tender.data.qualifications[${qualification_num}].id}  eligible=${True}  qualified=${True}
1727 1728 1729 1730 1731
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_qualification
  ...      ${tender.data.id}
  ...      ${qualification}
  ...      ${qualification.data.id}
  ...      access_token=${tender.access.token}
Leits authored
1732 1733
  Log  ${reply}
1734
Leits authored
1735 1736 1737 1738 1739
Відхилити кваліфікацію
  [Documentation]
  ...      [Arguments] Username, tender uaid and qualification number
  ...      [Description] Find tender using uaid, create data dict with unsuccessful status and call patch_qualification
  ...      [Return] Reply of API
Leits authored
1740 1741
  [Arguments]  ${username}  ${tender_uaid}  ${qualification_num}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
Leits authored
1742
  ${qualification}=  create_data_dict   data.status  unsuccessful
1743
  Set To Dictionary  ${qualification.data}  id=${tender.data.qualifications[${qualification_num}].id}
1744 1745 1746 1747 1748
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_qualification
  ...      ${tender.data.id}
  ...      ${qualification}
  ...      ${qualification.data.id}
  ...      access_token=${tender.access.token}
Leits authored
1749 1750
  Log  ${reply}
1751
Leits authored
1752 1753 1754 1755 1756 1757
Завантажити документ у кваліфікацію
  [Documentation]
  ...      [Arguments] Username, tender uaid, qualification number and document to upload
  ...      [Description] Find tender using uaid,  and call upload_qualification_document
  ...      [Return] Reply of API
  [Arguments]  ${username}  ${document}  ${tender_uaid}  ${qualification_num}
1758
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
1759 1760 1761 1762 1763
  ${doc_reply}=  Call Method  ${USERS.users['${username}'].client}  upload_qualification_document
  ...      ${document}
  ...      ${tender.data.id}
  ...      ${tender.data.qualifications[${qualification_num}].id}
  ...      access_token=${tender.access.token}
Leits authored
1764 1765
  Log  ${doc_reply}
1766
Leits authored
1767 1768 1769 1770 1771
Скасувати кваліфікацію
  [Documentation]
  ...      [Arguments] Username, tender uaid and qualification number
  ...      [Description] Find tender using uaid, create data dict with cancelled status and call patch_qualification
  ...      [Return] Reply of API
Leits authored
1772 1773
  [Arguments]  ${username}  ${tender_uaid}  ${qualification_num}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
Leits authored
1774
  ${qualification}=  create_data_dict   data.status  cancelled
1775
  Set To Dictionary  ${qualification.data}  id=${tender.data.qualifications[${qualification_num}].id}
1776 1777 1778 1779 1780
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_qualification
  ...      ${tender.data.id}
  ...      ${qualification}
  ...      ${qualification.data.id}
  ...      access_token=${tender.access.token}
Leits authored
1781
  Log  ${reply}
1782 1783 1784 1785 1786 1787 1788 1789 1790 1791


Затвердити остаточне рішення кваліфікації
  [Documentation]
  ...      [Arguments] Username and tender uaid
  ...
  ...      [Description] Find tender using uaid and call patch_tender
  ...
  ...      [Return] Reply of API
  [Arguments]  ${username}  ${tender_uaid}
1792
  ${internal_id}=  openprocurement_client.Отримати internal id по UAid  ${username}  ${tender_uaid}
1793
  ${tender}=  create_data_dict  data.id  ${internal_id}
1794
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
1795
  set_to_object  ${tender}  data.status  active.pre-qualification.stand-still
1796 1797 1798 1799
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
1800
  Log  ${reply}
oleh authored
1801 1802

1803 1804 1805 1806 1807 1808
Затвердити постачальників
  [Arguments]  ${username}  ${tender_uaid}
  ${internal_id}=  openprocurement_client.Отримати internal id по UAid  ${username}  ${tender_uaid}
  ${tender}=  create_data_dict  data.id  ${internal_id}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
  set_to_object  ${tender}  data.status  active.qualification.stand-still
1809 1810 1811 1812
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
1813 1814 1815
  Log  ${reply}

oleh authored
1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827
Перевести тендер на статус очікування обробки мостом
  [Documentation]
  ...      [Arguments] Username and tender uaid
  ...
  ...      [Description] Find tender using uaid and call patch_tender
  ...
  ...      [Return] Reply of API
  [Arguments]  ${username}  ${tender_uaid}
  ${internal_id}=  openprocurement_client.Отримати internal id по UAid  ${username}  ${tender_uaid}
  ${tender}=  create_data_dict  data.id  ${internal_id}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
  set_to_object  ${tender}  data.status  active.stage2.waiting
1828 1829 1830 1831
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
oleh authored
1832
  Log  ${reply}
1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846


Активувати другий етап
  [Documentation]
  ...      [Arguments] Username and tender uaid
  ...
  ...      [Description] Find tender using uaid and call patch_tender
  ...
  ...      [Return] Reply of API
  [Arguments]  ${username}  ${tender_uaid}
  ${internal_id}=  openprocurement_client.Отримати internal id по UAid  ${username}  ${tender_uaid}
  ${tender}=  create_data_dict  data.id  ${internal_id}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}'].access_token}
  set_to_object  ${tender}  data.status  active.tendering
1847 1848 1849 1850
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_tender
  ...      ${tender.data.id}
  ...      ${tender}
  ...      access_token=${tender.access.token}
1851
  Log  ${reply}
1852 1853 1854 1855 1856 1857 1858 1859 1860 1861

##############################################################################
#             CONTRACT SIGNING
##############################################################################

Редагувати угоду
  [Arguments]  ${username}  ${tender_uaid}  ${contract_index}  ${fieldname}  ${fieldvalue}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${contract}=  Create Dictionary  data=${tender.data.contracts[${contract_index}]}
  Set_to_object  ${contract.data}  ${fieldname}  ${fieldvalue}
1862 1863 1864 1865 1866
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_contract
  ...      ${tender.data.id}
  ...      ${contract}
  ...      ${contract.data.id}
  ...      access_token=${tender.access.token}
1867 1868 1869
  Log  ${reply}

qa-user-1 authored
1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897
Редагувати обидва поля вартості угоди
  [Arguments]  ${username}  ${tender_uaid}  ${contract_index}  ${field_amount}  ${field_amountNet}  ${fieldvalue}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${contract}=  Create Dictionary  data=${tender.data.contracts[${contract_index}]}
  Set_to_object  ${contract.data}  ${field_amount}  ${fieldvalue}
  Set_to_object  ${contract.data}  ${field_amountNet}  ${fieldvalue}
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_contract
  ...      ${tender.data.id}
  ...      ${contract}
  ...      ${contract.data.id}
  ...      access_token=${tender.access.token}
  Log  ${reply}


Змінити ознаку ПДВ на True
  [Arguments]  ${username}  ${tender_uaid}  ${contract_index}  ${vat_fieldvalue}  ${field_amount}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${contract}=  Create Dictionary  data=${tender.data.contracts[${contract_index}]}
  Set To Dictionary  ${contract.data.value}  valueAddedTaxIncluded=${vat_fieldvalue}
  Set To Dictionary  ${contract.data.value}  amountNet=${field_amount}
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_contract
  ...      ${tender.data.id}
  ...      ${contract}
  ...      ${contract.data.id}
  ...      access_token=${tender.access.token}
  Log  ${reply}

1898 1899 1900 1901 1902
Встановити ціну за одиницю для контракту
  [Arguments]  ${username}  ${tender_uaid}  ${contract_data}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  Log  ${tender}
  Log  ${contract_data}
1903 1904 1905 1906 1907 1908 1909 1910 1911 1912
  ${tender_id}=  Set Variable  ${tender.data.id}
  ${agreement_id}=  Set Variable  ${tender.data.agreements[0].id}
  ${contract_id}=  Set Variable  ${contract_data.data.id}
  ${access_token}=  Set Variable  ${tender.access.token}
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_agreement_contract
  ...      ${tender_id}
  ...      ${agreement_id}
  ...      ${contract_data}
  ...      contract_id=${contract_id}
  ...      access_token=${access_token}
1913 1914 1915 1916 1917 1918 1919 1920 1921
  Log  ${reply}


Зареєструвати угоду
  [Arguments]  ${username}  ${tender_uaid}  ${period}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${agreement}=  Create Dictionary  data=${tender.data.agreements[0]}
  Set To Dictionary  ${agreement.data}  status=active
  Set To Dictionary  ${agreement.data}  period=${period}
1922 1923 1924 1925 1926 1927 1928 1929
  ${tender_id}=  Set Variable  ${tender.data.id}
  ${agreement_id}=  Set Variable  ${tender.data.agreements[0].id}
  ${access_token}=  Set Variable  ${tender.access.token}
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_agreement
  ...      ${tender_id}
  ...      ${agreement}
  ...      ${agreement_id}
  ...      access_token=${access_token}
1930 1931 1932
  Log  ${reply}

qa-user-1 authored
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
Змінити ознаку ПДВ
  [Arguments]  ${username}  ${tender_uaid}  ${contract_index}  ${fieldvalue}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${contract}=  Create Dictionary  data=${tender.data.contracts[${contract_index}]}
  Set To Dictionary  ${contract.data.value}  valueAddedTaxIncluded=${fieldvalue}
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_contract
  ...      ${tender.data.id}
  ...      ${contract}
  ...      ${contract.data.id}
  ...      access_token=${tender.access.token}
  Log  ${reply}

1946 1947 1948 1949 1950
Встановити дату підписання угоди
  [Arguments]  ${username}  ${tender_uaid}  ${contract_index}  ${fieldvalue}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${contract}=  Create Dictionary  data=${tender.data.contracts[${contract_index}]}
  Set To Dictionary  ${contract.data}  dateSigned=${fieldvalue}
1951 1952 1953 1954 1955
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_contract
  ...      ${tender.data.id}
  ...      ${contract}
  ...      ${contract.data.id}
  ...      access_token=${tender.access.token}
1956 1957 1958
  Log  ${reply}

1959 1960 1961 1962 1963 1964 1965 1966
Вказати період дії угоди
  [Arguments]  ${username}  ${tender_uaid}  ${contract_index}  ${startDate}  ${endDate}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${period}=  Create Dictionary  startDate=${startDate}
  Set to Dictionary  ${period}  endDate=${endDate}
  ${contract}=  Create Dictionary  data=${tender.data.contracts[${contract_index}]}
  Set To Dictionary  ${contract.data}  period=${period}
  Log  ${contract}
1967 1968 1969 1970 1971
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_contract
  ...      ${tender.data.id}
  ...      ${contract}
  ...      ${contract.data.id}
  ...      access_token=${tender.access.token}
1972 1973 1974
  Log  ${reply}

1975 1976 1977 1978 1979
Завантажити документ в угоду
  [Arguments]  ${username}  ${path}  ${tender_uaid}  ${contract_index}  ${doc_type}=documents
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${contract_id}=  Get Variable Value  ${tender.data.contracts[${contract_index}].id}
  ${tender}=  set_access_key  ${tender}  ${USERS.users['${username}']['access_token']}
1980 1981 1982 1983 1984
  ${response}=  Call Method  ${USERS.users['${username}'].client}  upload_contract_document
  ...      ${path}
  ...      ${tender.data.id}
  ...      ${contract_id}
  ...      access_token=${tender.access.token}
1985 1986 1987 1988 1989 1990
  ${uploaded_file} =  Create Dictionary
  ...      filepath=${path}
  ...      upload_response=${response}
  Log object data  ${uploaded_file}

1991 1992 1993 1994 1995 1996 1997 1998 1999
Підтвердити підписання контракту
  [Documentation]
  ...      [Arguments] Username, tender uaid, contract number
  ...      Find tender using uaid, get contract test_confirmation data and call patch_contract
  ...      [Return] Nothing
  [Arguments]  ${username}  ${tender_uaid}  ${contract_num}
  ${tender}=  openprocurement_client.Пошук тендера по ідентифікатору  ${username}  ${tender_uaid}
  ${data}=  test_confirm_data  ${tender['data']['contracts'][${contract_num}]['id']}
  Log  ${data}
2000 2001 2002 2003 2004
  ${reply}=  Call Method  ${USERS.users['${username}'].client}  patch_contract
  ...      ${tender.data.id}
  ...      ${data}
  ...      ${data.data.id}
  ...      access_token=${tender.access.token}
2005
  Log  ${reply}
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023
  [Return]  ${reply}

##############################################################################
#             CONTRACT MANAGEMENT
##############################################################################

Отримати internal id по UAid для договору
  [Arguments]  ${username}  ${contract_uaid}
  Log  ${contract_uaid}
  Log  ${USERS.users['${username}'].contracts_id_map}
  ${status}=  Run Keyword And Return Status  Dictionary Should Contain Key  ${USERS.users['${username}'].contracts_id_map}  ${contract_uaid}
  Run Keyword and Return If  ${status}  Get From Dictionary  ${USERS.users['${username}'].contracts_id_map}  ${contract_uaid}
  Call Method  ${USERS.users['${username}'].contracting_client}  get_contracts
  ${contract_id}=  Wait Until Keyword Succeeds  15x  10 sec  get_contract_id_by_uaid  ${contract_uaid}  ${USERS.users['${username}'].contracting_client}
  Set To Dictionary  ${USERS.users['${username}'].contracts_id_map}  ${contract_uaid}  ${contract_id}
  [Return]  ${contract_id}

2024 2025 2026 2027 2028
Оновити сторінку з договором
  [Arguments]  ${username}  ${contract_uaid}
  openprocurement_client.Пошук договору по ідентифікатору  ${username}  ${contract_uaid}

smithumble authored
2029 2030
Отримати список договорів
  [Arguments]  ${username}
2031 2032
  @{contracts_feed}=  get_contracts_feed  ${USERS.users['${username}'].contracting_client}
  [return]  @{contracts_feed}
smithumble authored
2033 2034 2035 2036


Отримати договір по внутрішньому ідентифікатору
  [Arguments]  ${username}  ${internalid}
2037 2038
  ${contract}=  Call Method  ${USERS.users['${username}'].contracting_client}  get_contract  ${internalid}
  ${contract}=  munch_dict  arg=${contract}
2039
  Set To Dictionary  ${USERS.users['${username}']}  contract_data=${contract}
2040 2041
  Log  ${contract}
  [return]  ${contract}
2042 2043

smithumble authored
2044 2045 2046
Пошук договору по ідентифікатору
  [Arguments]  ${username}  ${contract_uaid}
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
2047
  ${contract}=  openprocurement_client.Отримати договір по внутрішньому ідентифікатору  ${username}  ${internalid}
smithumble authored
2048 2049 2050
  [return]  ${contract}

2051 2052 2053
Отримати доступ до договору
  [Arguments]  ${username}  ${contract_uaid}
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
2054
  ${contract}=  Call Method  ${USERS.users['${username}'].contracting_client}  retrieve_contract_credentials  ${internalid}  ${USERS.users['${username}'].access_token}
2055 2056 2057 2058 2059
  ${contract}=  munch_dict  arg=${contract}
  Set To Dictionary  ${USERS.users['${username}']}  contract_data=${contract}
  Set To Dictionary  ${USERS.users['${username}']}  contract_access_token=${contract.access.token}
  Log  ${contract}
  [return]  ${contract}
2060 2061

mykhaly authored
2062
Внести зміну в договір
2063 2064 2065
  [Arguments]  ${username}  ${contract_uaid}  ${change_data}
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
  ${reply}=  Call Method  ${USERS.users['${username}'].contracting_client}  create_change  ${internalid}  ${USERS.users['${username}'].contract_access_token}  ${change_data}
2066
  # we need this to have change id in `Додати документацію до зміни в договорі` and `Застосувати зміну` keywords
2067 2068 2069 2070
  ${empty_list}=  Create List
  ${changes}=  Get variable value  ${USERS.users['${username}'].changes}  ${empty_list}
  Append to list  ${changes}  ${reply}
  Set to dictionary  ${USERS.users['${username}']}  changes=${changes}
2071 2072
  Log  ${change_data}
  Log  ${reply}
2073
2074
2075 2076
Додати документацію до зміни в договорі
  [Arguments]  ${username}  ${contract_uaid}  ${document}
2077 2078
  ${contract}=  openprocurement_client.Пошук договору по ідентифікатору  ${username}  ${contract_uaid}
  ${contract}=  set_access_key  ${contract}  ${USERS.users['${username}'].contract_access_token}
2079 2080 2081 2082
  ${reply_doc_create}=  Call Method  ${USERS.users['${username}'].contracting_client}  upload_document
  ...      ${document}
  ...      ${contract.data.id}
  ...      access_token=${contract.access.token}
2083
  ${change_document}=  test_change_document_data  ${reply_doc_create}  ${USERS.users['${username}'].changes[0].data.id}
2084 2085 2086
  ${reply_doc_patch}=  Call Method  ${USERS.users['${username}'].contracting_client}  patch_document
  ...      ${contract.data.id}
  ...      ${change_document}
2087
  ...      ${change_document.data.id}
2088
  ...      access_token=${contract.access.token}
2089 2090
  Log  ${reply_doc_create}
  Log  ${reply_doc_patch}
2091 2092

2093
Редагувати поле договору
2094 2095 2096 2097 2098 2099
  [Arguments]  ${username}  ${contract_uaid}  ${fieldname}  ${fieldvalue}
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
  ${contract}=  openprocurement_client.Пошук договору по ідентифікатору  ${username}  ${contract_uaid}
  Set_To_Object  ${contract.data}   ${fieldname}   ${fieldvalue}
  Log  ${contract}
  ${contract}=  Call Method  ${USERS.users['${username}'].contracting_client}  patch_contract  ${internalid}  ${USERS.users['${username}'].contract_access_token}  ${contract}
qa-user-1 authored
2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110
  Log  ${contract}


Одночасно Редагувати два поля договору
  [Arguments]  ${username}  ${contract_uaid}  ${first_fieldname}  ${first_fieldvalue}  ${second_fieldname}  ${second_fieldvalue}
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
  ${contract}=  openprocurement_client.Пошук договору по ідентифікатору  ${username}  ${contract_uaid}
  Set_To_Object  ${contract.data}  ${first_fieldname}  ${first_fieldvalue}
  Set_To_Object  ${contract.data}  ${second_fieldname}  ${second_fieldvalue}
  Log  ${contract}
  ${contract}=  Call Method  ${USERS.users['${username}'].contracting_client}  patch_contract  ${internalid}  ${USERS.users['${username}'].contract_access_token}  ${contract}
2111
  Log  ${contract}
2112 2113

2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126
Редагувати зміну
  [Arguments]  ${username}  ${contract_uaid}  ${fieldname}  ${fieldvalue}
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
  ${data}=  Create Dictionary  ${fieldname}=${fieldvalue}
  ${data}=  Create Dictionary  data=${data}
  ${changes}=  Get variable value  ${USERS.users['${username}'].changes}
  ${change}=  munchify  ${changes[-1]}
  Log  ${change}
  ${reply}=  Call Method  ${USERS.users['${username}'].contracting_client}  patch_change  ${internalid}  ${USERS.users['${username}'].changes[-1].data.id}  ${USERS.users['${username}'].contract_access_token}  ${data}
  Log  ${data}
  Log  ${reply}

2127
Застосувати зміну
2128
  [Arguments]  ${username}  ${contract_uaid}  ${dateSigned}
2129
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
2130
  ${data}=  Create Dictionary  status=active  dateSigned=${dateSigned}
2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141
  ${data}=  Create Dictionary  data=${data}
  ${changes}=  Get variable value  ${USERS.users['${username}'].changes}
  ${change}=  munchify  ${changes[-1]}
  Log  ${change}
  ${reply}=  Call Method  ${USERS.users['${username}'].contracting_client}  patch_change  ${internalid}  ${USERS.users['${username}'].changes[-1].data.id}  ${USERS.users['${username}'].contract_access_token}  ${data}
  Log  ${data}
  Log  ${reply}


Завантажити документацію до договору
  [Arguments]  ${username}  ${contract_uaid}  ${document}
OrysiaDrabych authored
2142 2143
  ${contract}=  openprocurement_client.Пошук договору по ідентифікатору  ${username}  ${contract_uaid}
  ${contract}=  set_access_key  ${contract}  ${USERS.users['${username}'].contract_access_token}
2144 2145 2146 2147
  ${reply}=  Call Method  ${USERS.users['${username}'].contracting_client}  upload_document
  ...      ${document}
  ...      ${contract.data.id}
  ...      access_token=${contract.access.token}
2148 2149 2150
  Log  ${reply}

2151
Внести зміни в договір
2152
  [Arguments]  ${username}  ${contract_uaid}  ${data}
2153 2154 2155
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
  ${reply}=  Call Method  ${USERS.users['${username}'].contracting_client}  patch_contract  ${internalid}  ${USERS.users['${username}'].contract_access_token}  ${data}
  Log  ${reply}
2156 2157

2158 2159 2160 2161 2162 2163 2164 2165
Завершити договір
  [Arguments]  ${username}  ${contract_uaid}
  ${internalid}=  openprocurement_client.Отримати internal id по UAid для договору  ${username}  ${contract_uaid}
  ${data}=  Create Dictionary  status=terminated
  ${data}=  Create Dictionary  data=${data}
  ${reply}=  Call Method  ${USERS.users['${username}'].contracting_client}  patch_contract  ${internalid}  ${USERS.users['${username}'].contract_access_token}  ${data}

2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178
Отримати інформацію із договору
  [Arguments]  ${username}  ${contract_uaid}  ${field_name}
  openprocurement_client.Пошук договору по ідентифікатору
  ...      ${username}
  ...      ${contract_uaid}

  ${status}  ${field_value}=  Run keyword and ignore error
  ...      Get from object
  ...      ${USERS.users['${username}'].contract_data.data}
  ...      ${field_name}
  Run Keyword if  '${status}' == 'PASS'  Return from keyword   ${field_value}

  Fail  Field not found: ${field_name}
2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194


Отримати інформацію із документа до договору
  [Arguments]  ${username}  ${contract_uaid}  ${doc_id}  ${field_name}
  ${tender}=  openprocurement_client.Пошук договору по ідентифікатору  ${username}  ${contract_uaid}
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  Log  ${document}
  [Return]  ${document['${field_name}']}


Отримати документ до договору
  [Arguments]  ${username}  ${contract_uaid}  ${doc_id}
  ${tender}=  openprocurement_client.Пошук договору по ідентифікатору  ${username}  ${contract_uaid}
  ${document}=  get_document_by_id  ${tender.data}  ${doc_id}
  ${filename}=  download_file_from_url  ${document.url}  ${OUTPUT_DIR}${/}${document.title}
  [return]  ${filename}
2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292


Отримати доступ до угоди
  [Arguments]  ${username}  ${agreement_uaid}
  ${token}=  Set Variable  ${USERS.users['${username}'].access_token}
  ${internalid}=  openprocurement_client.Отримати internal id угоди по UAid  ${username}  ${agreement_uaid}
  ${agreement}=  Call Method  ${USERS.users['${username}'].agreement_client}  patch_credentials  ${internalid}  ${token}
  Set To Dictionary  ${USERS.users['${username}']}  agreement_access_token=${agreement.access.token}
  ${agreement}=  munch_dict  arg=${agreement}
  [return]   ${agreement}


Внести зміну в угоду
  [Arguments]  ${username}  ${agreement_uaid}  ${change_data}
  ${internalid}=  openprocurement_client.Отримати internal id угоди по UAid  ${username}  ${agreement_uaid}
  ${reply}=  Call Method  ${USERS.users['${username}'].agreement_client}  create_change
  ...      ${internalid}
  ...      ${change_data}
  ...      access_token=${USERS.users['${username}'].agreement_access_token}
  Log  ${reply}


Застосувати зміну для угоди
  [Arguments]  ${username}  ${agreement_uaid}  ${dateSigned}  ${status}
  ${agreement}=  openprocurement_client.Пошук угоди по ідентифікатору  ${username}  ${agreement_uaid}
  ${data}=  Create Dictionary  status=${status}  dateSigned=${dateSigned}
  ${data}=  Create Dictionary  data=${data}
  ${reply}=  Call Method  ${USERS.users['${username}'].agreement_client}  patch_change
  ...      ${agreement.data.id}
  ...      ${data}
  ...      ${agreement.data.changes[-1].id}
  ...      access_token=${USERS.users['${username}'].agreement_access_token}
  Log  ${reply}


Оновити властивості угоди
  [Arguments]  ${username}  ${agreement_uaid}  ${data}
  ${agreement}=  openprocurement_client.Пошук угоди по ідентифікатору  ${username}  ${agreement_uaid}
  ${reply}=  Call Method  ${USERS.users['${username}'].agreement_client}  patch_change
  ...      ${agreement.data.id}
  ...      ${data}
  ...      ${agreement.data.changes[-1].id}
  ...      access_token=${USERS.users['${username}'].agreement_access_token}
  Log  ${reply}


Завантажити документ в рамкову угоду
  [Arguments]  ${username}  ${filepath}  ${agreement_uaid}
  Log  ${username}
  Log  ${agreement_uaid}
  Log  ${filepath}
  ${agreement}=  openprocurement_client.Пошук угоди по ідентифікатору  ${username}  ${agreement_uaid}
  ${reply}=  Call Method  ${USERS.users['${username}'].agreement_client}  upload_document
  ...      ${filepath}
  ...      ${agreement.data.id}
  ...      access_token=${USERS.users['${username}'].agreement_access_token}
  Log Object Data  ${reply}  reply
  [return]  ${reply}


Завантажити документ для зміни у рамковій угоді
  [Arguments]  ${username}  ${filepath}  ${agreement_uaid}  ${item_id}
  Log  ${username}
  Log  ${agreement_uaid}
  Log  ${filepath}
  ${agreement}=  openprocurement_client.Пошук угоди по ідентифікатору  ${username}  ${agreement_uaid}
  ${document}=  openprocurement_client.Завантажити документ в рамкову угоду  ${username}  ${filepath}  ${agreement_uaid}
  Set to dictionary  ${document.data}  documentOf=change
  Set to dictionary  ${document.data}  relatedItem=${item_id}
  ${reply}=  Call Method  ${USERS.users['${username}'].agreement_client}  patch_document
  ...      ${agreement.data.id}
  ...      ${document}
  ...      ${document.data.id}
  ...      access_token=${USERS.users['${username}'].agreement_access_token}
  [return]  ${reply}


Завершити угоду
  [Arguments]  ${username}  ${agreement_uaid}
  ${internalid}=  openprocurement_client.Отримати internal id угоди по UAid  ${username}  ${agreement_uaid}
  ${data}=  Create Dictionary  status=terminated
  ${data}=  Create Dictionary  data=${data}
  ${reply}=  Call Method  ${USERS.users['${username}'].agreement_client}  patch_agreement
  ...      ${internalid}
  ...      ${data}
  ...      access_token=${USERS.users['${username}'].agreement_access_token}


Отримати інформацію із угоди
  [Arguments]  ${username}  ${agreement_uaid}  ${field_name}
  openprocurement_client.Пошук угоди по ідентифікатору
  ...      ${username}
  ...      ${agreement_uaid}
  ${status}  ${field_value}=  Run Keyword And Ignore Error
  ...      Get From Object
  ...      ${USERS.users['${username}'].agreement_data.data}
  ...      ${field_name}
  Run Keyword If  '${status}' == 'PASS'  Return From Keyword   ${field_value}
2293 2294 2295 2296 2297 2298 2299 2300
  Fail  Field not found: ${field_name}


знайти план за ідентифікатором
  [Arguments]  ${tender_uaid}  ${username}  ${save_key}=tender_data
  ${internalid}=  openprocurement_client.Отримати internal id плану по UAid  ${username}  ${tender_uaid}
  ${plan}=  openprocurement_client.Отримати план по внутрішньому ідентифікатору  ${username}  ${internalid}  ${save_key}
  [return]  ${plan}