Skip to content

Commit

Permalink
Merge pull request #155 from FraunhoferISST/feat/stockview-add-orderP…
Browse files Browse the repository at this point in the history
…ositionReference

Feat: add order position reference to stockview
  • Loading branch information
mhellmeier authored Jan 4, 2024
2 parents 83da1b9 + 25906b1 commit 8c1ded5
Show file tree
Hide file tree
Showing 4 changed files with 393 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
import org.eclipse.tractusx.puris.backend.masterdata.logic.service.MaterialService;
import org.eclipse.tractusx.puris.backend.masterdata.logic.service.PartnerService;
import org.eclipse.tractusx.puris.backend.stock.logic.dto.FrontendMaterialDto;
import org.eclipse.tractusx.puris.backend.stock.logic.service.MaterialStockService;
import org.eclipse.tractusx.puris.backend.stock.logic.service.PartnerProductStockService;
import org.eclipse.tractusx.puris.backend.stock.logic.service.ProductStockRequestApiService;
import org.eclipse.tractusx.puris.backend.stock.logic.service.ProductStockService;
import org.eclipse.tractusx.puris.backend.stock.logic.service.*;
import org.junit.jupiter.api.Test;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -66,6 +63,9 @@ class StockViewControllerTest {
@MockBean
private ProductStockService productStockService;

@MockBean
private ProductItemStockService productItemStockService;

@MockBean
private MaterialStockService materialStockService;

Expand Down
68 changes: 54 additions & 14 deletions frontend/src/views/StockView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
SPDX-License-Identifier: Apache-2.0
-->
<template>
<main class="flex flex-col">
<main class="flex flex-col mb-7">
<h1 class="w-full text-center bold text-5xl mb-6 pb-6">
View and Manage Stocks
</h1>

<div>
<div class="divide-y-4">
<form
@submit.prevent="addOrUpdateStock(this.changedStock)"
class="flex flex-row"
>
<!-- First Column -->
<div class="basis-1/3 mr-28 flex flex-col">
<div class="basis-1/2 mr-28 flex flex-col">
<div class="flex flex-row justify-start space-x-3">
<div class="space-x-2">
<input
Expand Down Expand Up @@ -73,9 +73,9 @@
/>
</div>
<div>
<label for="allocatedToPartner"
>Allocated to Partner</label
>
<label for="allocatedToPartner">
Allocated to Partner
</label>
<select
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="allocatedToPartner"
Expand Down Expand Up @@ -126,7 +126,7 @@
</div>

<!-- Second Column -->
<div class="basis-1/3 flex flex-col justify-end">
<div class="basis-1/2 flex flex-col justify-end">
<div>
<input
type="checkbox"
Expand All @@ -138,9 +138,9 @@
<label for="isBlocked">Is Blocked </label>
</div>
<div>
<label for="stockLocationBPNS"
>Stock Location BPNS</label
>
<label for="stockLocationBPNS">
Stock Location BPNS
</label>
<select
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="stockLocationBPNS"
Expand All @@ -156,9 +156,9 @@
</select>
</div>
<div>
<label for="stockLocationBPNA"
>Stock Location BPNA</label
>
<label for="stockLocationBPNA">
Stock Location BPNA
</label>
<select
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="stockLocationBPNA"
Expand All @@ -176,6 +176,41 @@
</option>
</select>
</div>
<div class="flex flex-row justify-between">
<div class="grow mr-4">
<label for="customerOrderNumber">
Customer Order Number
</label>
<input
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="customerOrderNumber"
v-model="this.changedStock.customerOrderNumber"
/>
</div>
<div class="grow">
<label for="customerOrderPositionNumber">
Customer Order Position Number
</label>
<input
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="customerOrderPositionNumber"
v-model="
this.changedStock
.customerOrderPositionNumber
"
/>
</div>
</div>
<div>
<label for="supplierOrderNumber">
Supplier Order Number
</label>
<input
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="supplierOrderNumber"
v-model="this.changedStock.supplierOrderNumber"
/>
</div>
<!-- Empty div -->
<div style="height: 54.5px"></div>
</div>
Expand All @@ -184,16 +219,18 @@
<!-- separator -->
<div
id="materialAndProductStockTables"
class="flex flex-col space-y-2 max-w-max"
class="flex flex-col space-y-2 max-w-max divide-y-4"
>
<StockTableSFC
title="Material Stocks"
:stocks="this.bdMaterialStocks"
:ownRole="'customer'"
:partnerRole="'supplier'"
/>
<StockTableSFC
title="Product Stocks"
:stocks="this.bdProductStocks"
:ownRole="'supplier'"
:partnerRole="'customer'"
/>
</div>
Expand Down Expand Up @@ -238,6 +275,9 @@ export default {
isBlocked: false,
bpns: "",
bpna: "",
customerOrderNumber: "",
customerOrderPositionNumber: "",
supplierOrderNumber: "",
},
site: {
bpns: "BPNS12345678910ZZZ",
Expand Down
Loading

0 comments on commit 8c1ded5

Please sign in to comment.