Skip to content

Commit

Permalink
Merge pull request #476 from catenax-ng/feature/420-add-contractagree…
Browse files Browse the repository at this point in the history
…ments

feature: 420 fix filterExpression
  • Loading branch information
ds-jhartmann authored Mar 7, 2024
2 parents dc5ad8a + a6eb57b commit 460c29c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
* EdcContractAgreementRequest represents the request to management/v2/contractagreements/request
*/
public record EdcContractAgreementRequest(@JsonProperty(
"https://w3id.org/edc/v0.0.1/ns/filterExpression") List<EdcContractAgreementFilterExpression> edcContractAgreementFilterExpressions) {
"https://w3id.org/edc/v0.0.1/ns/filterExpression") EdcContractAgreementFilterExpression edcContractAgreementFilterExpressions) {
/**
* EdcContractAgreementFilterExpression represents the filterExpression
* for EdcContractAgreementRequest
*/
public record EdcContractAgreementFilterExpression(
@JsonProperty("https://w3id.org/edc/v0.0.1/ns/operandLeft") String operandLeft,
@JsonProperty("https://w3id.org/edc/v0.0.1/ns/operator") String operator,
@JsonProperty("https://w3id.org/edc/v0.0.1/ns/operandRight") String operandRight) {
@JsonProperty("https://w3id.org/edc/v0.0.1/ns/operandRight") List<String> operandRight) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ public EdcContractAgreementNegotiationResponse getContractAgreementNegotiation(f

private EdcContractAgreementRequest buildContractAgreementRequest(final List<String> contractAgreementIds) {

final List<EdcContractAgreementFilterExpression> list = contractAgreementIds.stream()
.map(s -> new EdcContractAgreementFilterExpression(
EDC_CONTRACT_AGREEMENT_ID, "=", s))
.toList();
final EdcContractAgreementFilterExpression edcContractAgreementFilterExpression = new EdcContractAgreementFilterExpression(
EDC_CONTRACT_AGREEMENT_ID, "in", contractAgreementIds);

return new EdcContractAgreementRequest(list);
return new EdcContractAgreementRequest(edcContractAgreementFilterExpression);
}

private HttpHeaders headers() {
Expand Down

0 comments on commit 460c29c

Please sign in to comment.