Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v3.4.1
## v4.0.0

The following Changelog lists the changes. Please refer to the [documentation](docs/README.md) for configuration needs and understanding the concept changes.

Expand All @@ -24,6 +24,7 @@ The **need for configuration updates** is **marked bold**.
- Fixed invalid framework policy in the bruno DTR setup ([#967](https://github.com/eclipse-tractusx/puris/pull/967))
- Fixed Modal dialogs not updating when deleting entries for materials ([#984](https://github.com/eclipse-tractusx/puris/pull/984))
- Allow 0 values in all reported and most own data to improve application resiliency ([#991](https://github.com/eclipse-tractusx/puris/pull/991))
- Fixed product and material stocks always including values for all materials ([#994](https://github.com/eclipse-tractusx/puris/pull/994))

## v3.4.0

Expand Down
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</parent>
<groupId>org.eclipse.tractusx.puris</groupId>
<artifactId>puris-backend</artifactId>
<version>3.4.1</version>
<version>4.0.0</version>
<name>puris-backend</name>
<description>PURIS Backend</description>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ public List<FrontendMaterialDto> getProducts(Optional<Boolean> includeDaysOfSupp

@GetMapping("product-stocks")
@ResponseBody
@Operation(description = "Returns a list of all product-stocks")
public List<ProductStockDto> getProductStocks() {
return productItemStockService.findAll().stream()
@Operation(summary = "Get all material stocks for the given Material", description = "Get all material stocks for the given material number.")
public List<ProductStockDto> getProductStocks(@Parameter(description = "encoded in base64") String ownMaterialNumber) {
ownMaterialNumber = new String(Base64.getDecoder().decode(ownMaterialNumber));
return productItemStockService.findByOwnMaterialNumber(ownMaterialNumber).stream()
.map(this::convertToDto)
.collect(Collectors.toList());
}
Expand Down Expand Up @@ -342,9 +343,10 @@ private ProductItemStock convertToEntity(ProductStockDto dto) {

@GetMapping("material-stocks")
@ResponseBody
@Operation(description = "Returns a list of all material-stocks")
public List<MaterialStockDto> getMaterialStocks() {
List<MaterialStockDto> allMaterialStocks = materialItemStockService.findAll().stream()
@Operation(summary = "Get all material stocks for the given Material", description = "Get all material stocks for the given material number.")
public List<MaterialStockDto> getMaterialStocks(@Parameter(description = "encoded in base64") String ownMaterialNumber) {
ownMaterialNumber = new String(Base64.getDecoder().decode(ownMaterialNumber));
List<MaterialStockDto> allMaterialStocks = materialItemStockService.findByOwnMaterialNumber(ownMaterialNumber).stream()
.map(this::convertToDto)
.collect(Collectors.toList());
return allMaterialStocks;
Expand Down
4 changes: 2 additions & 2 deletions charts/puris/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ dependencies:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 4.2.1
version: 5.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "3.4.1"
appVersion: "4.0.0"
2 changes: 1 addition & 1 deletion charts/puris/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# puris

![Version: 4.2.1](https://img.shields.io/badge/Version-4.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.4.1](https://img.shields.io/badge/AppVersion-3.4.1-informational?style=flat-square)
![Version: 5.0.0](https://img.shields.io/badge/Version-4.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.0.0](https://img.shields.io/badge/AppVersion-3.4.1-informational?style=flat-square)

A helm chart for Kubernetes deployment of PURIS

Expand Down
14 changes: 14 additions & 0 deletions docs/admin/Migration_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This migration guide is based on the `chartVersion` of the chart that also bumps

<!-- TOC -->
- [Migration Guide](#migration-guide)
- [Version 4.2.x to 5.0.x](#version-42x-to-50x)
- [StockView Controller Needs Mandatory Parameter for Routes material-stocks and product-stocks](#stockview-controller-needs-mandatory-parameter-for-routes-material-stocks-and-product-stocks)
- [Version 4.1.x to 4.2.x](#version-41x-to-42x)
- [Suppress Contract Creation for Digital Twin Registry (DTR)](#suppress-contract-creation-for-digital-twin-registry-dtr)
- [Version 4.0.x to 4.1.x](#version-40x-to-41x)
- [Database changes to support new notification functionality](#database-changes-to-support-new-notification-functionality)
- [Version 3.0.x to 4.0.x](#version-30x-to-40x)
Expand Down Expand Up @@ -52,6 +56,16 @@ This migration guide is based on the `chartVersion` of the chart that also bumps
> - Deploying an older version of the software may have used an older postgresql version. This is NOT applicable for the PURIS charts.
> - The community is working out on how to resolve the issue.

## Version 4.2.x to 5.0.x

### StockView Controller Needs Mandatory Parameter for Routes material-stocks and product-stocks

In case you made use of the backend routes `stockView/material-stocks` or `stockView/product-stocks`, both now need a mandatory parameter `ownMaterialNumber` accepting the base64 encoded material number (same as for production, demand and delivery). This is done to harmonize the API and fix [issue#979](https://github.com/eclipse-tractusx/puris/issues/979).

Due to low usage volumes, we decided to not keep this part downward compatible.

Please refer to the swagger-ui hosted at `your-backend-address/catena/swagger-ui/index.html` or the [latest version hosted at the api hub.](https://eclipse-tractusx.github.io/api-hub/puris/)

## Version 4.1.x to 4.2.x

### Suppress Contract Creation for Digital Twin Registry (DTR)
Expand Down
26 changes: 23 additions & 3 deletions docs/api/openAPI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ components:
type: apiKey
info:
title: PURIS FOSS Open API
version: 3.3.0
version: 4.0.0
openapi: 3.1.0
paths:
/days-of-supply/customer:
Expand Down Expand Up @@ -3661,8 +3661,17 @@ paths:
- stock-view-controller
/stockView/material-stocks:
get:
description: Returns a list of all material-stocks
description: Get all material stocks for the given material number.
operationId: getMaterialStocks
parameters:
- description: encoded in base64
in: query
name: ownMaterialNumber
required: true
schema:
additionalProperties: false
maxItems: 50
type: string
responses:
'200':
content:
Expand All @@ -3674,6 +3683,7 @@ paths:
maxItems: 50
type: array
description: OK
summary: Get all material stocks for the given Material
tags:
- stock-view-controller
post:
Expand Down Expand Up @@ -3805,8 +3815,17 @@ paths:
- stock-view-controller
/stockView/product-stocks:
get:
description: Returns a list of all product-stocks
description: Get all material stocks for the given material number.
operationId: getProductStocks
parameters:
- description: encoded in base64
in: query
name: ownMaterialNumber
required: true
schema:
additionalProperties: false
maxItems: 50
type: string
responses:
'200':
content:
Expand All @@ -3818,6 +3837,7 @@ paths:
maxItems: 50
type: array
description: OK
summary: Get all material stocks for the given Material
tags:
- stock-view-controller
post:
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "puris-frontend",
"description": "Puris frontend",
"license": "Apache-2.0",
"version": "3.4.1",
"version": "4.0.0",
"type": "module",
"scripts": {
"dev": "vite --host --mode customer --port 5173",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function useMaterialDetails(materialNumber: string, direction: DirectionT
const { productions, isLoadingProductions, refreshProduction } = useProduction(materialNumber ?? null, null);
const { demands, isLoadingDemands, refreshDemand } = useDemand(materialNumber ?? null, null);
const { deliveries, isLoadingDeliveries, refreshDelivery } = useDelivery(materialNumber ?? null, null);
const { stocks, isLoadingStocks, refreshStocks } = useStocks(direction === 'INBOUND' ? 'material' : 'product');
const { stocks, isLoadingStocks, refreshStocks } = useStocks(direction === 'INBOUND' ? 'material' : 'product', materialNumber);
const { supplies, isLoadingSupply, refreshSupply } = useDaysOfSupply(materialNumber, direction);
const { partners, isLoadingPartners } = usePartners(direction === 'INBOUND' ? 'material' : 'product', materialNumber);
const [expandablePartners, setExpandablePartners] = useState<Expandable<Partner>[]>([]);
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/features/stock-view/hooks/useStocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ import { useFetch } from '@hooks/useFetch';
import { Stock, StockType } from '@models/types/data/stock';


export const useStocks = <T extends StockType>(type: T) => {
export const useStocks = <T extends StockType>(type: T, ownMaterialNumber: string) => {
const url = type === 'material' ? config.app.ENDPOINT_MATERIAL_STOCKS : config.app.ENDPOINT_PRODUCT_STOCKS;
const query = `?ownMaterialNumber=${btoa(ownMaterialNumber)}`;
const {
data: stocks,
error: stocksError,
isLoading: isLoadingStocks,
refresh: refreshStocks,
} = useFetch<Stock[]>(config.app.BACKEND_BASE_URL + url);
} = useFetch<Stock[]>(config.app.BACKEND_BASE_URL + url + query);
return {
stocks,
stocksError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@ meta {
}

get {
url: {{CUSTOMER_PURIS_BACKEND}}/catena/stockView/material-stocks
url: {{CUSTOMER_PURIS_BACKEND}}/catena/stockView/material-stocks?ownMaterialNumber={{B64_MNR_CUSTOMER}}
body: none
auth: none
}

params:query {
ownMaterialNumber: {{B64_MNR_CUSTOMER}}
}

headers {
X-Api-Key: {{CUSTOMER_PURIS_BACKEND_API_KEY}}
}

script:pre-request {
var plain = bru.getEnvVar("MATERIAL_NUMBER_CUSTOMER")
var encoded = Buffer.from(plain).toString("base64")
bru.setVar("B64_MNR_CUSTOMER", encoded)
}

tests {
test("response is ok", function() {
expect(res.getStatus()).to.equal(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@ meta {
}

get {
url: {{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks
url: {{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks?ownMaterialNumber={{B64_MNR_SUPPLIER}}
body: none
auth: none
}

params:query {
ownMaterialNumber: {{B64_MNR_SUPPLIER}}
}

headers {
X-Api-Key: {{SUPPLIER_PURIS_BACKEND_API_KEY}}
}

script:pre-request {
var plain = bru.getEnvVar("MATERIAL_NUMBER_SUPPLIER")
var encoded = Buffer.from(plain).toString("base64")
bru.setVar("B64_MNR_SUPPLIER", encoded)
}

tests {
test("response is ok", function() {
expect(res.getStatus()).to.equal(200);
Expand Down
Loading