Skip to content

Commit

Permalink
Merge pull request eclipse-tractusx#157 from FraunhoferISST/feat/stoc…
Browse files Browse the repository at this point in the history
…kview-switch-to-item-stock

Feat: switch stock view to use item stock
  • Loading branch information
mhellmeier authored Jan 5, 2024
2 parents 8c1ded5 + c9df016 commit 5350252
Show file tree
Hide file tree
Showing 23 changed files with 592 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ public class DataInjectionCommandLineRunner implements CommandLineRunner {

@Autowired
private MaterialItemStockService materialItemStockService;

@Autowired
private ProductItemStockService productItemStockService;

@Autowired
private ReportedMaterialItemStockService reportedMaterialItemStockService;

@Autowired
private ReportedProductItemStockService reportedProductItemStockService;

@Autowired
private ItemStockSammMapper itemStockSammMapper;

Expand Down Expand Up @@ -266,6 +276,8 @@ private void setupCustomerRole() throws JsonProcessingException {
.locationBpna(address.getBpna())
.measurementUnit(ItemUnitEnumeration.UNIT_PIECE)
.quantity(12)
.customerOrderId("2023-ORD-4711")
.customerOrderPositionId("POS-1")
.build();
otherMaterialItemStock = materialItemStockService.create(otherMaterialItemStock);

Expand All @@ -277,6 +289,9 @@ private void setupCustomerRole() throws JsonProcessingException {
.locationBpns(newSite.getBpns())
.measurementUnit(ItemUnitEnumeration.UNIT_PIECE)
.quantity(23)
.customerOrderId("2023-ORD-4712")
.customerOrderPositionId("POS-1")
.supplierOrderId("2023-SUPPLIER-ORD")
.isBlocked(true)
.build();
thirdMaterialItemStock = materialItemStockService.create(thirdMaterialItemStock);
Expand Down Expand Up @@ -325,6 +340,54 @@ private void setupCustomerRole() throws JsonProcessingException {
for (var s : list) {
log.info(s.toString());
}

ProductItemStock productItemStock = ProductItemStock.builder()
.partner(nonScenarioCustomer)
.material(centralControlUnitEntity)
.lastUpdatedOnDateTime(new Date())
.locationBpns(mySelf.getSites().first().getBpns())
.locationBpna(mySelf.getSites().first().getAddresses().first().getBpna())
.measurementUnit(ItemUnitEnumeration.UNIT_PIECE)
.quantity(25)
.customerOrderId("2023-CUSTOMER-4712")
.customerOrderPositionId("CUS-POS-1")
.supplierOrderId("2023-MY-ORD")
.isBlocked(true)
.build();
productItemStock = productItemStockService.create(productItemStock);
log.info("Created ProductItemStock: {}", productItemStock.toString());

ReportedMaterialItemStock reportedMaterialItemStock = ReportedMaterialItemStock.builder()
.partner(supplierPartner)
.material(semiconductorMaterial)
.lastUpdatedOnDateTime(new Date())
.locationBpns(supplierPartner.getSites().first().getBpns())
.locationBpna(supplierPartner.getSites().first().getAddresses().first().getBpna())
.measurementUnit(ItemUnitEnumeration.UNIT_PIECE)
.quantity(25)
.customerOrderId("2023-ORD-4711")
.customerOrderPositionId("POS-1")
.supplierOrderId("2023-SUPPLIER-ORD")
.isBlocked(true)
.build();
reportedMaterialItemStock = reportedMaterialItemStockService.create(reportedMaterialItemStock);
log.info("Created ReportedMaterialItemStock: {}", reportedMaterialItemStock.toString());

ReportedProductItemStock reportedProductItemStock = ReportedProductItemStock.builder()
.partner(nonScenarioCustomer)
.material(centralControlUnitEntity)
.lastUpdatedOnDateTime(new Date())
.locationBpns(nonScenarioCustomer.getSites().first().getBpns())
.locationBpna(nonScenarioCustomer.getSites().first().getAddresses().first().getBpna())
.measurementUnit(ItemUnitEnumeration.UNIT_PIECE)
.quantity(25)
.customerOrderId("2023-CUSTOMER-4712")
.customerOrderPositionId("CUS-POS-1")
.supplierOrderId("2023-MY-ORD")
.isBlocked(true)
.build();
reportedProductItemStock = reportedProductItemStockService.create(reportedProductItemStock);
log.info("Created ReportedProductItemStock: {}", reportedProductItemStock.toString());
}

/**
Expand Down Expand Up @@ -386,7 +449,7 @@ private Partner createAndGetCustomerPartner() {
"BPNL4444444444XX",
"BPNS4444444444XX",
"Hauptwerk Musterhausen",
"BPNA4444444444ZZ",
"BPNA4444444444AA",
"Musterstraße 35b",
"77777 Musterhausen",
"Germany"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023 Volkswagen AG
* Copyright (c) 2023 Contributors to the Eclipse Foundation
* Copyright (c) 2023, 2024 Volkswagen AG
* Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -20,6 +20,7 @@
package org.eclipse.tractusx.puris.backend.common.security;


import jakarta.servlet.DispatcherType;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.puris.backend.common.security.logic.ApiKeyAuthenticationFilter;
Expand Down Expand Up @@ -70,6 +71,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
(authorizeHttpRequests) -> authorizeHttpRequests
.requestMatchers("/stockView/**", "/partners/**", "/materials/**", "/materialpartnerrelations/**", "/product-stock/**", "/edrendpoint/**").authenticated()
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**", "/health/**").permitAll()
.dispatcherTypeMatchers(DispatcherType.ERROR).permitAll()
)
.httpBasic(
AbstractHttpConfigurer::disable
Expand Down
Loading

0 comments on commit 5350252

Please sign in to comment.