...
- Search party_id by tax_id and birth_date for deduplication Party
- If found, update object party - Update party WS
- If not found, - Create object party
Update Party. See specification
The following fields can't be changed:
- tax_id
- Create party WS. See specification
- create related entity party-user in PRM
- Chech employee_id in request
- if employee_id is exist in request, Update employee.
- if employee_id is not exist, Create employee.
- Update employee. See specification
- The following fields can't be changed:
- employee_type
- if employee_type = 'DOCTOR', update doctor object
- The following fields can't be changed:
- Create new employee. See specification
If (employee_type =
'OWNER'OWNER || employee_type = PHARMACY_OWNER) : deactivate all other records with the employee_type =
'OWNER'OWNER
or employee_type = PHARMACY_OWNER for the legal_entity,
where new owner is creating:
Code Block | ||
---|---|---|
| ||
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' or e.employee_type = 'PHARMACY_OWNER') |
Create related entity party-user
...