Additional approval of requests
Requesting material now requires validation only by the requestor. A link is sent to the request.email
and once clicked, the request is VALIDATED
and relayed to the genebanks (and the request status becomes DISPATCHED
).
In this ticket we are introducing an additional (but optional) approval by a second user. This approval only executes when request.approver != null
.
- The requestor validates the request
- Service executes
validateClientRequest
andvalidateRequest
and the request becomesVALIDATED
- If
request.approver != null
:- generate a new token of type
approve-request
- populate email template
smtp-material-approve
with request data (same as the current validation email) - sends it to
request.approver
- sets
request.state = NOTAPPROVED
- generate a new token of type
- If
request.approver == null
it proceeds withbreakup
andrelayRequests
-- the current flow.
- If
The approver receives the email with a link to approve/reject the request. The link leads to Genesys UI where the approver can click "Approve" and "Reject" buttons:
- Service executes
approveClientRequest(String tokenUuid, String key, boolean approve)
- It consumes the key, finds the request and ensures that
request.state == NOTAPPROVED
- if
approve == true
setrequest.state == APPROVED
and callbreakup
andrelayRequests
- if
approve == false
setrequest.state == REJECTED
and send an email (templatesmtp-material-rejected
) to requestor and approver that the request has been rejected
- It consumes the key, finds the request and ensures that
Model changes
In MaterialRequest
:
- Add
@ValidEmail String approver
- Add states:
NOTAPPROVED(10)
,APPROVED(11)
,REJECTED(12)
Service changes
Implement logic as described above.
API changes
- Add endpoint that returns request data for
tokenUuid + key
without consuming the token: we will use this endpoint to display request information to the approver and help them make the approval decision before callingapproveClientRequest
- Add endpoint interfacing with
approveClientRequest
for approval/reject operation