Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
## v3.5.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>3.5.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
2 changes: 1 addition & 1 deletion charts/puris/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ version: 4.2.1
# 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: "3.5.0"
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": "3.5.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,26 @@ 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