Skip to content

Commit

Permalink
Merge pull request #610 from catenax-ng/feat/568-remove-bpn-summary
Browse files Browse the repository at this point in the history
Feat/568 remove bpn summary
  • Loading branch information
ds-jhartmann authored May 13, 2024
2 parents 6d1356b + 7e1f2af commit a62f4d8
Show file tree
Hide file tree
Showing 16 changed files with 9 additions and 113 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha

### Changed

- BPN summary was removed from Job response #568
- Shells in Job response will contain all submodel descriptors returned by provider, instead filtered by aspect-type parameter. #510

## [5.1.1] - 2024-05-08
Expand Down
7 changes: 1 addition & 6 deletions docs/src/api/irs-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1121,9 +1121,6 @@ components:
completed: 3
failed: 0
running: 0
bpnLookups:
completed: 3
failed: 0
relationships:
- catenaXId: urn:uuid:d9bec1c6-e47c-4d18-ba41-0a5fe8b7f447
linkedItem:
Expand Down Expand Up @@ -2154,7 +2151,7 @@ components:
additionalProperties: false
description: Container for a job with item graph.
example: |-
{"bpns"=[{"manufacturerId"="BPNL00000003AAXX", "manufacturerName"="AB CD"}], "job"={"completedOn"="2022-02-03T14:48:54.709Z", "createdOn"="2022-02-03T14:48:54.709Z", "exception"={"errorDetail"="Timeout while requesting Digital Registry", "exception"="IrsTimeoutException", "exceptionDate"="2022-02-03T14:48:54.709Z"}, "globalAssetId"="urn:uuid:6c311d29-5753-46d4-b32c-19b918ea93b0", "id"="e5347c88-a921-11ec-b909-0242ac120002", "lastModifiedOn"="2022-02-03T14:48:54.709Z", "parameter"={"aspects"=["SerialPart", "AddressAspect"], "auditContractNegotiation"=false, "bomLifecycle"="asBuilt", "collectAspects"=false, "depth"=1, "direction"="downward", "lookupBPNs"=false}, "startedOn"="2022-02-03T14:48:54.709Z", "state"="COMPLETED", "summary"={"asyncFetchedItems"={"completed"=3, "failed"=0, "running"=0}, "bpnLookups"={"completed"=3, "failed"=0}}}, "relationships"=[{"catenaXId"="urn:uuid:d9bec1c6-e47c-4d18-ba41-0a5fe8b7f447", "linkedItem"={"assembledOn"="2022-02-03T14:48:54.709Z", "childCatenaXId"="urn:uuid:a45a2246-f6e1-42da-b47d-5c3b58ed62e9", "hasAlternatives"=false, "lastModifiedOn"="2022-02-03T14:48:54.709Z", "lifecycleContext"="asBuilt", "quantity"={"measurementUnit"={"datatypeURI"="urn:bamm:io.openmanufacturing:meta-model:1.0.0#piece", "lexicalValue"="piece"}, "quantityNumber"=1}}}], "shells"=[{"contractAgreementId"="f253718e-a270-4367-901b-9d50d9bd8462", "payload"={"description"=[{"language"="en", "text"="The shell for a vehicle"}], "globalAssetId"="urn:uuid:a45a2246-f6e1-42da-b47d-5c3b58ed62e9", "id"="urn:uuid:882fc530-b69b-4707-95f6-5dbc5e9baaa8", "idShort"="future concept x", "specificAssetIds"=[{"name"="engineserialid", "value"="12309481209312"}], "submodelDescriptors"=[{"description"=[{"language"="en", "text"="Provides base vehicle information"}], "endpoints"=[{"interface"="HTTP", "protocolInformation"={"endpointProtocol"="HTTPS", "endpointProtocolVersion"=["1.0"], "href"="https://catena-x.net/vehicle/basedetails/", "subprotocol"="DSP", "subprotocolBody"="id=urn:uuid:c8159379-4613-48b8-ad52-6baed7afe923;dspEndpoint=https://irs-provider-controlplane3.dev.demo.catena-x.net", "subprotocolBodyEncoding"="plain"}}], "id"="urn:uuid:5d25a897-6571-4800-b98c-a3352fbf996d", "idShort"="SingleLevelBomAsPlanned", "semanticId"={"keys"=[{"type"="ExternalReference", "value"="urn:bamm:io.catenax.single_level_bom_as_planned:2.0.0#SingleLevelBomAsPlanned"}], "type"="ModelReference"}},
{"bpns"=[{"manufacturerId"="BPNL00000003AAXX", "manufacturerName"="AB CD"}], "job"={"completedOn"="2022-02-03T14:48:54.709Z", "createdOn"="2022-02-03T14:48:54.709Z", "exception"={"errorDetail"="Timeout while requesting Digital Registry", "exception"="IrsTimeoutException", "exceptionDate"="2022-02-03T14:48:54.709Z"}, "globalAssetId"="urn:uuid:6c311d29-5753-46d4-b32c-19b918ea93b0", "id"="e5347c88-a921-11ec-b909-0242ac120002", "lastModifiedOn"="2022-02-03T14:48:54.709Z", "parameter"={"aspects"=["SerialPart", "AddressAspect"], "auditContractNegotiation"=false, "bomLifecycle"="asBuilt", "collectAspects"=false, "depth"=1, "direction"="downward", "lookupBPNs"=false}, "startedOn"="2022-02-03T14:48:54.709Z", "state"="COMPLETED", "summary"={"asyncFetchedItems"={"completed"=3, "failed"=0, "running"=0}}}, "relationships"=[{"catenaXId"="urn:uuid:d9bec1c6-e47c-4d18-ba41-0a5fe8b7f447", "linkedItem"={"assembledOn"="2022-02-03T14:48:54.709Z", "childCatenaXId"="urn:uuid:a45a2246-f6e1-42da-b47d-5c3b58ed62e9", "hasAlternatives"=false, "lastModifiedOn"="2022-02-03T14:48:54.709Z", "lifecycleContext"="asBuilt", "quantity"={"measurementUnit"={"datatypeURI"="urn:bamm:io.openmanufacturing:meta-model:1.0.0#piece", "lexicalValue"="piece"}, "quantityNumber"=1}}}], "shells"=[{"contractAgreementId"="f253718e-a270-4367-901b-9d50d9bd8462", "payload"={"description"=[{"language"="en", "text"="The shell for a vehicle"}], "globalAssetId"="urn:uuid:a45a2246-f6e1-42da-b47d-5c3b58ed62e9", "id"="urn:uuid:882fc530-b69b-4707-95f6-5dbc5e9baaa8", "idShort"="future concept x", "specificAssetIds"=[{"name"="engineserialid", "value"="12309481209312"}], "submodelDescriptors"=[{"description"=[{"language"="en", "text"="Provides base vehicle information"}], "endpoints"=[{"interface"="HTTP", "protocolInformation"={"endpointProtocol"="HTTPS", "endpointProtocolVersion"=["1.0"], "href"="https://catena-x.net/vehicle/basedetails/", "subprotocol"="DSP", "subprotocolBody"="id=urn:uuid:c8159379-4613-48b8-ad52-6baed7afe923;dspEndpoint=https://irs-provider-controlplane3.dev.demo.catena-x.net", "subprotocolBodyEncoding"="plain"}}], "id"="urn:uuid:5d25a897-6571-4800-b98c-a3352fbf996d", "idShort"="SingleLevelBomAsPlanned", "semanticId"={"keys"=[{"type"="ExternalReference", "value"="urn:bamm:io.catenax.single_level_bom_as_planned:2.0.0#SingleLevelBomAsPlanned"}], "type"="ModelReference"}},
{"description"=[{"language"="en", "text"="Provides base vehicle information"}], "endpoints"=[{"interface"="HTTP", "protocolInformation"={"endpointProtocol"="HTTPS", "endpointProtocolVersion"=["1.0"], "href"="https://catena-x.net/vehicle/partdetails/", "subprotocol"="DSP", "subprotocolBody"="id=urn:uuid:c8159379-4613-48b8-ad52-6baed7afe923;dspEndpoint=https://irs-provider-controlplane3.dev.demo.catena-x.net", "subprotocolBodyEncoding"="plain"}}], "id"="urn:uuid:dae4d249-6d66-4818-b576-bf52f3b9ae90", "idShort"="vehicle part details", "semanticId"={"keys"=[{"type"="Submodel", "value"="urn:bamm:com.catenax.vehicle:0.1.1#PartDetails"}], "type"="ModelReference"}}]}}], "submodels"=[{"aspectType"="supply_chain_impacted", "contractAgreementId"="f253718e-a270-4367-901b-9d50d9bd8462", "identification"="urn:uuid:fc784d2a-5506-4e61-8e34-21600f8cdeff", "payload"={"supplyChainImpacted"="YES"}}], "tombstones"=[{"catenaXId"="urn:uuid:6c311d29-5753-46d4-b32c-19b918ea93b0", "endpointURL"="https://catena-x.net/vehicle/partdetails/", "processingError"={"errorDetail"="Details to reason of failure", "lastAttempt"="2022-02-03T14:48:54.709Z", "processStep"="SchemaValidation", "retryCounter"=0}}]}
properties:
bpns:
Expand Down Expand Up @@ -2754,8 +2751,6 @@ components:
properties:
asyncFetchedItems:
$ref: '#/components/schemas/AsyncFetchedItems'
bpnLookups:
$ref: '#/components/schemas/AsyncFetchedItems'
Tombstone:
type: object
additionalProperties: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.eclipse.tractusx.irs.component.BatchOrderResponse;
import org.eclipse.tractusx.irs.component.BatchResponse;
import org.eclipse.tractusx.irs.component.Bpn;
import org.eclipse.tractusx.irs.component.FetchedItems;
import org.eclipse.tractusx.irs.component.GlobalAssetIdentification;
import org.eclipse.tractusx.irs.component.Job;
import org.eclipse.tractusx.irs.component.JobErrorDetails;
Expand Down Expand Up @@ -284,7 +283,6 @@ private Example createCompleteEssJobResult() {
.completed(FETCHED_ITEMS_SIZE)
.failed(NO_RUNNING_OR_FAILED_ITEMS)
.build(),
FetchedItems.builder().completed(FETCHED_ITEMS_SIZE).failed(NO_RUNNING_OR_FAILED_ITEMS).build(),
SENT_NOTIFICATIONS_SIZE, SENT_NOTIFICATIONS_SIZE);
final Job job = essJobsJobs.getJob().toBuilder().summary(newSummary).build();
return toExample(essJobsJobs.toBuilder().job(job).build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ private Jobs updateLastModified(final Jobs irsJob, final ZonedDateTime lastModif
private Jobs extendSummary(final Jobs irsJob) {
final Summary oldSummary = Optional.ofNullable(irsJob.getJob().getSummary()).orElse(Summary.builder().build());
final NotificationSummary newSummary = new NotificationSummary(oldSummary.getAsyncFetchedItems(),
oldSummary.getBpnLookups(),
new NotificationItems(unansweredNotifications.size() + answeredNotifications.size(),
answeredNotifications.size()));
final Job job = irsJob.getJob().toBuilder().summary(newSummary).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import lombok.Value;
import lombok.extern.jackson.Jacksonized;
import org.eclipse.tractusx.irs.component.AsyncFetchedItems;
import org.eclipse.tractusx.irs.component.FetchedItems;
import org.eclipse.tractusx.irs.component.Summary;

/**
Expand All @@ -42,15 +41,14 @@ public class NotificationSummary extends Summary {

private final NotificationItems notifications;

public NotificationSummary(final AsyncFetchedItems asyncFetchedItems, final FetchedItems bpnLookups,
final NotificationItems notificationItems) {
super(asyncFetchedItems, bpnLookups);
public NotificationSummary(final AsyncFetchedItems asyncFetchedItems, final NotificationItems notificationItems) {
super(asyncFetchedItems);
this.notifications = notificationItems;
}

public NotificationSummary(final AsyncFetchedItems asyncFetchedItems, final FetchedItems bpnLookups,
final Integer sentNotification, final Integer receivedNotification) {
super(asyncFetchedItems, bpnLookups);
public NotificationSummary(final AsyncFetchedItems asyncFetchedItems, final Integer sentNotification,
final Integer receivedNotification) {
super(asyncFetchedItems);
this.notifications = new NotificationItems(sentNotification, receivedNotification);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.eclipse.tractusx.irs.common.persistence.BlobPersistenceException;
import org.eclipse.tractusx.irs.component.AsyncFetchedItems;
import org.eclipse.tractusx.irs.component.Bpn;
import org.eclipse.tractusx.irs.component.FetchedItems;
import org.eclipse.tractusx.irs.component.Job;
import org.eclipse.tractusx.irs.component.JobHandle;
import org.eclipse.tractusx.irs.component.JobParameter;
Expand Down Expand Up @@ -295,7 +294,6 @@ private Summary buildSummary(final int completedTransfersSize, final int running
.running(runningSize)
.failed(tombstonesSize)
.build())
.bpnLookups(FetchedItems.builder().completed(0).failed(0).build())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ static RegisterJob jobRequest(final String globalAssetId, final String bpn, fina
.depth(depth)
.aspects(List.of(batchAspectName, singleLevelBomAsBuiltAspectName))
.collectAspects(true)
.lookupBPNs(true)
.direction(Direction.DOWNWARD)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ void shouldReturnBadRequestWhenRegisterJobWithInvalidDirection(String invalidDir
"globalAssetId": "urn:uuid:c6d2d642-a055-4ddf-87e3-1a3b02c689e3",
"bpn": "BPNL00000000BJTL"
},
"direction": "<DIRECTION>",
"lookupBPNs": true
"direction": "<DIRECTION>"
}
""".replace("<DIRECTION>", invalidDirection))
.post("/irs/jobs")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,6 @@ public static JobParameter jobParameterFilter() {
.build();
}

public static JobParameter jobParameterCollectBpns() {
return JobParameter.builder()
.depth(0)
.bomLifecycle(BomLifecycle.AS_BUILT)
.direction(Direction.DOWNWARD)
.aspects(List.of(serialPartAspectName, singleLevelBomAsBuiltAspectName))
.lookupBPNs(true)
.build();
}

public static JobParameter jobParameterAuditContractNegotiation() {
return JobParameter.builder()
.depth(5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ public void collectAspects(String collectAspects) {
registerBatchOrderBuilder.collectAspects(Boolean.parseBoolean(collectAspects));
}

@And("lookupBPNs {string}")
public void lookupBPNs(String lookupBPNs) {
registerJobBuilder.lookupBPNs(Boolean.parseBoolean(lookupBPNs));
registerBatchOrderBuilder.lookupBPNs(Boolean.parseBoolean(lookupBPNs));
}

@And("depth {int}")
public void depth(int depth) {
registerJobBuilder.depth(depth);
Expand Down Expand Up @@ -368,9 +362,6 @@ public void iCheckIfSummaryContainsCompletedAndFailedItems(String summary, int c
if ("summary".equals(summary)) {
assertThat(completedJob.getJob().getSummary().getAsyncFetchedItems().getCompleted()).isEqualTo(completed);
assertThat(completedJob.getJob().getSummary().getAsyncFetchedItems().getFailed()).isEqualTo(failed);
} else if ("bpn summary".equals(summary)) {
assertThat(completedJob.getJob().getSummary().getBpnLookups().getCompleted()).isEqualTo(completed);
assertThat(completedJob.getJob().getSummary().getBpnLookups().getFailed()).isEqualTo(failed);
}
}

Expand Down Expand Up @@ -437,11 +428,6 @@ public void directionIs(String direction) {
assertThat(completedJob.getJob().getParameter().getDirection()).isEqualTo(Direction.fromValue(direction));
}

@And("lookupBPNs is {string}")
public void lookupBPNsIs(String lookupBPNs) {
assertThat(completedJob.getJob().getParameter().isLookupBPNs()).isEqualTo(Boolean.valueOf(lookupBPNs));
}

@And("bomLifecycle is {string}")
public void bomLifecycleIs(String bomLifecycle) {
assertThat(completedJob.getJob().getParameter().getBomLifecycle()).isEqualTo(
Expand Down

This file was deleted.

Loading

0 comments on commit a62f4d8

Please sign in to comment.