eclipse-tractusx / eclipse-tractusx/puris

Frontend can't handle multiple offers for one asset

Open
#409 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Java
Stars
21
Forks
15
Avg merge
1d 9h
Merged PRs (30d)
22

Description

## Description

## Current behaviour

When having multiple offers for one asset, the catalog view can't handle it.

``` json
{
"@id" : "itemstocksubmodel-api-asset@BPNL00000007RXRX",
"@type" : "dcat:Dataset",
"odrl:hasPolicy" : [ {
"@id" : "Q09OVFJBQ1RfREVGXzE=:aXRlbXN0b2Nrc3VibW9kZWwtYXBpLWFzc2V0QEJQTkwwMDAwMDAwN1JYUlg=:MjMwYmU5NTItYjkzMi00YTBjLTg2ODEtMDdkMTc1ZmU3MWU0",
"@type" : "odrl:Offer",
"odrl:permission" : {
"odrl:action" : {
"odrl:type" : "http://www.w3.org/ns/odrl/2/use"
},
"odrl:constraint" : {
"odrl:and" : {
"odrl:leftOperand" : "https://w3id.org/catenax/policy/FrameworkAgreement",
"odrl:operator" : {
"@id" : "odrl:eq"
},
"odrl:rightOperand" : "Puris:1.0"
}
}
},
"odrl:prohibition" : [ ],
"odrl:obligation" : [ ]
}, {
"@id" : "QlBOTDAwMDAwMDA3UlRVUF9jb250cmFjdGRlZmluaXRpb25fZm9yX2l0ZW1zdG9ja3N1Ym1vZGVsLWFwaS1hc3NldEBCUE5MMDAwMDAwMDdSWFJY:aXRlbXN0b2Nrc3VibW9kZWwtYXBpLWFzc2V0QEJQTkwwMDAwMDAwN1JYUlg=:MjlkZDQ4MTQtZjgzMC00ZTgwLWEyNmMtZDI3NmRjNTNkNzVm",
"@type" : "odrl:Offer",
"odrl:permission" : {
"odrl:action" : {
"odrl:type" : "http://www.w3.org/ns/odrl/2/use"
},
"odrl:constraint" : {
"odrl:and" : [ {
"odrl:leftOperand" : "https://w3id.org/catenax/policy/FrameworkAgreement",
"odrl:operator" : {
"@id" : "odrl:eq"
},
"odrl:rightOperand" : "Puris:1.0"
}, {
"odrl:leftOperand" : "https://w3id.org/catenax/policy/UsagePurpose",
"odrl:operator" : {
"@id" : "odrl:eq"
},
"odrl:rightOperand" : "cx.puris.base:1"
} ]
}
},
"odrl:prohibition" : [ ],
"odrl:obligation" : [ ]
} ],
"dcat:distribution" : [ {
"@type" : "dcat:Distribution",
"dct:format" : {
"@id" : "AzureStorage-PUSH"
},
"dcat:accessService" : {
"@id" : "6e49fe39-a964-433b-95ec-24f095bdf69c",
"@type" : "dcat:DataService",
"dcat:endpointDescription" : "dspace:connector",
"dcat:endpointUrl" : "https://isst-edc-supplier.int.demo.catena-x.net/api/v1/dsp",
"dct:terms" : "dspace:connector",
"dct:endpointUrl" : "https://isst-edc-supplier.int.demo.catena-x.net/api/v1/dsp"
}
}, {
"@type" : "dcat:Distribution",
"dct:format" : {
"@id" : "HttpData-PULL"
},
"dcat:accessService" : {
"@id" : "6e49fe39-a964-433b-95ec-24f095bdf69c",
"@type" : "dcat:DataService",
"dcat:endpointDescription" : "dspace:connector",
"dcat:endpointUrl" : "https://isst-edc-supplier.int.demo.catena-x.net/api/v1/dsp",
"dct:terms" : "dspace:connector",
"dct:endpointUrl" : "https://isst-edc-supplier.int.demo.catena-x.net/api/v1/dsp"
}
}, {
"@type" : "dcat:Distribution",
"dct:format" : {
"@id" : "HttpData-PUSH"
},
"dcat:accessService" : {
"@id" : "6e49fe39-a964-433b-95ec-24f095bdf69c",
"@type" : "dcat:DataService",
"dcat:endpointDescription" : "dspace:connector",
"dcat:endpointUrl" : "https://isst-edc-supplier.int.demo.catena-x.net/api/v1/dsp",
"dct:terms" : "dspace:connector",
"dct:endpointUrl" : "https://isst-edc-supplier.int.demo.catena-x.net/api/v1/dsp"
}
}, {
"@type" : "dcat:Distribution",
"dct:format" : {
"@id" : "AmazonS3-PUSH"
},
"dcat:accessService" : {
"@id" : "6e49fe39-a964-433b-95ec-24f095bdf69c",
"@type" : "dcat:DataService",
"dcat:endpointDescription" : "dspace:connector",
"dcat:endpointUrl" : "https://isst-edc-supplier.int.demo.catena-x.net/api/v1/dsp",
"dct:terms" : "dspace:connector",
"dct:endpointUrl" : "https://isst-edc-supplier.int.demo.catena-x.net/api/v1/dsp"
}
} ],
"https://admin-shell.io/aas/3/0/HasSemantics/semanticId" : {
"@id" : "urn:samm:io.catenax.item_stock:2.0.0#ItemStock"
},
"https://w3id.org/catenax/ontology/common#version" : "3.0",
"id" : "itemstocksubmodel-api-asset@BPNL00000007RXRX",
"https://purl.org/dc/terms/type" : {
"@id" : "https://w3id.org/catenax/taxonomy#Submodel"
}
}
```

## Expected behavior

## Steps to reproduce the Bug

Setup in supplier and check catalog in customer
- Create second Policy (e.g. below)
- Create Contract:

``` json
# policy
{
"@context": [
"http://www.w3.org/ns/odrl.jsonld", //remote context
{
"edc": "https://w3id.org/edc/v0.0.1/ns/",
"cx-policy": "https://w3id.org/catenax/policy/"
}
],
"@type": "PolicyDefinitionRequestDto",
"@id": "{{CONTRACT_POLICY_ID}}",
"edc:policy": {
"@type": "Set",
"profile": "cx-policy:profile2405",
"permission": [
{
"action": "use",
"constraint": {
"and": [
{
"leftOperand": "cx-policy:FrameworkAgreement",
"operator": "eq",
"rightOperand": "Puris:1.0"
}
]
}
}
]
}
}

# contract
{
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"@id": "{{CONTRACT_DEFINITION_ID}}",
"@type": "ContractDefinition",
"accessPolicyId": "BPNL00000007RTUP_policy",
"contractPolicyId": "{{CONTRACT_POLICY_ID}}", // TODO create contractPolicy
"assetsSelector" : {
"@type" : "CriterionDto",
"operandLeft": "{{EDC_NAMESPACE}}id",
"operator": "=",
"operandRight": "itemstocksubmodel-api-asset@BPNL00000007RXRX"
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the catalog view using the supplier and customer setup described, then create a second policy and contract for the same asset. Trace how the catalog handles the returned offers and verify that an asset with multiple offers is displayed and usable without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.