Open mkanal opened 2 months ago
relates to #561
@mkanal: The current implementation GET /irs/policies returns a map of policies, not a list (because BPN is not part of the policy entity itself). See the following result:
{
"BPNL1234567890AB": [
... policies ...
]
}
How should the paging work here?
Returning Page<Policy>
would not transfer the information to which BPN it belongs.
Returning Map<BPN, Page<Policy>>
would convey the BPN information, but this feels wrong either and probably isn't what is needed.
Brainstorming options for harmonizing the BPN policy relationship with paging:
Policy
and return Page<Policy>>
. (This seems to me to be the best option, as this would be the default way of paging and thus the easiest option to understand. But: Are we allowed to extend the policy structure in this way?)Page<Policy>
, add another endpoint that can retrieve the BPNs for a list of policyIds (returning Map<BPN, List<policyId>>
.Page<Policy>
and a Map<BPN, List<policyId>>
to also transmit the BPN policy relationship (without needing additional queries).discussed with @ds-mwesener: we add bpn on the same level as validUntil and return a paged list instead of map
@mkanal: @ds-mwesener said they need multi-sort and multi-filter (with flexible sort operators). Single-sort is no problem. Maybe multi-sort can be implemented within the estimation too, but multi-filter goes far beyond the acceptance criteria in this story and cannot be implemented within the estimation.
Example requests to show how their multi-sort and multi-filter are designed:
multi-sort:
https://traceability.dev.demo.catena-x.net/api/assets/as-built
?page=0&size=50
&sort=id,asc
&sort=idShort,asc
multi-filter:
https://traceability.dev.demo.catena-x.net/api/assets/as-built
?filter=semanticDataModel%2CEQUAL%2CBATCH%2COR
&filter=semanticDataModel%2CEQUAL%2CSERIALPART%2COR'
suggestion: leave out the filter in this story completely and add new PBI(s) for multi-sort and multi-filter.
@dsmf please include multi-sort within this story. I will create a story with multi-filter. https://github.com/eclipse-tractusx/item-relationship-service/issues/750
&search=...&search=...
search=bpn,[EQUALS|STARTS_WITH],<value>
search=policyId,[EQUALS|STARTS_WITH],<value>
search=action,[EQUALS],[use|access]
sort=bpn,[asc|desc]
sort=policyId,[asc|desc]
sort=action,[asc|desc]
sort=createdOn,[asc|desc]
sort=validUntil,[asc|desc]
Hint: Integration tests can stay as they are temporarily because the old endpoint without paging is not removed in order to keep backward compatibility until the frontend is adapted.
Filtering:
Sorting:
Default filtering works
BPMN asc/desc works
valid until asc/desc works
policyId asc/desc works
createdOn asc/desc works
Multi-sort works
Update Insomnia - done
Update documentation - done
successfully tested - approved from my side
As business app Trace-X I want use filter, sorting, pagination for GET endpoints
so that we could visualize the data in a sufficient way
Links
Hints / Details
Acceptance Criteria
Out of Scope