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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 31 Next »

Method is used for approve or reject employee request.

See service specification

Sample Request
curl -X POST -H 'Content-Type: application/json' -H 'Authorization:Bearer YW5WcFkyVnFkV2xqWldwMWFXTmxDZzpjY1hwWTR0cWRZbGVjNHAxYUdsMXVJ' 'http://ehealth.nebo15.com/employee_requests/d290f1ee-6c54-4b01-90e6-d701748f0851/actions/approve'

Authorize

  1. Verify the validity of access token
  2. Check user scope employee_request:update in order to perform this action
    1. In case error - return 401 error


Check action in request

  1. if action = APPROVE, add user new role
  2. if action - REJECT, update employee request status on REJECTED 

Update employee request status to REJECTED

Invoke WS to update employee request status with parameter 'action'='reject' 

See service specification

Sample Request
curl -X PATCH -H 'Content-Type: application/json' 'http://ehealth.nebo15.com/employee_requests/d290f1ee-6c54-4b01-90e6-d701748f0851/actions/reject'

Get Employee Request Details

Invoke WS Get Employee Request by ID for further employee creation

 See service specification

Sample Request
curl -X GET -H 'Content-Type: application/json' 'http://ehealth.nebo15.com/employee_requests/d290f1ee-6c54-4b01-90e6-d701748f0851'

Create/Update employee

Method logic:

  1. Search party_id by tax_id and birth_date for deduplication Party
    1. If found, update object party - Update party WS
    2. If not found, - Create object party 
  2. Update Party.  See specification

    1. The following fields can't be changed:

      1. tax_id
  3. Create party WS. See specification
    1. create related entity party-user in PRM 
  4. Chech employee_id in request
    1. if employee_id is exist in request, Update employee.
    2. if  employee_id is not exist, Create employee.
  5. Update employee. See specification
    1. The following fields can't be changed:
      1. employee_type
    2. if employee_type = 'DOCTOR', update doctor object
  6. Create new employee. See specification
    1. If employee_type = 'OWNER': deactivate all other records with the employee_type = 'OWNER' for the legal_entity, where new owner is creating:
update employees e 
set is_active = false
inserted_by = $new_owner_id
inserted_at = md5(clock_timestamp()
where e.legal_entity_id = $employee_request.legal_entity_id
and e.employee_type = 'OWNER'


Add role

Add user role by invoke service - название метода

Role is assigned according to employee_type

See service logic

See service spesification

Sample Request
curl -X POST -H 'Content-Type: application/json' -d '{
  "role": "doctor",
  "client_id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b"
}' 'https://trump.herokuapp.com/admin/parties/b075f148-7f93-4fc2-b2ec-2d81b19a9b7b/add_role'

Update employee request status on APPROVED

Invoke WS to update employee request status with parameter 'action'='approve' 

See service specification

Sample Request
curl -X PATCH -H 'Content-Type: application/json' 'http://ehealth.nebo15.com/employee_requests/b075f148-7f93-4fc2-b2ec-2d81b19a9b7b/actions/approve'

Send Email

Send email with successful registration using WS - Send Message (TBD)

Temporarily use Postmark

  • No labels