Skip to content

Commit

Permalink
feat(frontend): Add new controller for negotiation endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiodmota committed May 8, 2024
1 parent 6c32a6b commit 6b12263
Show file tree
Hide file tree
Showing 10 changed files with 693 additions and 4 deletions.
22 changes: 19 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,33 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Introduce dynamic status icons in the negotiation table to reflect the real-time status of each negotiation, enhancing user feedback and interaction.
- Added SnackBar for Report Table and Ratings for error and success messages


### Changed
#### Changed
- Update `UserInfo` component to conditionally display the negotiation page link in the user menu based on user roles, enhancing role-based access control.
- Modify the negotiation initiation process to reset item statuses to "Pending" before sending requests, providing clearer feedback on ongoing negotiations.
- Refine error handling in the negotiation process to alert users of failures and log errors for debugging purposes.

### Fixed
#### Fixes
- Resolve visual feedback issue where status icons would not reset to default state after re-initiating negotiations.
- Update Report and Table components from catena-x lib
- Configure css with new update components

### Backend

#### Added
- Implement `triggerNegotiation` function in `NegotiationServiceLogic` to handle sequential negotiation requests with external services, enhancing the negotiation process with error handling and response transformation.
- Introduce new DTOs (`NegotiationRequestDTO`, `NegotiationResponseDTO`, `EDRResponseDTO`) to streamline the handling of negotiation data and responses.
- Add utility functions in `EdcEndpointsMappingUtils` for parsing and extracting specific fields from JSON responses, improving data extraction reliability and code maintainability.

#### Changed
- Modify `executeSequentialNegotiationRequests` logic to include additional steps in the negotiation process, ensuring the correct sequence of requests and proper handling of intermediate responses.
- Update error handling across the negotiation process to log detailed error messages and fallback values, improving debugging and reliability.
- Refactor `createNegotiationRequestBody` to dynamically generate request bodies based on input parameters, enhancing flexibility and readability.

#### Fixes
- Address issue with incorrect extraction of `transferProcessId` by adjusting JSON path in `extractTransferProcessId` function.




## [1.3.2] - [2024-04-17]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/********************************************************************************
* Copyright (c) 2022,2024 BMW Group AG
* Copyright (c) 2022,2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package org.eclipse.tractusx.valueaddedservice.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Setter
@Getter
@Configuration
@ConfigurationProperties(prefix = "application.edc")
public class EdcProperties {

private List<String> providers;


}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class InputSharingBusinessPartnerDTO implements Serializable {
@Schema(example = "BPN-NUMBER")
private String bpn;

@Schema(example = "Portugal")
@Schema(example = "PT")
private String country;


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/********************************************************************************
* Copyright (c) 2022,2024 BMW Group AG
* Copyright (c) 2022,2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package org.eclipse.tractusx.valueaddedservice.dto.edc;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Represents a catalog item available for negotiation")
public class CatalogItemDTO {

@Schema(description = "Unique identifier of the catalog item", example = "1", required = true)
private String id;

@Schema(description = "Identifier of the offer associated with the catalog item", example = "offer123", required = true)
private String offerId;

@Schema(description = "Provider of the catalog item", example = "Provider A")
private String provider;

@Schema(description = "Subject of the catalog item", example = "cx-taxo:ReadAccessPoolForCatenaXMember")
private String subject;

@Schema(description = "Description of the catalog item", example = "Grants the Catena-X Member read access to the Pool API...")
private String description;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/********************************************************************************
* Copyright (c) 2022,2024 BMW Group AG
* Copyright (c) 2022,2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package org.eclipse.tractusx.valueaddedservice.dto.edc;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class EDRResponseDTO {

private String authCode;
private String endpoint;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/********************************************************************************
* Copyright (c) 2022,2024 BMW Group AG
* Copyright (c) 2022,2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package org.eclipse.tractusx.valueaddedservice.dto.edc;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Data Transfer Object for initiating a negotiation request")
public class NegotiationRequestDTO {

@Schema(description = "Unique identifier of the catalog item", example = "1", required = true)
private String id;

@Schema(description = "Identifier of the offer associated with the catalog item", example = "offer123", required = true)
private String offerId;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/********************************************************************************
* Copyright (c) 2022,2024 BMW Group AG
* Copyright (c) 2022,2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package org.eclipse.tractusx.valueaddedservice.dto.edc;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Data Transfer Object with negotiation status")
public class NegotiationResponseDTO {

@Schema(description = "Unique identifier of the catalog item", example = "1", required = true)
private String id;

@Schema(description = "Identifier of the offer associated with the catalog item", example = "offer123", required = true)
private String offerId;

@Schema(description = "Provider of the catalog item", example = "Provider A")
private String provider;

@Schema(description = "Status of negotiation of the catalog item", example = "Negotiated")
private String status;

@JsonIgnore
@Schema(description = "Auth Code for requesting the endpoint", example = "utasdbvhsarpoausighasd")
private String authCode;

@JsonIgnore
@Schema(description = "Endpoint for the Final Request", example = "http://localhost:80/finalRequest")
private String endpoint;
}
Loading

0 comments on commit 6b12263

Please sign in to comment.