Merged PR 828: #2166 Update Remi and Cat Swagger, Domain Services and Reservation Result List

#2166 Update Remi and Cat Swagger, Domain Services and Reservation Result List
This commit is contained in:
Nino Righi
2021-09-14 07:29:07 +00:00
committed by Andreas Schickinger
parent c4a5f21869
commit 0883012a67
40 changed files with 1938 additions and 1649 deletions

View File

@@ -3,11 +3,13 @@ import { ItemDTO } from '@swagger/cat';
import { AvailabilityDTO, BranchDTO, OLAAvailabilityDTO, StoreCheckoutService, SupplierDTO } from '@swagger/checkout';
import { Observable } from 'rxjs';
import { AvailabilityService as SwaggerAvailabilityService } from '@swagger/availability';
import { map, shareReplay, switchMap, withLatestFrom, mergeMap } from 'rxjs/operators';
import { map, shareReplay, switchMap, withLatestFrom, mergeMap, toArray } from 'rxjs/operators';
import { isArray, memorize } from '@utils/common';
import { OrderService } from '@swagger/oms';
import { RemiService, StockDTO } from '@swagger/remi';
import { RemiService, ResponseArgsOfIEnumerableOfStockInfoDTO, StockDTO, StockInfoDTO, StockService } from '@swagger/remi';
import { ItemData } from './defs/item-data.model';
import { PriceDTO } from '@swagger/availability';
import { AvailabilityByBranchDTO } from './defs/availability-by-branch-dto.model';
@Injectable()
export class DomainAvailabilityService {
@@ -15,7 +17,8 @@ export class DomainAvailabilityService {
private swaggerAvailabilityService: SwaggerAvailabilityService,
private storeCheckoutService: StoreCheckoutService,
private orderService: OrderService,
private remi: RemiService
private remi: RemiService,
private _stock: StockService
) {}
@memorize()
@@ -50,42 +53,79 @@ export class DomainAvailabilityService {
);
}
// TODO: Stock-Aufruf aus Remi API
@memorize({ ttl: 10000 })
getTakeAwayAvailability({
item,
getTakeAwayAvailabilityByBranches({
branchIds,
itemId,
price,
quantity,
byEan = false,
}: {
item: ItemData;
branchIds: number[];
itemId: number;
price: PriceDTO;
quantity: number;
byEan?: boolean;
}): Observable<AvailabilityDTO> {
}): Observable<AvailabilityByBranchDTO[]> {
return this._stock.StockStockRequest({ stockRequest: { branchIds, itemId } }).pipe(
map((response) => response.result),
withLatestFrom(this.getTakeAwaySupplier()),
map(([result, supplier]) => {
const availabilities: AvailabilityByBranchDTO[] = result.map((stockInfo) => {
return {
availabilityType: quantity <= stockInfo.inStock ? 1024 : 1, // 1024 (=Available)
inStock: stockInfo.inStock,
ssc: quantity <= stockInfo.inStock ? '999' : '',
sscText: quantity <= stockInfo.inStock ? 'Filialentnahme' : '',
price,
supplier: { id: supplier?.id },
branchId: stockInfo.branchId,
};
});
return availabilities;
}),
shareReplay()
);
}
getTakeAwayAvailability({ item, quantity }: { item: ItemData; quantity: number }): Observable<AvailabilityDTO> {
return this.getCurrentStock().pipe(
switchMap((s) =>
byEan
? this.remi.RemiInStockByEAN({ eans: [item.ean], stockId: s.id })
: this.remi.RemiInStock({ articleIds: [item.itemId], stockId: s.id })
),
switchMap((s) => this._stock.StockInStock({ articleIds: [item.itemId], stockId: s.id })),
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
map(([response, supplier, branch]) => {
const stockInfo = response.result.find((si) => si.branchId === branch.id);
const inStock = stockInfo?.inStock ?? 0;
const availability: AvailabilityDTO = {
availabilityType: quantity <= inStock ? 1024 : 1, // 1024 (=Available)
inStock: inStock,
ssc: quantity <= inStock ? '999' : '',
sscText: quantity <= inStock ? 'Filialentnahme' : '',
price: item?.price,
supplier: { id: supplier?.id },
};
return availability;
const price = item?.price;
return this._mapToTakeAwayAvailability({ response, supplier, branch, quantity, price });
}),
shareReplay()
);
}
getTakeAwayAvailabilityByEan({
eans,
price,
quantity,
}: {
eans: string[];
price: PriceDTO;
quantity: number;
}): Observable<AvailabilityDTO> {
return this.getCurrentStock().pipe(
switchMap((s) => this._stock.StockInStockByEAN({ eans, stockId: s.id })),
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
map(([response, supplier, branch]) => {
return this._mapToTakeAwayAvailability({ response, supplier, branch, quantity, price });
}),
shareReplay()
);
}
getTakeAwayAvailabilitiesByEans({ eans }: { eans: string[] }): Observable<StockInfoDTO[]> {
const eansFiltered = Array.from(new Set(eans));
return this.getCurrentStock().pipe(
switchMap((s) => this._stock.StockInStockByEAN({ eans: eansFiltered, stockId: s.id })),
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
map((response) => response[0].result),
shareReplay()
);
}
@memorize({ ttl: 10000 })
getPickUpAvailability({ item, branch, quantity }: { item: ItemData; quantity: number; branch: BranchDTO }): Observable<AvailabilityDTO> {
return this.swaggerAvailabilityService
@@ -283,4 +323,30 @@ export class DomainAvailabilityService {
supplierProductNumber: availability?.supplierProductNumber,
};
}
private _mapToTakeAwayAvailability({
response,
supplier,
branch,
quantity,
price,
}: {
response: ResponseArgsOfIEnumerableOfStockInfoDTO;
supplier: SupplierDTO;
branch: BranchDTO;
quantity: number;
price: PriceDTO;
}): AvailabilityDTO {
const stockInfo = response.result.find((si) => si.branchId === branch.id);
const inStock = stockInfo?.inStock ?? 0;
const availability: AvailabilityDTO = {
availabilityType: quantity <= inStock ? 1024 : 1, // 1024 (=Available)
inStock: inStock,
ssc: quantity <= inStock ? '999' : '',
sscText: quantity <= inStock ? 'Filialentnahme' : '',
price,
supplier: { id: supplier?.id },
};
return availability;
}
}

View File

@@ -0,0 +1,6 @@
import { AvailabilityDTO } from '@swagger/checkout';
export interface AvailabilityByBranchDTO extends AvailabilityDTO {
stockId?: number;
branchId: number;
}

View File

@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { ApplicationService } from '@core/application';
import { AutocompleteTokenDTO, PromotionService, QueryTokenDTO, SearchService, StockService } from '@swagger/cat';
import { AutocompleteTokenDTO, PromotionService, QueryTokenDTO, SearchService } from '@swagger/cat';
import { memorize } from '@utils/common';
import { map, shareReplay } from 'rxjs/operators';
@@ -9,8 +9,7 @@ export class DomainCatalogService {
constructor(
private searchService: SearchService,
private promotionService: PromotionService,
private applicationService: ApplicationService,
private stockService: StockService
private applicationService: ApplicationService
) {}
@memorize()
@@ -110,11 +109,4 @@ export class DomainCatalogService {
sessionId: this.applicationService.activatedProcessId + '',
});
}
getInStock({ branchIds, itemIds }: { branchIds: number[]; itemIds: number[] }) {
return this.stockService.StockInStock({
branchIds,
itemIds,
});
}
}

View File

@@ -67,11 +67,7 @@ export class DomainGoodsService {
return this.abholfachService.AbholfachAbholfachbereinigungsliste();
}
goodsInReservationList() {
const queryToken: QueryTokenDTO = {
skip: 0,
take: 20,
};
goodsInReservationList(queryToken: QueryTokenDTO) {
return this.abholfachService.AbholfachReservierungen(queryToken);
}
}

View File

@@ -8,12 +8,13 @@ import { Mapper } from '../mappings/mapper';
import { RemissionFilter } from '../models/remission-filter';
import { RemissionProduct } from '../models/remission-product';
import { isNumber } from 'util';
import { RemiService, ReturnItemDTO, ReturnSuggestionDTO, KeyValueDTOOfStringAndString, ReturnService } from '@swagger/remi';
import { RemiService, ReturnItemDTO, ReturnSuggestionDTO, KeyValueDTOOfStringAndString, ReturnService, StockService } from '@swagger/remi';
@Injectable({ providedIn: 'root' })
export class RestRemissionProductsService {
constructor(
private remiService: RemiService,
private _stock: StockService,
private returnService: ReturnService,
private restFilterService: RestFilterService,
private mapping: MappingService
@@ -202,8 +203,8 @@ export class RestRemissionProductsService {
flatMap((result) =>
!result.items.length
? of({ items: [], completed: true })
: this.remiService
.RemiInStock({
: this._stock
.StockInStock({
stockId,
articleIds:
result.items &&

View File

@@ -6,7 +6,6 @@ import { UiModalRef } from '@ui/modal';
import { combineLatest } from 'rxjs';
import { filter, map, switchMap, tap } from 'rxjs/operators';
import { geoDistance } from '@utils/common';
import { DomainCatalogService } from '@domain/catalog';
import { BehaviorSubject } from 'rxjs';
@Component({
@@ -40,8 +39,14 @@ export class ModalAvailabilitiesComponent {
inStock$ = this.branches$.pipe(
switchMap((branches) =>
this.domainCatalogService.getInStock({ branchIds: branches.map((b) => b.id), itemIds: [this.item.id] }).pipe(map((res) => res.result))
)
this.domainAvailabilityService.getTakeAwayAvailabilityByBranches({
branchIds: branches.map((b) => b.id),
itemId: this.item.id,
price: this.item?.catalogAvailability?.price,
quantity: 1,
})
),
map((res) => res)
);
availabilities$ = combineLatest([this.inStock$, this.branches$, this.search$]).pipe(
@@ -60,11 +65,7 @@ export class ModalAvailabilitiesComponent {
tap(() => this.fetching$.next(false))
);
constructor(
private modalRef: UiModalRef<void, { item: ItemDTO }>,
private domainAvailabilityService: DomainAvailabilityService,
private domainCatalogService: DomainCatalogService
) {}
constructor(private modalRef: UiModalRef<void, { item: ItemDTO }>, private domainAvailabilityService: DomainAvailabilityService) {}
filter(query: string) {
this.search$.next(query);

View File

@@ -74,10 +74,10 @@ export class GoodsInListReorderModalComponent extends ComponentStore<GoodsInList
readonly takeAwayAvailability$ = this.orderItem$.pipe(
switchMap((item) =>
this.domainAvailabilityService
.getTakeAwayAvailability({
item: { ean: item.product.ean, itemId: +item.product.catalogProductNumber, price: item.retailPrice },
.getTakeAwayAvailabilityByEan({
eans: [item.product.ean],
quantity: item.quantity,
byEan: true,
price: item.retailPrice,
})
.pipe(
catchError(() => {

View File

@@ -8,7 +8,7 @@
<div class="hits">{{ hits$ | async }} Titel</div>
</div>
<div class="scroll-container">
<div class="scroll-container" uiScrollContainer (reachEnd)="loadMore()" [deltaEnd]="150">
<shared-goods-in-out-order-group *ngFor="let bueryNumberGroup of items$ | async | groupBy: byBuyerNumberFn">
<ng-container *ngFor="let orderNumberGroup of bueryNumberGroup.items | groupBy: byOrderNumberFn; let lastOrderNumber = last">
<ng-container
@@ -23,7 +23,7 @@
[showCompartmentCode]="firstItem"
(selectedChange)="setSelectedItem(item, $event)"
[selectable]="true"
[showInStock]="true"
[showInStock]="takeAwayAvailabilities$ | async"
(click)="navigateToDetails(item)"
[quantityEditable]="item.overallQuantity > 1 && (selectedOrderItemSubsetIds$ | async)?.includes(item.orderItemSubsetId)"
></shared-goods-in-out-order-group-item>

View File

@@ -25,6 +25,8 @@ export class GoodsInReservationComponent implements OnInit, OnDestroy, AfterView
loading$ = this._store.loading$;
takeAwayAvailabilities$ = this._store.takeAwayAvailabilities$.pipe(shareReplay());
selectedOrderItemSubsetIds$ = this._store.selectedOrderItemSubsetIds$;
actions$ = combineLatest([this.items$, this.selectedOrderItemSubsetIds$]).pipe(
@@ -119,6 +121,12 @@ export class GoodsInReservationComponent implements OnInit, OnDestroy, AfterView
this._store.search();
}
async loadMore() {
if (this._store.hits > this._store.results.length && !this._store.loading) {
this._store.search();
}
}
viewChildrenChanged() {
this.anyItemsSelected$ = combineLatest(this.listItems.map((listItem) => listItem.selected$)).pipe(
map((selected) => selected.find((s) => s)),

View File

@@ -1,8 +1,9 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { DomainAvailabilityService } from '@domain/availability';
import { DomainGoodsService } from '@domain/oms';
import { ComponentStore, tapResponse } from '@ngrx/component-store';
import { ListResponseArgsOfOrderItemListItemDTO, OrderItemListItemDTO } from '@swagger/oms';
import { ListResponseArgsOfOrderItemListItemDTO, OrderItemListItemDTO, QueryTokenDTO } from '@swagger/oms';
import { isResponseArgs } from '@utils/object';
import { Subject } from 'rxjs';
import { switchMap, tap, withLatestFrom } from 'rxjs/operators';
@@ -41,7 +42,14 @@ export class GoodsInReservationStore extends ComponentStore<GoodsInReservationSt
readonly searchResult$ = this._searchResultSubject.asObservable();
constructor(private _domainGoodsInService: DomainGoodsService) {
readonly takeAwayAvailabilities$ = this.results$.pipe(
switchMap((items) => {
const eans = items.map((item) => item?.product?.ean);
return this._availabilityService.getTakeAwayAvailabilitiesByEans({ eans });
})
);
constructor(private _domainGoodsInService: DomainGoodsService, private _availabilityService: DomainAvailabilityService) {
super({
loading: false,
hits: 0,
@@ -58,12 +66,12 @@ export class GoodsInReservationStore extends ComponentStore<GoodsInReservationSt
this.searchRequest().pipe(
tapResponse(
(res) => {
const results = [...(_results ?? []), ...(res.result ?? [])];
this.patchState({
hits: res.hits,
results: res.result ?? [],
results,
loading: false,
});
this._searchResultSubject.next(res);
},
(err: Error) => {
@@ -94,6 +102,10 @@ export class GoodsInReservationStore extends ComponentStore<GoodsInReservationSt
}
searchRequest() {
return this._domainGoodsInService.goodsInReservationList();
const queryToken: QueryTokenDTO = {
skip: this.results.length,
take: 20,
};
return this._domainGoodsInService.goodsInReservationList(queryToken);
}
}

View File

@@ -12,7 +12,6 @@ export * from './modal-confirmation.service';
export * from './module-switcher.service';
export * from './order.service';
export * from './printer.service';
export * from './product-availability.service';
export * from './product-util.service';
export * from './recommandation.service';
export * from './sso-configuration.service';

View File

@@ -1,7 +1,7 @@
import { TestBed } from '@angular/core/testing';
// import { TestBed } from '@angular/core/testing';
import { ProductAvailabilityService } from './product-availability.service';
// import { ProductAvailabilityService } from './product-availability.service';
describe('ProductAvailabilityService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
});
// describe('ProductAvailabilityService', () => {
// beforeEach(() => TestBed.configureTestingModule({}));
// });

View File

@@ -1,223 +1,224 @@
import { Injectable } from '@angular/core';
import { StockRequest, StockInfoDTO, ItemDTO, StockService } from '@swagger/cat';
import { AvailabilityRequestDTO, AvailabilityDTO, ResponseArgsOfIEnumerableOfAvailabilityDTO } from '@swagger/availability';
import { map, catchError, switchMap, shareReplay } from 'rxjs/operators';
import { Observable, of } from 'rxjs';
import { CheckoutType } from '../models/checkout-type.enum';
import { AvailabilityService } from '@swagger/availability';
import { OrderService } from '@swagger/oms';
import { LogisticianDTO } from '@swagger/checkout';
// import { Injectable } from '@angular/core';
// import { StockRequest, StockInfoDTO, ItemDTO, StockService } from '@swagger/cat';
// import { AvailabilityRequestDTO, AvailabilityDTO, ResponseArgsOfIEnumerableOfAvailabilityDTO } from '@swagger/availability';
// import { map, catchError, switchMap, shareReplay } from 'rxjs/operators';
// import { Observable, of } from 'rxjs';
// import { CheckoutType } from '../models/checkout-type.enum';
// import { AvailabilityService } from '@swagger/availability';
// import { OrderService } from '@swagger/oms';
// import { LogisticianDTO } from '@swagger/checkout';
@Injectable({
providedIn: 'root',
})
export class ProductAvailabilityService {
constructor(private availabilityService: AvailabilityService, private stockService: StockService, private orderService: OrderService) {}
// @Injectable({
// providedIn: 'root',
// })
// export class ProductAvailabilityService {
// constructor(private availabilityService: AvailabilityService, private stockService: StockService, private orderService: OrderService) {}
private cache = new Map<string, { fetchedAt: number; data: any }>();
// private cache = new Map<string, { fetchedAt: number; data: any }>();
getCache(args: any) {
const value = this.cache.get(JSON.stringify(args));
// getCache(args: any) {
// const value = this.cache.get(JSON.stringify(args));
if (value && value.fetchedAt > Date.now() - 60000) {
return value.data;
}
}
// if (value && value.fetchedAt > Date.now() - 60000) {
// return value.data;
// }
// }
setCache(args: any, data: any) {
this.cache.set(JSON.stringify(args), { fetchedAt: Date.now(), data });
}
// setCache(args: any, data: any) {
// this.cache.set(JSON.stringify(args), { fetchedAt: Date.now(), data });
// }
availabilityStoreAvailability(params: AvailabilityRequestDTO[]): Observable<ResponseArgsOfIEnumerableOfAvailabilityDTO> {
const cached = this.getCache(params);
if (cached) {
return cached;
}
const request$ = this.availabilityService.AvailabilityStoreAvailability(params).pipe(shareReplay());
this.setCache(params, request$);
return request$;
}
// availabilityStoreAvailability(params: AvailabilityRequestDTO[]): Observable<ResponseArgsOfIEnumerableOfAvailabilityDTO> {
// const cached = this.getCache(params);
// if (cached) {
// return cached;
// }
// const request$ = this.availabilityService.AvailabilityStoreAvailability(params).pipe(shareReplay());
// this.setCache(params, request$);
// return request$;
// }
getStoreAvailability(
item: ItemDTO,
ean: string,
branchNumber: number,
quantity: number = 1
): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] }> {
const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
const params = [
<AvailabilityRequestDTO>{
itemId: item.id.toString(),
ean: ean,
shopId: branchNumber,
qty: quantity,
price: price,
},
];
return this.availabilityStoreAvailability(params).pipe(
map((response) => {
if (response.error) {
console.error(response.message);
}
return { branchId: branchNumber, type: CheckoutType.store, av: response.result };
})
);
}
// getStoreAvailability(
// item: ItemDTO,
// ean: string,
// branchNumber: number,
// quantity: number = 1
// ): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] }> {
// const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
// const params = [
// <AvailabilityRequestDTO>{
// itemId: item.id.toString(),
// ean: ean,
// shopId: branchNumber,
// qty: quantity,
// price: price,
// },
// ];
// return this.availabilityStoreAvailability(params).pipe(
// map((response) => {
// if (response.error) {
// console.error(response.message);
// }
// return { branchId: branchNumber, type: CheckoutType.store, av: response.result };
// })
// );
// }
getShippingAvailability(
item: ItemDTO,
ean: string,
branchNumber: number,
quantity: number = 1
): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] }> {
const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
const params = [
<AvailabilityRequestDTO>{
itemId: item.id.toString(),
ean: ean,
qty: quantity,
price: price,
},
];
return this.availabilityService.AvailabilityShippingAvailability(params).pipe(
map((response) => {
if (response.error) {
console.error(response.message);
}
return { branchId: branchNumber, type: CheckoutType.delivery, av: response.result };
})
);
}
// getShippingAvailability(
// item: ItemDTO,
// ean: string,
// branchNumber: number,
// quantity: number = 1
// ): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] }> {
// const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
// const params = [
// <AvailabilityRequestDTO>{
// itemId: item.id.toString(),
// ean: ean,
// qty: quantity,
// price: price,
// },
// ];
// return this.availabilityService.AvailabilityShippingAvailability(params).pipe(
// map((response) => {
// if (response.error) {
// console.error(response.message);
// }
// return { branchId: branchNumber, type: CheckoutType.delivery, av: response.result };
// })
// );
// }
getStockInfo(branchIds: number[], itemIds: number[]): Observable<StockInfoDTO[]> {
const params = <StockRequest>{
branchIds,
itemIds,
};
return this.stockService.StockInStock(params).pipe(
map((response) => {
if (response.error) {
throw new Error(response.message);
}
return response.result;
})
);
}
// getStockInfo(branchIds: number[], itemIds: number[]): Observable<StockInfoDTO[]> {
// const params = <StockRequest>{
// branchIds,
// itemIds,
// };
// // TODO: Implementation of new Request
// return this.stockService.StockInStock(params).pipe(
// map((response) => {
// if (response.error) {
// throw new Error(response.message);
// }
// return response.result;
// })
// );
// }
getStoreAvailabilityWithCheck(
item: ItemDTO,
ean: string,
branchNumber: number,
quantity: number = 1
): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] } | { error: boolean; message: string; type: CheckoutType }> {
const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
const params = [
<AvailabilityRequestDTO>{
itemId: item.id.toString(),
ean: ean,
shopId: branchNumber,
qty: quantity,
price: price,
},
];
return this.availabilityStoreAvailability(params).pipe(
catchError((error) => {
return of({ error: error, message: error.message, type: CheckoutType.store });
}),
map((response) => {
if (response.error) {
console.error(response.message);
return { error: response.error, message: response.message, type: CheckoutType.store };
}
const succesResp = response as ResponseArgsOfIEnumerableOfAvailabilityDTO;
return { branchId: branchNumber, type: CheckoutType.store, av: succesResp.result };
})
);
}
// getStoreAvailabilityWithCheck(
// item: ItemDTO,
// ean: string,
// branchNumber: number,
// quantity: number = 1
// ): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] } | { error: boolean; message: string; type: CheckoutType }> {
// const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
// const params = [
// <AvailabilityRequestDTO>{
// itemId: item.id.toString(),
// ean: ean,
// shopId: branchNumber,
// qty: quantity,
// price: price,
// },
// ];
// return this.availabilityStoreAvailability(params).pipe(
// catchError((error) => {
// return of({ error: error, message: error.message, type: CheckoutType.store });
// }),
// map((response) => {
// if (response.error) {
// console.error(response.message);
// return { error: response.error, message: response.message, type: CheckoutType.store };
// }
// const succesResp = response as ResponseArgsOfIEnumerableOfAvailabilityDTO;
// return { branchId: branchNumber, type: CheckoutType.store, av: succesResp.result };
// })
// );
// }
getShippingB2BAvailability(
item: ItemDTO,
ean: string,
branchNumber: number,
quantity: number = 1
): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] }> {
const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
const params = [
<AvailabilityRequestDTO>{
itemId: item.id.toString(),
ean: ean,
shopId: branchNumber,
qty: quantity,
price: price,
},
];
// getShippingB2BAvailability(
// item: ItemDTO,
// ean: string,
// branchNumber: number,
// quantity: number = 1
// ): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] }> {
// const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
// const params = [
// <AvailabilityRequestDTO>{
// itemId: item.id.toString(),
// ean: ean,
// shopId: branchNumber,
// qty: quantity,
// price: price,
// },
// ];
return this.availabilityStoreAvailability(params)
.pipe(
switchMap((response) =>
this.orderService.OrderGetLogisticians({}).pipe(
map((logisticians) => logisticians.result.filter((l) => l.logisticianNumber === '2470')[0]),
map((logistician) => [response, logistician] as [ResponseArgsOfIEnumerableOfAvailabilityDTO, LogisticianDTO])
)
)
)
.pipe(
map(([availabilityDTO, logistician]) => {
if (availabilityDTO.error) {
console.error(availabilityDTO.message);
}
// return this.availabilityStoreAvailability(params)
// .pipe(
// switchMap((response) =>
// this.orderService.OrderGetLogisticians({}).pipe(
// map((logisticians) => logisticians.result.filter((l) => l.logisticianNumber === '2470')[0]),
// map((logistician) => [response, logistician] as [ResponseArgsOfIEnumerableOfAvailabilityDTO, LogisticianDTO])
// )
// )
// )
// .pipe(
// map(([availabilityDTO, logistician]) => {
// if (availabilityDTO.error) {
// console.error(availabilityDTO.message);
// }
return {
branchId: branchNumber,
type: CheckoutType.deliveryB2b,
av: availabilityDTO.result?.map((av) => {
let at = undefined;
const deliveryDate = new Date(av.at);
if (new Date().getHours() >= 16) {
deliveryDate.setDate(deliveryDate.getDate() + 2);
} else {
deliveryDate.setDate(deliveryDate.getDate() + 1);
}
at = deliveryDate.toJSON();
// return {
// branchId: branchNumber,
// type: CheckoutType.deliveryB2b,
// av: availabilityDTO.result?.map((av) => {
// let at = undefined;
// const deliveryDate = new Date(av.at);
// if (new Date().getHours() >= 16) {
// deliveryDate.setDate(deliveryDate.getDate() + 2);
// } else {
// deliveryDate.setDate(deliveryDate.getDate() + 1);
// }
// at = deliveryDate.toJSON();
return {
...av,
at,
logisticianId: logistician.id,
} as AvailabilityDTO;
}),
};
})
);
}
// return {
// ...av,
// at,
// logisticianId: logistician.id,
// } as AvailabilityDTO;
// }),
// };
// })
// );
// }
getShippingAvailabilityWithCheck(
item: ItemDTO,
ean: string,
branchNumber: number,
quantity: number = 1
): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] } | { error: boolean; message: string; type: CheckoutType }> {
const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
const params = [
<AvailabilityRequestDTO>{
itemId: item.id.toString(),
ean: ean,
qty: quantity,
price: price,
},
];
return this.availabilityService.AvailabilityShippingAvailability(params).pipe(
catchError((error) => {
return of({ error: error, message: error.message, type: CheckoutType.delivery });
}),
map((response) => {
if (response.error) {
console.error(response.message);
return { error: response.error, message: response.message, type: CheckoutType.delivery };
}
const succesResp = response as ResponseArgsOfIEnumerableOfAvailabilityDTO;
return { branchId: branchNumber, type: CheckoutType.delivery, av: succesResp.result };
})
);
}
}
// getShippingAvailabilityWithCheck(
// item: ItemDTO,
// ean: string,
// branchNumber: number,
// quantity: number = 1
// ): Observable<{ branchId: number; type: CheckoutType; av: AvailabilityDTO[] } | { error: boolean; message: string; type: CheckoutType }> {
// const price = item.catalogAvailability && item.catalogAvailability.price ? item.catalogAvailability.price : undefined;
// const params = [
// <AvailabilityRequestDTO>{
// itemId: item.id.toString(),
// ean: ean,
// qty: quantity,
// price: price,
// },
// ];
// return this.availabilityService.AvailabilityShippingAvailability(params).pipe(
// catchError((error) => {
// return of({ error: error, message: error.message, type: CheckoutType.delivery });
// }),
// map((response) => {
// if (response.error) {
// console.error(response.message);
// return { error: response.error, message: response.message, type: CheckoutType.delivery };
// }
// const succesResp = response as ResponseArgsOfIEnumerableOfAvailabilityDTO;
// return { branchId: branchNumber, type: CheckoutType.delivery, av: succesResp.result };
// })
// );
// }
// }

View File

@@ -72,7 +72,9 @@
</ng-template>
</div>
<div class="extended-informations">
<div *ngIf="showInStock" class="item-stock"><ui-icon icon="home" size="1.25rem"></ui-icon> <span>99 x</span></div>
<div *ngIf="showInStock" class="item-stock">
<ui-icon icon="home" size="1.25rem"></ui-icon> <span>{{ getInStock(item?.product?.ean) }} x</span>
</div>
<div class="item-data-selector">
<ui-select-bullet *ngIf="selectable" [ngModel]="selected" (ngModelChange)="setSelected($event)"></ui-select-bullet>
</div>

View File

@@ -1,6 +1,7 @@
import { EventEmitter } from '@angular/core';
import { Component, ChangeDetectionStrategy, Input, Output } from '@angular/core';
import { ComponentStore } from '@ngrx/component-store';
import { StockInfoDTO } from '@swagger/remi';
import { OrderItemListItemDTO } from '@swagger/oms';
import { isEqual } from 'lodash';
import { map } from 'rxjs/operators';
@@ -77,7 +78,7 @@ export class GoodsInOutOrderGroupItemComponent extends ComponentStore<GoodsInOut
showSupplier: boolean;
@Input()
showInStock: boolean;
showInStock: StockInfoDTO[];
constructor() {
super({
@@ -87,6 +88,19 @@ export class GoodsInOutOrderGroupItemComponent extends ComponentStore<GoodsInOut
});
}
getInStock(ean: string): number {
if (!ean) {
return 0;
}
const stockInfo = this.showInStock.find((stock) => stock.ean === ean);
if (stockInfo) {
return stockInfo.inStock - stockInfo.removedFromStock;
} else {
return 0;
}
}
setSelected(selected: boolean) {
this.selected = selected;
this.selectedChange.emit(selected);

View File

@@ -5,7 +5,6 @@ import { CatConfiguration, CatConfigurationInterface } from './cat-configuration
import { PromotionService } from './services/promotion.service';
import { SearchService } from './services/search.service';
import { StockService } from './services/stock.service';
/**
* Provider for all Cat services, plus CatConfiguration
@@ -21,8 +20,7 @@ import { StockService } from './services/stock.service';
providers: [
CatConfiguration,
PromotionService,
SearchService,
StockService
SearchService
],
})
export class CatModule {

View File

@@ -27,6 +27,7 @@ export { KeyValueDTOOfStringAndString } from './models/key-value-dtoof-string-an
export { ReviewDTO } from './models/review-dto';
export { EntityDTO } from './models/entity-dto';
export { EntityStatus } from './models/entity-status';
export { TouchedBase } from './models/touched-base';
export { QueryTokenDTO } from './models/query-token-dto';
export { CatalogType } from './models/catalog-type';
export { QueryTokenDTO2 } from './models/query-token-dto2';
@@ -38,14 +39,13 @@ export { AutocompleteTokenDTO } from './models/autocomplete-token-dto';
export { ResponseArgsOfItemDTO } from './models/response-args-of-item-dto';
export { ResponseArgsOfUISettingsDTO } from './models/response-args-of-uisettings-dto';
export { UISettingsDTO } from './models/uisettings-dto';
export { TranslationDTO } from './models/translation-dto';
export { QuerySettingsDTO } from './models/query-settings-dto';
export { InputGroupDTO } from './models/input-group-dto';
export { InputDTO } from './models/input-dto';
export { InputType } from './models/input-type';
export { InputOptionsDTO } from './models/input-options-dto';
export { OptionDTO } from './models/option-dto';
export { TranslationDTO } from './models/translation-dto';
export { ResponseArgsOfIEnumerableOfInputGroupDTO } from './models/response-args-of-ienumerable-of-input-group-dto';
export { ResponseArgsOfIEnumerableOfOrderByDTO } from './models/response-args-of-ienumerable-of-order-by-dto';
export { ResponseArgsOfIEnumerableOfQueryTokenDTO } from './models/response-args-of-ienumerable-of-query-token-dto';
export { ResponseArgsOfIEnumerableOfStockInfoDTO } from './models/response-args-of-ienumerable-of-stock-info-dto';
export { StockRequest } from './models/stock-request';

View File

@@ -1,6 +1,7 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
import { EntityStatus } from './entity-status';
export interface EntityDTO {
export interface EntityDTO extends TouchedBase{
changed?: string;
created?: string;
id?: number;

View File

@@ -0,0 +1,8 @@
/* tslint:disable */
import { InputGroupDTO } from './input-group-dto';
import { OrderByDTO } from './order-by-dto';
export interface QuerySettingsDTO {
filter?: Array<InputGroupDTO>;
input?: Array<InputGroupDTO>;
orderBy?: Array<OrderByDTO>;
}

View File

@@ -8,6 +8,11 @@ export interface QueryTokenDTO extends QueryTokenDTO2{
*/
catalogType?: CatalogType;
/**
* Anfragen werden nicht getrackt
*/
doNotTrack?: boolean;
/**
* Lagerdaten
*/

View File

@@ -1,6 +0,0 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { StockInfoDTO } from './stock-info-dto';
export interface ResponseArgsOfIEnumerableOfStockInfoDTO extends ResponseArgs{
result?: Array<StockInfoDTO>;
}

View File

@@ -4,6 +4,14 @@
* Regalinfo
*/
export interface ShelfInfoDTO {
/**
* Sortiment
*/
assortment?: string;
/**
* Bezeichner
*/
label?: string;
}

View File

@@ -1,5 +0,0 @@
/* tslint:disable */
export interface StockRequest {
branchIds?: Array<number>;
itemIds?: Array<number>;
}

View File

@@ -0,0 +1,3 @@
/* tslint:disable */
export interface TouchedBase {
}

View File

@@ -1,12 +1,20 @@
/* tslint:disable */
import { InputGroupDTO } from './input-group-dto';
import { OrderByDTO } from './order-by-dto';
import { QuerySettingsDTO } from './query-settings-dto';
import { TranslationDTO } from './translation-dto';
export interface UISettingsDTO {
filter?: Array<InputGroupDTO>;
export interface UISettingsDTO extends QuerySettingsDTO{
/**
* Url Template für Detail-Bild
*/
imageUrl?: string;
input?: Array<InputGroupDTO>;
orderBy?: Array<OrderByDTO>;
/**
* Url Template für Teaser-Bild
*/
thumbnailImageUrl?: string;
/**
* Übersetzungen
*/
translations?: Array<TranslationDTO>;
}

View File

@@ -1,3 +1,2 @@
export { PromotionService } from './services/promotion.service';
export { SearchService } from './services/search.service';
export { StockService } from './services/stock.service';

View File

@@ -543,6 +543,8 @@ class SearchService extends __BaseService {
* - `stockId`:
*
* - `id`:
*
* - `doNotTrack`:
*/
SearchDetailResponse(params: SearchService.SearchDetailParams): __Observable<__StrictHttpResponse<ResponseArgsOfItemDTO>> {
let __params = this.newParams();
@@ -550,6 +552,7 @@ class SearchService extends __BaseService {
let __body: any = null;
if (params.doNotTrack != null) __params = __params.set('doNotTrack', params.doNotTrack.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/${encodeURIComponent(String(params.id))}`,
@@ -573,6 +576,8 @@ class SearchService extends __BaseService {
* - `stockId`:
*
* - `id`:
*
* - `doNotTrack`:
*/
SearchDetail(params: SearchService.SearchDetailParams): __Observable<ResponseArgsOfItemDTO> {
return this.SearchDetailResponse(params).pipe(
@@ -586,6 +591,8 @@ class SearchService extends __BaseService {
* - `stockId`:
*
* - `id`:
*
* - `doNotTrack`:
*/
SearchDetail2Response(params: SearchService.SearchDetail2Params): __Observable<__StrictHttpResponse<ResponseArgsOfItemDTO>> {
let __params = this.newParams();
@@ -593,6 +600,7 @@ class SearchService extends __BaseService {
let __body: any = null;
if (params.doNotTrack != null) __params = __params.set('doNotTrack', params.doNotTrack.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/${encodeURIComponent(String(params.id))}`,
@@ -616,6 +624,8 @@ class SearchService extends __BaseService {
* - `stockId`:
*
* - `id`:
*
* - `doNotTrack`:
*/
SearchDetail2(params: SearchService.SearchDetail2Params): __Observable<ResponseArgsOfItemDTO> {
return this.SearchDetail2Response(params).pipe(
@@ -961,6 +971,7 @@ module SearchService {
export interface SearchDetailParams {
stockId: null | number;
id: number;
doNotTrack?: boolean;
}
/**
@@ -969,6 +980,7 @@ module SearchService {
export interface SearchDetail2Params {
stockId: null | number;
id: number;
doNotTrack?: boolean;
}
/**

View File

@@ -1,63 +0,0 @@
/* tslint:disable */
import { Injectable } from '@angular/core';
import { HttpClient, HttpRequest, HttpResponse, HttpHeaders } from '@angular/common/http';
import { BaseService as __BaseService } from '../base-service';
import { CatConfiguration as __Configuration } from '../cat-configuration';
import { StrictHttpResponse as __StrictHttpResponse } from '../strict-http-response';
import { Observable as __Observable } from 'rxjs';
import { map as __map, filter as __filter } from 'rxjs/operators';
import { ResponseArgsOfIEnumerableOfStockInfoDTO } from '../models/response-args-of-ienumerable-of-stock-info-dto';
import { StockRequest } from '../models/stock-request';
@Injectable({
providedIn: 'root',
})
class StockService extends __BaseService {
static readonly StockInStockPath = '/stock/instock';
constructor(
config: __Configuration,
http: HttpClient
) {
super(config, http);
}
/**
* @param stockRequest undefined
*/
StockInStockResponse(stockRequest: StockRequest): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = stockRequest;
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/stock/instock`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>;
})
);
}
/**
* @param stockRequest undefined
*/
StockInStock(stockRequest: StockRequest): __Observable<ResponseArgsOfIEnumerableOfStockInfoDTO> {
return this.StockInStockResponse(stockRequest).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfStockInfoDTO)
);
}
}
module StockService {
}
export { StockService }

View File

@@ -125,6 +125,8 @@ export { ImpedimentDTO } from './models/impediment-dto';
export { EntityDTOOfReturnItemDTOAndIReturnItem } from './models/entity-dtoof-return-item-dtoand-ireturn-item';
export { ReadOnlyEntityDTOOfReturnItemDTOAndIReturnItem } from './models/read-only-entity-dtoof-return-item-dtoand-ireturn-item';
export { RemiQueryTokenDTO } from './models/remi-query-token-dto';
export { QueryTokenDTO } from './models/query-token-dto';
export { OrderByDTO } from './models/order-by-dto';
export { BatchResponseArgsOfReturnItemDTOAndReturnItemDTO } from './models/batch-response-args-of-return-item-dtoand-return-item-dto';
export { KeyValuePairOfReturnItemDTOAndReturnItemDTO } from './models/key-value-pair-of-return-item-dtoand-return-item-dto';
export { IResultOfReturnItemDTO } from './models/iresult-of-return-item-dto';
@@ -149,8 +151,6 @@ export { KeyValueDTOOfStringAndString } from './models/key-value-dtoof-string-an
export { ResponseArgsOfIEnumerableOfValueTupleOfStringAndIntegerAndIntegerAndNullableIntegerAndString } from './models/response-args-of-ienumerable-of-value-tuple-of-string-and-integer-and-integer-and-nullable-integer-and-string';
export { ValueTupleOfStringAndIntegerAndIntegerAndNullableIntegerAndString } from './models/value-tuple-of-string-and-integer-and-integer-and-nullable-integer-and-string';
export { CapacityRequest } from './models/capacity-request';
export { ResponseArgsOfIEnumerableOfStockInfoDTO } from './models/response-args-of-ienumerable-of-stock-info-dto';
export { StockInfoDTO } from './models/stock-info-dto';
export { ResponseArgsOfReturnItemDTO } from './models/response-args-of-return-item-dto';
export { ResponseArgsOfReceiptDTO } from './models/response-args-of-receipt-dto';
export { ReceiptFinalizeValues } from './models/receipt-finalize-values';
@@ -166,12 +166,15 @@ export { ValueTupleOfReceiptItemDTOAndReturnItemDTOAndReturnSuggestionDTOAndRetu
export { ResponseArgsOfIEnumerableOfReturnDTO } from './models/response-args-of-ienumerable-of-return-dto';
export { ImpedimentValues } from './models/impediment-values';
export { ResponseArgsOfReturnSuggestionDTO } from './models/response-args-of-return-suggestion-dto';
export { QueryTokenDTO } from './models/query-token-dto';
export { OrderByDTO } from './models/order-by-dto';
export { ListResponseArgsOfReturnDTO } from './models/list-response-args-of-return-dto';
export { ReturnQueryTokenDTO } from './models/return-query-token-dto';
export { ResponseArgsOfIEnumerableOfReceiptDTO } from './models/response-args-of-ienumerable-of-receipt-dto';
export { ResponseArgsOfReceiptItemDTO } from './models/response-args-of-receipt-item-dto';
export { ResponseArgsOfIEnumerableOfStockInfoDTO } from './models/response-args-of-ienumerable-of-stock-info-dto';
export { StockInfoDTO } from './models/stock-info-dto';
export { StockRequestValues } from './models/stock-request-values';
export { ResponseArgsOfIEnumerableOfReturnInfoDTO } from './models/response-args-of-ienumerable-of-return-info-dto';
export { ReturnInfoDTO } from './models/return-info-dto';
export { ResponseArgsOfIEnumerableOfStockDTO } from './models/response-args-of-ienumerable-of-stock-dto';
export { ResponseArgsOfIEnumerableOfSupplierDTO } from './models/response-args-of-ienumerable-of-supplier-dto';
export { ResponseArgsOfIEnumerableOfStockEntryDTO } from './models/response-args-of-ienumerable-of-stock-entry-dto';

View File

@@ -1,13 +1,14 @@
/* tslint:disable */
export interface RemiQueryTokenDTO {
filter?: {[key: string]: string};
friendlyName?: string;
fuzzy?: number;
hitsOnly?: boolean;
ids?: Array<number>;
input?: {[key: string]: string};
skip?: number;
import { QueryTokenDTO } from './query-token-dto';
export interface RemiQueryTokenDTO extends QueryTokenDTO{
/**
* Lager PK
*/
stockId: number;
/**
* Lieferant PK
*/
supplierId: number;
take?: number;
}

View File

@@ -0,0 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { ReturnInfoDTO } from './return-info-dto';
export interface ResponseArgsOfIEnumerableOfReturnInfoDTO extends ResponseArgs{
result?: Array<ReturnInfoDTO>;
}

View File

@@ -0,0 +1,27 @@
/* tslint:disable */
/**
* Remissionsinfo
*/
export interface ReturnInfoDTO {
/**
* EAN
*/
ean?: string;
/**
* Bestand
*/
inStock?: number;
/**
* Artikel PK
*/
itemId?: number;
/**
* Zu remittieren
*/
return: boolean;
}

View File

@@ -1,9 +1,42 @@
/* tslint:disable */
/**
* Bestandsinformation
*/
export interface StockInfoDTO {
/**
* Filiale PK
*/
branchId?: number;
/**
* Fach / Kammer
*/
compartment?: string;
/**
* EAN
*/
ean?: string;
/**
* Lagerbestand
*/
inStock?: number;
/**
* Artikel PK
*/
itemId?: number;
/**
* Bereits aus dem Bestand genommen
*/
removedFromStock?: number;
/**
* Lager PK
*/
stockId?: number;
}

View File

@@ -0,0 +1,17 @@
/* tslint:disable */
/**
* Lagerabfrage
*/
export interface StockRequestValues {
/**
* Filial PKs
*/
branchIds?: Array<number>;
/**
* Artikel PKs
*/
itemId: number;
}

View File

@@ -142,7 +142,7 @@ class PackageService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PUT',
this.rootUrl + `/inventory/package/${encodeURIComponent(params.packageId)}`,
this.rootUrl + `/inventory/package/${encodeURIComponent(String(params.packageId))}`,
__body,
{
headers: __headers,
@@ -190,7 +190,7 @@ class PackageService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PATCH',
this.rootUrl + `/inventory/package/${encodeURIComponent(params.packageId)}`,
this.rootUrl + `/inventory/package/${encodeURIComponent(String(params.packageId))}`,
__body,
{
headers: __headers,
@@ -235,7 +235,7 @@ class PackageService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/inventory/package/${encodeURIComponent(params.packageId)}`,
this.rootUrl + `/inventory/package/${encodeURIComponent(String(params.packageId))}`,
__body,
{
headers: __headers,

View File

@@ -21,7 +21,6 @@ import { ResponseArgsOfIEnumerableOfInputDTO } from '../models/response-args-of-
import { ResponseArgsOfIEnumerableOfKeyValueDTOOfStringAndString } from '../models/response-args-of-ienumerable-of-key-value-dtoof-string-and-string';
import { ResponseArgsOfIEnumerableOfValueTupleOfStringAndIntegerAndIntegerAndNullableIntegerAndString } from '../models/response-args-of-ienumerable-of-value-tuple-of-string-and-integer-and-integer-and-nullable-integer-and-string';
import { CapacityRequest } from '../models/capacity-request';
import { ResponseArgsOfIEnumerableOfStockInfoDTO } from '../models/response-args-of-ienumerable-of-stock-info-dto';
@Injectable({
providedIn: 'root',
})
@@ -38,8 +37,6 @@ class RemiService extends __BaseService {
static readonly RemiGetUeberlaufFilterPath = '/remi/stock/{stockId}/ueberlauf/filter';
static readonly RemiProductgroupsPath = '/remi/stock/{stockId}/productgroup';
static readonly RemiGetRequiredCapacitiesPath = '/remi/stock/{stockId}/ueberlauf/required-capacity';
static readonly RemiInStockPath = '/remi/stock/{stockId}/instock';
static readonly RemiInStockByEANPath = '/remi/stock/{stockId}/instockbyean';
constructor(
config: __Configuration,
@@ -229,7 +226,7 @@ class RemiService extends __BaseService {
if (params.department != null) __params = __params.set('department', params.department.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/remi/stock/${encodeURIComponent(params.stockId)}/nullgutschriften`,
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/nullgutschriften`,
__body,
{
headers: __headers,
@@ -369,7 +366,7 @@ class RemiService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/remi/stock/${encodeURIComponent(params.stockId)}/filter`,
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/filter`,
__body,
{
headers: __headers,
@@ -419,7 +416,7 @@ class RemiService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/remi/stock/${encodeURIComponent(params.stockId)}/pflichtremission/filter`,
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/pflichtremission/filter`,
__body,
{
headers: __headers,
@@ -469,7 +466,7 @@ class RemiService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/remi/stock/${encodeURIComponent(params.stockId)}/ueberlauf/filter`,
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/ueberlauf/filter`,
__body,
{
headers: __headers,
@@ -516,7 +513,7 @@ class RemiService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/remi/stock/${encodeURIComponent(params.stockId)}/productgroup`,
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/productgroup`,
__body,
{
headers: __headers,
@@ -564,7 +561,7 @@ class RemiService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/remi/stock/${encodeURIComponent(params.stockId)}/ueberlauf/required-capacity`,
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/ueberlauf/required-capacity`,
__body,
{
headers: __headers,
@@ -594,106 +591,6 @@ class RemiService extends __BaseService {
__map(_r => _r.body as ResponseArgsOfIEnumerableOfValueTupleOfStringAndIntegerAndIntegerAndNullableIntegerAndString)
);
}
/**
* Lagerbestandsabfrage
* @param params The `RemiService.RemiInStockParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `articleIds`: Artikel PKs
*
* - `locale`: Lokalisierung (optional)
*/
RemiInStockResponse(params: RemiService.RemiInStockParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = params.articleIds;
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/remi/stock/${encodeURIComponent(params.stockId)}/instock`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>;
})
);
}
/**
* Lagerbestandsabfrage
* @param params The `RemiService.RemiInStockParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `articleIds`: Artikel PKs
*
* - `locale`: Lokalisierung (optional)
*/
RemiInStock(params: RemiService.RemiInStockParams): __Observable<ResponseArgsOfIEnumerableOfStockInfoDTO> {
return this.RemiInStockResponse(params).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfStockInfoDTO)
);
}
/**
* Lagerbestandsabfrage
* @param params The `RemiService.RemiInStockByEANParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `eans`: EANs
*
* - `locale`: Lokalisierung (optional)
*/
RemiInStockByEANResponse(params: RemiService.RemiInStockByEANParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = params.eans;
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/remi/stock/${encodeURIComponent(params.stockId)}/instockbyean`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>;
})
);
}
/**
* Lagerbestandsabfrage
* @param params The `RemiService.RemiInStockByEANParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `eans`: EANs
*
* - `locale`: Lokalisierung (optional)
*/
RemiInStockByEAN(params: RemiService.RemiInStockByEANParams): __Observable<ResponseArgsOfIEnumerableOfStockInfoDTO> {
return this.RemiInStockByEANResponse(params).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfStockInfoDTO)
);
}
}
module RemiService {
@@ -882,48 +779,6 @@ module RemiService {
*/
locale?: null | string;
}
/**
* Parameters for RemiInStock
*/
export interface RemiInStockParams {
/**
* Lager PK
*/
stockId: number;
/**
* Artikel PKs
*/
articleIds: Array<number>;
/**
* Lokalisierung (optional)
*/
locale?: null | string;
}
/**
* Parameters for RemiInStockByEAN
*/
export interface RemiInStockByEANParams {
/**
* Lager PK
*/
stockId: number;
/**
* EANs
*/
eans: Array<string>;
/**
* Lokalisierung (optional)
*/
locale?: null | string;
}
}
export { RemiService }

View File

@@ -139,7 +139,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt`,
__body,
{
headers: __headers,
@@ -187,7 +187,7 @@ class ReturnService extends __BaseService {
if (params.eagerLoading != null) __params = __params.set('eagerLoading', params.eagerLoading.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt`,
__body,
{
headers: __headers,
@@ -238,7 +238,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PATCH',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/finalize`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/finalize`,
__body,
{
headers: __headers,
@@ -285,7 +285,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PATCH',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/finalize`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/finalize`,
__body,
{
headers: __headers,
@@ -329,7 +329,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/remi/return/${encodeURIComponent(params.returnId)}/transfer-to-bookhit`,
this.rootUrl + `/remi/return/${encodeURIComponent(String(params.returnId))}/transfer-to-bookhit`,
__body,
{
headers: __headers,
@@ -379,7 +379,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/addreturnitem`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/addreturnitem`,
__body,
{
headers: __headers,
@@ -432,7 +432,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/addreturnsuggestion`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/addreturnsuggestion`,
__body,
{
headers: __headers,
@@ -485,7 +485,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/items/${encodeURIComponent(params.receiptItemId)}`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/items/${encodeURIComponent(String(params.receiptItemId))}`,
__body,
{
headers: __headers,
@@ -535,7 +535,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/cancel`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/cancel`,
__body,
{
headers: __headers,
@@ -580,7 +580,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/return/reasons`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/return/reasons`,
__body,
{
headers: __headers,
@@ -669,7 +669,7 @@ class ReturnService extends __BaseService {
if (params.eagerLoading != null) __params = __params.set('eagerLoading', params.eagerLoading.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}`,
__body,
{
headers: __headers,
@@ -714,7 +714,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/cancel`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/cancel`,
__body,
{
headers: __headers,
@@ -757,7 +757,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PATCH',
this.rootUrl + `/inventory/returngroup/${encodeURIComponent(params.returnGroup)}/finalize`,
this.rootUrl + `/inventory/returngroup/${encodeURIComponent(String(params.returnGroup))}/finalize`,
__body,
{
headers: __headers,
@@ -803,7 +803,7 @@ class ReturnService extends __BaseService {
if (params.eagerLoading != null) __params = __params.set('eagerLoading', params.eagerLoading.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/return/item/${encodeURIComponent(params.itemId)}`,
this.rootUrl + `/inventory/return/item/${encodeURIComponent(String(params.itemId))}`,
__body,
{
headers: __headers,
@@ -848,7 +848,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/inventory/return/item/${encodeURIComponent(params.itemId)}`,
this.rootUrl + `/inventory/return/item/${encodeURIComponent(String(params.itemId))}`,
__body,
{
headers: __headers,
@@ -894,7 +894,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PATCH',
this.rootUrl + `/inventory/return/item/${encodeURIComponent(params.itemId)}/impediment`,
this.rootUrl + `/inventory/return/item/${encodeURIComponent(String(params.itemId))}/impediment`,
__body,
{
headers: __headers,
@@ -985,7 +985,7 @@ class ReturnService extends __BaseService {
if (params.eagerLoading != null) __params = __params.set('eagerLoading', params.eagerLoading.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/return/suggestion/${encodeURIComponent(params.itemId)}`,
this.rootUrl + `/inventory/return/suggestion/${encodeURIComponent(String(params.itemId))}`,
__body,
{
headers: __headers,
@@ -1033,7 +1033,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PATCH',
this.rootUrl + `/inventory/return/suggestion/${encodeURIComponent(params.itemId)}/impediment`,
this.rootUrl + `/inventory/return/suggestion/${encodeURIComponent(String(params.itemId))}/impediment`,
__body,
{
headers: __headers,
@@ -1081,7 +1081,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/return/item`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/return/item`,
__body,
{
headers: __headers,
@@ -1129,7 +1129,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/return/suggestion`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/return/suggestion`,
__body,
{
headers: __headers,
@@ -1177,7 +1177,7 @@ class ReturnService extends __BaseService {
if (params.department != null) __params = __params.set('department', params.department.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/return/suggestion`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/return/suggestion`,
__body,
{
headers: __headers,
@@ -1222,7 +1222,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/inventory/return/suggestion/${encodeURIComponent(params.suggestionId)}`,
this.rootUrl + `/inventory/return/suggestion/${encodeURIComponent(String(params.suggestionId))}`,
__body,
{
headers: __headers,
@@ -1265,7 +1265,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/return/uncompleted`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/return/uncompleted`,
__body,
{
headers: __headers,
@@ -1311,7 +1311,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/return`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/return`,
__body,
{
headers: __headers,
@@ -1362,7 +1362,7 @@ class ReturnService extends __BaseService {
if (params.eagerLoading != null) __params = __params.set('eagerLoading', params.eagerLoading.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}`,
__body,
{
headers: __headers,
@@ -1415,7 +1415,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/item`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/item`,
__body,
{
headers: __headers,
@@ -1471,7 +1471,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PUT',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/item/${encodeURIComponent(params.receiptItemId)}`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/item/${encodeURIComponent(String(params.receiptItemId))}`,
__body,
{
headers: __headers,
@@ -1529,7 +1529,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'PATCH',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/item/${encodeURIComponent(params.receiptItemId)}`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/item/${encodeURIComponent(String(params.receiptItemId))}`,
__body,
{
headers: __headers,
@@ -1584,7 +1584,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'DELETE',
this.rootUrl + `/inventory/return/${encodeURIComponent(params.returnId)}/receipt/${encodeURIComponent(params.receiptId)}/item/${encodeURIComponent(params.receiptItemId)}`,
this.rootUrl + `/inventory/return/${encodeURIComponent(String(params.returnId))}/receipt/${encodeURIComponent(String(params.receiptId))}/item/${encodeURIComponent(String(params.receiptItemId))}`,
__body,
{
headers: __headers,
@@ -1634,7 +1634,7 @@ class ReturnService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/receipt/${encodeURIComponent(params.receiptType)}/uncompleted`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/receipt/${encodeURIComponent(String(params.receiptType))}/uncompleted`,
__body,
{
headers: __headers,

View File

@@ -7,6 +7,9 @@ import { StrictHttpResponse as __StrictHttpResponse } from '../strict-http-respo
import { Observable as __Observable } from 'rxjs';
import { map as __map, filter as __filter } from 'rxjs/operators';
import { ResponseArgsOfIEnumerableOfStockInfoDTO } from '../models/response-args-of-ienumerable-of-stock-info-dto';
import { StockRequestValues } from '../models/stock-request-values';
import { ResponseArgsOfIEnumerableOfReturnInfoDTO } from '../models/response-args-of-ienumerable-of-return-info-dto';
import { ResponseArgsOfIEnumerableOfStockDTO } from '../models/response-args-of-ienumerable-of-stock-dto';
import { ResponseArgsOfIEnumerableOfSupplierDTO } from '../models/response-args-of-ienumerable-of-supplier-dto';
import { ResponseArgsOfIEnumerableOfStockEntryDTO } from '../models/response-args-of-ienumerable-of-stock-entry-dto';
@@ -17,6 +20,10 @@ import { ResponseArgsOfIEnumerableOfStockReservationDTO } from '../models/respon
providedIn: 'root',
})
class StockService extends __BaseService {
static readonly StockInStockPath = '/remi/stock/{stockId}/instock';
static readonly StockStockRequestPath = '/remi/stock/instock';
static readonly StockCheckItemsForReturnPath = '/remi/stock/{stockId}/checkitemsforreturn';
static readonly StockInStockByEANPath = '/remi/stock/{stockId}/instockbyean';
static readonly StockGetStocksByBranchPath = '/inventory/branch/{branchId}/stock';
static readonly StockGetStocksPath = '/inventory/stock';
static readonly StockGetSuppliersPath = '/inventory/supplier';
@@ -32,6 +39,201 @@ class StockService extends __BaseService {
super(config, http);
}
/**
* Lagerbestandsabfrage
* @param params The `StockService.StockInStockParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `articleIds`: Artikel PKs
*
* - `locale`: Lokalisierung (optional)
*/
StockInStockResponse(params: StockService.StockInStockParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = params.articleIds;
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/instock`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>;
})
);
}
/**
* Lagerbestandsabfrage
* @param params The `StockService.StockInStockParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `articleIds`: Artikel PKs
*
* - `locale`: Lokalisierung (optional)
*/
StockInStock(params: StockService.StockInStockParams): __Observable<ResponseArgsOfIEnumerableOfStockInfoDTO> {
return this.StockInStockResponse(params).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfStockInfoDTO)
);
}
/**
* Lagerbestandsabfrage
* @param params The `StockService.StockStockRequestParams` containing the following parameters:
*
* - `stockRequest`: Abfragedaten
*
* - `locale`: Lokalisierung (optional)
*/
StockStockRequestResponse(params: StockService.StockStockRequestParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = params.stockRequest;
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/remi/stock/instock`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>;
})
);
}
/**
* Lagerbestandsabfrage
* @param params The `StockService.StockStockRequestParams` containing the following parameters:
*
* - `stockRequest`: Abfragedaten
*
* - `locale`: Lokalisierung (optional)
*/
StockStockRequest(params: StockService.StockStockRequestParams): __Observable<ResponseArgsOfIEnumerableOfStockInfoDTO> {
return this.StockStockRequestResponse(params).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfStockInfoDTO)
);
}
/**
* Lagerbestandsabfrage
* @param params The `StockService.StockCheckItemsForReturnParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `eans`: EANs
*
* - `locale`: Lokalisierung (optional)
*/
StockCheckItemsForReturnResponse(params: StockService.StockCheckItemsForReturnParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfReturnInfoDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = params.eans;
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/checkitemsforreturn`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfReturnInfoDTO>;
})
);
}
/**
* Lagerbestandsabfrage
* @param params The `StockService.StockCheckItemsForReturnParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `eans`: EANs
*
* - `locale`: Lokalisierung (optional)
*/
StockCheckItemsForReturn(params: StockService.StockCheckItemsForReturnParams): __Observable<ResponseArgsOfIEnumerableOfReturnInfoDTO> {
return this.StockCheckItemsForReturnResponse(params).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfReturnInfoDTO)
);
}
/**
* Lagerbestandsabfrage
* @param params The `StockService.StockInStockByEANParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `eans`: EANs
*
* - `locale`: Lokalisierung (optional)
*/
StockInStockByEANResponse(params: StockService.StockInStockByEANParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = params.eans;
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/remi/stock/${encodeURIComponent(String(params.stockId))}/instockbyean`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>;
})
);
}
/**
* Lagerbestandsabfrage
* @param params The `StockService.StockInStockByEANParams` containing the following parameters:
*
* - `stockId`: Lager PK
*
* - `eans`: EANs
*
* - `locale`: Lokalisierung (optional)
*/
StockInStockByEAN(params: StockService.StockInStockByEANParams): __Observable<ResponseArgsOfIEnumerableOfStockInfoDTO> {
return this.StockInStockByEANResponse(params).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfStockInfoDTO)
);
}
/**
* @param params The `StockService.StockGetStocksByBranchParams` containing the following parameters:
*
@@ -47,7 +249,7 @@ class StockService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/branch/${encodeURIComponent(params.branchId)}/stock`,
this.rootUrl + `/inventory/branch/${encodeURIComponent(String(params.branchId))}/stock`,
__body,
{
headers: __headers,
@@ -135,7 +337,7 @@ class StockService extends __BaseService {
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/stock/stockitem/${encodeURIComponent(stockItemId)}`,
this.rootUrl + `/inventory/stock/stockitem/${encodeURIComponent(String(stockItemId))}`,
__body,
{
headers: __headers,
@@ -208,7 +410,7 @@ class StockService extends __BaseService {
if (params.itemId != null) __params = __params.set('itemId', params.itemId.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/order`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/order`,
__body,
{
headers: __headers,
@@ -251,7 +453,7 @@ class StockService extends __BaseService {
if (params.itemId != null) __params = __params.set('itemId', params.itemId.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/reservation`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/reservation`,
__body,
{
headers: __headers,
@@ -282,6 +484,85 @@ class StockService extends __BaseService {
module StockService {
/**
* Parameters for StockInStock
*/
export interface StockInStockParams {
/**
* Lager PK
*/
stockId: number;
/**
* Artikel PKs
*/
articleIds: Array<number>;
/**
* Lokalisierung (optional)
*/
locale?: null | string;
}
/**
* Parameters for StockStockRequest
*/
export interface StockStockRequestParams {
/**
* Abfragedaten
*/
stockRequest: StockRequestValues;
/**
* Lokalisierung (optional)
*/
locale?: null | string;
}
/**
* Parameters for StockCheckItemsForReturn
*/
export interface StockCheckItemsForReturnParams {
/**
* Lager PK
*/
stockId: number;
/**
* EANs
*/
eans: Array<string>;
/**
* Lokalisierung (optional)
*/
locale?: null | string;
}
/**
* Parameters for StockInStockByEAN
*/
export interface StockInStockByEANParams {
/**
* Lager PK
*/
stockId: number;
/**
* EANs
*/
eans: Array<string>;
/**
* Lokalisierung (optional)
*/
locale?: null | string;
}
/**
* Parameters for StockGetStocksByBranch
*/

View File

@@ -42,7 +42,7 @@ class SupplierService extends __BaseService {
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/inventory/stock/${encodeURIComponent(params.stockId)}/supplier`,
this.rootUrl + `/inventory/stock/${encodeURIComponent(String(params.stockId))}/supplier`,
__body,
{
headers: __headers,