ЕСОЗ - публічна документація

Update Contract Request tests

n/nDescriptionInputsexpected resultactual  resultexpected result GraphQLactual result GraphQL
UCR1Update Contract Request without scope
  • token
  • id
  • json
403403
"extensions": {
"code": "FORBIDDEN",
"exception": {
"missingAllowances": [
"contract_request:update"]}
},
"message": "Current client is not allowed to access this resource",
"extensions": {
"code": "FORBIDDEN",
"exception": {
"missingAllowances": [
"contract_request:update"]}
},
"message": "Current client is not allowed to access this resource",
UCR2Update Contract Request by other role than `NHS ADMIN SIGNER`
  • token NHS_OWNER
  • id
  • json
200200

UCR3Update Contract Request in status<>'IN_PROCESS'
  • token 
  • id request in status<>IN_PROCESS
422422, Incorrect status of contract_request to modify it
"extensions": {"code": "CONFLICT"},
"message": "Incorrect status of contract_request to modify it",
"path": [
"UpdateContractRequest"
"extensions": {"code": "CONFLICT"},
"message": "Incorrect status of contract_request to modify it",
"path": [
"UpdateContractRequest"
demo+
UCR4Update Contract Reuqest with ID doesn't exist
  • token
  • id doesn't exist
404404

{
"extensions": {
"code": "NOT_FOUND"
},
"message": "Not found",
"path": [
"updateContractRequest"
]
}

demo+

UCR5Update contract request with invalid price 
  • token
  • id 
  • nhs_contract_price<0
422

422, nhs_contract_price,

must be greater than 0

  • validate nhs_contract_price 
    • nhs_contract_price should be >= 0
      • in case error return 422 ("Contract price could not be negative")
"errors": [
{
"description": "expected the value to be >= 0",
"params": {
"greater_than_or_equal_to": 0
},
"rule": "number"
}
],
"extensions": {
"code": "UNPROCESSABLE_ENTITY"
},
"message": "Validation error",
"path": [
"updateContractRequest"
]
}
demo+
UCR6Update contract request with start_date start_date<today422422, Start date must be greater than create dateStart date must be greater than create date

{
"errors": [
{
"description": "Start date must be greater than current date",
"params": [],
"rule": "invalid"
}
],
"extensions": {
"code": "UNPROCESSABLE_ENTITY"
},
"locations": [
{
"column": 0,
"line": 2
}
],
"message": "Validation error",
"path": [
"updateContractRequest"
]
}


demo+

UCR7Update contract request using not valid nhs_payment_method
  • token
  • id
  • nhs_payment_method not from DICTIONARY
422422"message": "Argument \"input\" has invalid value $input.\nIn field \"nhsPaymentMethod\": Expected type \"NhsPaymentMethod\", found \"PAYMENT\".""message": "Argument \"input\" has invalid value $input.\nIn field \"nhsPaymentMethod\": Expected type \"NhsPaymentMethod\", found \"PAYMENT\"."
UCR8Update contract request without issue city
  • token
  • id
  • issue city absent 
200200
200
UCR9Update contract request with extra fields (msp data)
  • token
  • id
  • json
422

422, schema does not allow additional properties



UCR9Update updated contract request 
  • token
  • id
  • json
200200datadata
UCR10Update  nhs signer id
  • token
  • son


  • Validate $nhs_signer_id: fetch prm.employees.id=$nhs_signer_id 
    • check client_id=prm.employees.legal_entity_id
      • in case of error return 422 Error (Employee doesn't belong to legal_entity)
    • check status='APPROVED' and is_active=true
      • in case of error return 422 Error (Employee must be active)

"errors": [
{
"description": "Employee must be active",
"params": [],
"rule": "invalid"
}
],
"extensions": {
"code": "UNPROCESSABLE_ENTITY"
},
"message": "Validation error",
"path": [
"updateContractRequest"
]
}


demo+

ЕСОЗ - публічна документація