Versions Compared

Key

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

Table of Contents

Image RemovedImage Added

Method is used for approve or reject employee request.

...

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

Create user in Auth

Create user in Auth

Create/Update employee

Image Removed

Method logic:Image Added

  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:
Code Block
languagesql
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'

Create related entity party-user

Create related entity party-user

Add role

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

...