Merged PR 1311: #3263 WA Details API calls angepasst

#3263 WA Details API calls angepasst

Related work items: #3263
This commit is contained in:
Andreas Schickinger
2022-07-06 14:48:37 +00:00
committed by Lorenz Hilpert
parent 2c98128531
commit 732566eacd
5 changed files with 25 additions and 14 deletions

View File

@@ -23,7 +23,7 @@ export class DomainGoodsService {
return this.abholfachService.AbholfachWarenausgabeAutocomplete(autocompleteToken);
}
getItemByOrderNumber(orderNumber: string) {
getWareneingangItemByOrderNumber(orderNumber: string) {
return this.abholfachService.AbholfachWareneingang({
filter: { all_branches: 'true', archive: 'true' },
input: {
@@ -32,8 +32,17 @@ export class DomainGoodsService {
});
}
getItemByCompartment(compartmentCode: string) {
return this.abholfachService.AbholfachWareneingang({
getWarenausgabeItemByOrderNumber(orderNumber: string) {
return this.abholfachService.AbholfachWarenausgabe({
filter: { all_branches: 'true', archive: 'true' },
input: {
qs: orderNumber,
},
});
}
getWarenausgabeItemByCompartment(compartmentCode: string) {
return this.abholfachService.AbholfachWarenausgabe({
filter: { all_branches: 'true', archive: 'true' },
input: {
qs: compartmentCode,
@@ -41,7 +50,7 @@ export class DomainGoodsService {
});
}
getItemByCustomerNumber(customerNumber: string) {
getWareneingangItemByCustomerNumber(customerNumber: string) {
// Suche anhand der Kundennummer mit Status Bestellt, nachbestellt, eingetroffen, weitergeleitet intern
return this.abholfachService.AbholfachWareneingang({
filter: { orderitemprocessingstatus: '16;128;8192;1048576' },

View File

@@ -139,7 +139,7 @@ export class GoodsInDetailsComponent extends ComponentStore<GoodsInDetailsCompon
debounceTime(500),
withLatestFrom(this.orderNumber$, this.selectedOrderItemId$, this.processingStatus$),
switchMap(([_, orderNumber, selectedOrderItemId, processingStatus]) =>
this._domainGoodsInService.getItemByOrderNumber(orderNumber).pipe(
this._domainGoodsInService.getWareneingangItemByOrderNumber(orderNumber).pipe(
tapResponse(
(res) => {
this.patchState({
@@ -170,7 +170,7 @@ export class GoodsInDetailsComponent extends ComponentStore<GoodsInDetailsCompon
debounceTime(200),
withLatestFrom(this.customerNumber$),
switchMap(([_, customerNumber]) =>
this._domainGoodsInService.getItemByCustomerNumber(customerNumber).pipe(
this._domainGoodsInService.getWareneingangItemByCustomerNumber(customerNumber).pipe(
tapResponse(
(res) => {
this.patchState({

View File

@@ -17,10 +17,12 @@ export class GoodsInEditComponent implements OnInit {
map((params) => decodeURIComponent(params.orderNumber ?? '') || undefined)
);
items$ = this.orderNumber$.pipe(switchMap((orderNumber) => this._domainGoodsInService.getItemByOrderNumber(orderNumber))).pipe(
map((response) => response.result),
shareReplay()
);
items$ = this.orderNumber$
.pipe(switchMap((orderNumber) => this._domainGoodsInService.getWareneingangItemByOrderNumber(orderNumber)))
.pipe(
map((response) => response.result),
shareReplay()
);
constructor(
private _activatedRoute: ActivatedRoute,

View File

@@ -126,9 +126,9 @@ export class GoodsOutDetailsComponent extends ComponentStore<GoodsOutDetailsComp
switchMap(([_, orderNumber, compartmentCode, processingStatus]) => {
let request$: Observable<ListResponseArgsOfOrderItemListItemDTO>;
if (compartmentCode) {
request$ = this._domainGoodsInService.getItemByCompartment(compartmentCode);
request$ = this._domainGoodsInService.getWarenausgabeItemByCompartment(compartmentCode);
} else {
request$ = this._domainGoodsInService.getItemByOrderNumber(orderNumber);
request$ = this._domainGoodsInService.getWarenausgabeItemByOrderNumber(orderNumber);
}
return request$.pipe(

View File

@@ -31,8 +31,8 @@ export class GoodsOutEditComponent implements OnInit {
items$ = combineLatest([this.orderNumber$, this.compartmentCode$]).pipe(
switchMap(([orderNumber, compartmentCode]) =>
compartmentCode
? this._domainGoodsInService.getItemByCompartment(compartmentCode)
: this._domainGoodsInService.getItemByOrderNumber(orderNumber)
? this._domainGoodsInService.getWarenausgabeItemByCompartment(compartmentCode)
: this._domainGoodsInService.getWarenausgabeItemByOrderNumber(orderNumber)
),
withLatestFrom(this.processingStatus$),
map(([response, processingStatus]) => response.result.filter((item) => item.processingStatus === +processingStatus)),