...
- in case error (found 0 or more then one) set il.declaration_request.mpi_id=null
Validate declaration limit
- Count all declarations in status
active
where OPS.declarations.employee_id==$.declaration_request.employee_id
1.1 If there is an active declaration with the current person, exclude it from the selection - Count all declaration_requests in status
approved
where IL.declaration_requests.data($.employee.id) ==$.declaration_request.employee_id - Select config parameter for declarations_limit where speciality == $.declaration_request.scope
- Compare the result of selections with config parameter. In case count (declarations+declaration_requests )> config_parameter, return 409 "The employee has reached the declaration limit"
Determine default auth method for new MPI
...