ЕСОЗ - публічна документація
IL.Approve Employee
- Search in the registration_request by id and email
- return error if not found
- Check employee's signature using public_key and data from the payload
- error
- Check the creator's signature using the creator's public key and data from the payload. Employee should sign the same dataset as it has been created by creator.
- error
- search user in Auth
- if not found - create new user record
- if found - check that $payload.public_key = $user.public_key
- if true - update user profile
- if false - return error "email has been registered already for another user"
- create new employee record - call
ЕСОЗ - публічна документація