Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


n/ndescriptioninputsexpected result
actual result
CCR1Create Contract Request
  • owner_token
  • json include
    • contractor_employee_divisions
    • external_contractors
    • external_contractors_flag
200, created contract request

200, 

  • there is no validation for id_form
  • external_contractors incorrect saved to DB:
    {"{\"contract\": {\"number\": \"1234567\", \"issued_at\": \"2018-01-01\", \"expires_at\": \"2019-01-01\"}, \"divisions\": [{\"id\": \"be10b017-0328-40c6-8667-7c81608b7af0\", \"medical_service\": \"Послуга ПМД\"}], \"legal_entity_id\": \"c8aadb87-ecb9-41ca-9ad4-ffdfe1dd89c9\"}"
  • contractor_employees incorrect saved to DB
  • "contractor_owner": null
CCR2Create contract request without external_contractors_flag and with external_contractors
  • owner_token
  • json include
    • contractor_employee_divisions
    • external_contractors
422, external_contractors_flag422, Invalid external_contractor_flag
CCR2.1Create contract request with external_contractors_flag and with empty external_contractors
  • owner_token
  • "external_contractor_flag": true,
    "external_contractors": [],
422, array shouldn't be empty200
CCR2.2Create contract request with external_contractors_flag =false and without extrenal_contractors
  • owner_token
  • "external_contractor_flag": false
200200
CCR2.3Create contract request with extrenal_contractors in division which doesn't belong to contract
  • owner_token
  • "external_contractor": incorrect division
422, The division is not belong to contractor_employee_divisions422, The division is not belong to contractor_employee_divisions
CCR3Create Contract Request with doctor_token
  • doctor_token
  • json 
403, invalid access token403, Your scope does not allow to access this resource. Missing allowances: contract_request:create
CCR4Create contract request without scope
  • owner_token
403403, Your scope does not allow to access this resource. Missing allowances: contract_request:create
CCR5Create contract request with owner in other legal entity
  • another owner_token
  • json
403422, Contractor owner must be active within current legal entity in contract request
CCR6Create contract request with DISMISSED owner
  • owner_token - is_active=false
422
CCR7Create contract request with info from nhs side
  • json
422422, schema does not allow additional properties
CCR8contract request with invalid start_datestart_date='2020-01-01'422

422,

Start date must be within this or next year


CCR8.1contract request with invalid start_datestart_date=today-1422

422,

Start date must be greater than create date

CCR9contract request with invalid end_date"start_date": "2019-05-08",
"end_date": "2020-04-20",
422

422,

The year of start_date and and date must be equal

CCR9.1contract request with invalid end_date

end_date<start_date:

"start_date": "2019-05-06",
"end_date": "2019-04-20",

422,End date must be greater than start date200
CCR10Contractor_employee_division with dismissed doctorcontractor_employee_divisions.employee_id.status='DISMISSED'422, employee422, Employee must be active DOCTOR with linked division
CCR11Contractor_employee_division with inactive divisioncontractor_employee_divisions.division_id.status=INACTIVE422, division422, Division must be active and within current legal_entity
CCR12Contractor_employee_division with doctor and different division

contractor_employee_divisions:

  • employee_id doesn't match division_id
422422, Employee must be within current division
CCR12Update contract using contract_numberactive contract by contract_number200
CCR13Update contract using terminated contract_numberterminated contract by contract_number422
CCR14Create Contract Request within same dates as existing contract request
  • start_date & end_date as start_date and end_date existing NEW/APPROVED request
  • 200,
  • previous request is terminated
  • 200,
  • previous request in status='NEW'
CCR15Create Contract Request within same dates as existing contract request
  • start_date & end_date as start_date and end_date existing SIGNED request
200, previous request in status=SIGNED