Implement Endpoint for RIA Version
schmidni opened this issue · comments
User Story
As a Person looking at a Risk Assessment, I would like to know which Version this is, based on the Event this Risk Assessment belongs to.
Acceptance Criteria
The structure is
event (1) <--------> (0..*) originid (1) <--------> (0..*) riskassessment
Currently we are only counting published riskassessments per originid and basing our version number on that. Actually we should however count published riskassessments per event and base our version number on that.
The implementation is a lot more complex since the Event
concept is not present in the RIA. Therefore we need to add a new endpoint, which returns the Version for a given RiskAssessment.
I would suggest adding a new riskassessment endpoint:
/v1/riskassessment/{id}/version
To get the correct version, we need to find the event this riskassessment belongs to, then we need all the origins for this event, then all the published riskassessments for all those origins. Out of those we can find the version by ordering all those riskassessments by time.
No requirement to implement this.