mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 861: #2211 Reservieren in andere Filiale - Stockabfrage mit Branch
#2211 Reservieren in andere Filiale - Stockabfrage mit Branch Related work items: #2211
This commit is contained in:
committed by
Lorenz Hilpert
parent
33173f88f3
commit
19539da8aa
@@ -97,6 +97,27 @@ export class DomainAvailabilityService {
|
||||
);
|
||||
}
|
||||
|
||||
@memorize({ ttl: 10000 })
|
||||
getTakeAwayAvailabilityByBranch({
|
||||
branch,
|
||||
itemId,
|
||||
price,
|
||||
quantity,
|
||||
}: {
|
||||
branch: BranchDTO;
|
||||
itemId: number;
|
||||
price: PriceDTO;
|
||||
quantity: number;
|
||||
}): Observable<AvailabilityDTO> {
|
||||
return this._stock.StockStockRequest({ stockRequest: { branchIds: [branch.id], itemId } }).pipe(
|
||||
withLatestFrom(this.getTakeAwaySupplier()),
|
||||
map(([response, supplier]) => {
|
||||
return this._mapToTakeAwayAvailability({ response, supplier, branch, quantity, price });
|
||||
}),
|
||||
shareReplay()
|
||||
);
|
||||
}
|
||||
|
||||
getTakeAwayAvailabilityByEan({
|
||||
eans,
|
||||
price,
|
||||
|
||||
@@ -374,9 +374,11 @@ export class PurchasingOptionsModalStore extends ComponentStore<PurchasingOption
|
||||
this.patchState({ fetchingAvailability: true });
|
||||
switch (option) {
|
||||
case 'take-away':
|
||||
availability$ = this.availabilityService.getTakeAwayAvailability({
|
||||
item: { itemId: item.id, ean: item.product.ean, price: item.catalogAvailability.price },
|
||||
availability$ = this.availabilityService.getTakeAwayAvailabilityByBranch({
|
||||
itemId: item.id,
|
||||
price: item.catalogAvailability.price,
|
||||
quantity,
|
||||
branch,
|
||||
});
|
||||
break;
|
||||
case 'pick-up':
|
||||
|
||||
Reference in New Issue
Block a user