mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1175: Merge release in develop
Merge release in develop Related work items: #2666, #2927, #2928, #2979, #2996
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
StoreCheckoutService,
|
||||
UpdateShoppingCartItemDTO,
|
||||
InputDTO,
|
||||
ItemPayload,
|
||||
} from '@swagger/checkout';
|
||||
import { DisplayOrderDTO, OrderCheckoutService, ReorderValues } from '@swagger/oms';
|
||||
import { isNullOrUndefined, memorize } from '@utils/common';
|
||||
@@ -186,37 +187,29 @@ export class DomainCheckoutService {
|
||||
);
|
||||
}
|
||||
|
||||
canAddItems({
|
||||
processId,
|
||||
availabilities,
|
||||
orderType,
|
||||
}: {
|
||||
processId: number;
|
||||
availabilities: OLAAvailabilityDTO[];
|
||||
orderType: string;
|
||||
}): Observable<true | string> {
|
||||
canAddItems({ processId, payload, orderType }: { processId: number; payload: ItemPayload[]; orderType: string }) {
|
||||
return this.getShoppingCart({ processId }).pipe(
|
||||
first(),
|
||||
withLatestFrom(this.store.select(DomainCheckoutSelectors.selectCustomerFeaturesByProcessId, { processId })),
|
||||
mergeMap(([shoppingCart, customerFeatures]) =>
|
||||
this.storeCheckoutService
|
||||
.StoreCheckoutCanAddItem({
|
||||
shoppingCartId: shoppingCart?.id,
|
||||
payload: {
|
||||
customerFeatures,
|
||||
availabilities,
|
||||
orderType,
|
||||
},
|
||||
mergeMap(([shoppingCart, customerFeatures]) => {
|
||||
payload = payload?.map((p) => {
|
||||
return {
|
||||
...p,
|
||||
customerFeatures,
|
||||
orderType,
|
||||
};
|
||||
});
|
||||
return this.storeCheckoutService
|
||||
.StoreCheckoutCanAddItems({
|
||||
shoppingCartId: shoppingCart.id,
|
||||
payload,
|
||||
})
|
||||
.pipe(
|
||||
map((response) => {
|
||||
if (response.result.ok) {
|
||||
return true;
|
||||
}
|
||||
return response.message;
|
||||
return response.result;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<p class="can-add-message" *ngIf="ref.data.canAddMessage">{{ ref.data.canAddMessage }}</p>
|
||||
|
||||
<div class="actions">
|
||||
<button (click)="continue()" class="cta cta-action-secondary">
|
||||
Weiter Einkaufen
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
.can-add-message {
|
||||
@apply text-center text-xl text-dark-goldenrod font-semibold;
|
||||
}
|
||||
|
||||
.actions {
|
||||
@apply flex flex-row justify-center items-center pb-4;
|
||||
|
||||
|
||||
@@ -236,6 +236,7 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy {
|
||||
this.loading$.next(true);
|
||||
const selectedItems = await this.selectedItems$.pipe(first()).toPromise();
|
||||
const items: AddToShoppingCartDTO[] = [];
|
||||
const canAddItemsPayload = [];
|
||||
|
||||
for (const item of selectedItems) {
|
||||
const isDownload = item?.product?.format === 'EB' || item?.product?.format === 'DL';
|
||||
@@ -255,11 +256,40 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy {
|
||||
|
||||
if (isDownload) {
|
||||
shoppingCartItem.destination = { data: { target: 16 } };
|
||||
canAddItemsPayload.push({
|
||||
availabilities: [{ ...item.catalogAvailability, format: 'DL' }],
|
||||
id: item.product.catalogProductNumber,
|
||||
});
|
||||
}
|
||||
|
||||
items.push(shoppingCartItem);
|
||||
}
|
||||
|
||||
if (canAddItemsPayload.length > 0) {
|
||||
try {
|
||||
const response = await this._checkoutService
|
||||
.canAddItems({
|
||||
processId: this.application.activatedProcessId,
|
||||
payload: canAddItemsPayload,
|
||||
orderType: 'Download',
|
||||
})
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
|
||||
if (response) {
|
||||
const cantAdd = (response as any)?.filter((r) => r.status >= 2);
|
||||
if (cantAdd?.length > 0) {
|
||||
this.openModal({ itemLength: cantAdd.length, canAddMessage: cantAdd[0].message });
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.openModal({ itemLength: selectedItems?.length, error });
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await this._checkoutService
|
||||
.addItemToShoppingCart({
|
||||
@@ -274,13 +304,14 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
openModal({ itemLength, error }: { itemLength: number; error?: Error }) {
|
||||
openModal({ itemLength, canAddMessage, error }: { itemLength: number; canAddMessage?: string; error?: Error }) {
|
||||
const modal = this._uiModal.open({
|
||||
title: !error
|
||||
? `${itemLength} Artikel ${itemLength > 1 ? 'wurden' : 'wurde'} in den Warenkorb gelegt`
|
||||
: `Artikel ${itemLength > 1 ? 'konnten' : 'konnte'} nicht in den Warenkorb gelegt werden`,
|
||||
title:
|
||||
!error && !canAddMessage
|
||||
? `${itemLength} Artikel ${itemLength > 1 ? 'wurden' : 'wurde'} in den Warenkorb gelegt`
|
||||
: `Artikel ${itemLength > 1 ? 'konnten' : 'konnte'} nicht in den Warenkorb gelegt werden`,
|
||||
content: !error ? AddedToCartModalComponent : UiErrorModalComponent,
|
||||
data: error ? error : {},
|
||||
data: error ? error : { canAddMessage },
|
||||
config: { showScrollbarY: false },
|
||||
});
|
||||
this.subscriptions.add(
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<div class="option-icon">
|
||||
<ui-icon class="truck-b2b" size="80px" icon="truck_b2b"></ui-icon>
|
||||
</div>
|
||||
<button
|
||||
class="option-chip"
|
||||
[disabled]="optionChipDisabled$ | async"
|
||||
(click)="optionChange('b2b-delivery')"
|
||||
[class.selected]="(selectedOption$ | async) === 'b2b-delivery'"
|
||||
>
|
||||
B2B-Versand
|
||||
</button>
|
||||
<p>Möchten Sie die Artikel<br />geliefert bekommen?</p>
|
||||
<p>Versandkostenfrei</p>
|
||||
@@ -1,23 +0,0 @@
|
||||
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { PurchasingOptionsListModalStore } from '../purchasing-options-list-modal.store';
|
||||
|
||||
@Component({
|
||||
selector: 'page-delivery-b2b-option-list',
|
||||
templateUrl: 'delivery-b2b-option-list.component.html',
|
||||
styleUrls: ['../list-options.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DeliveryB2bOptionListComponent {
|
||||
selectedOption$ = this._store.selectedFilterOption$;
|
||||
optionChipDisabled$ = this._store.fetchingAvailabilities$;
|
||||
|
||||
constructor(private _store: PurchasingOptionsListModalStore) {}
|
||||
|
||||
optionChange(option: string) {
|
||||
if (this._store.selectedFilterOption === option) {
|
||||
this._store.selectedFilterOption = undefined;
|
||||
} else {
|
||||
this._store.selectedFilterOption = option;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
// start:ng42.barrel
|
||||
export * from './delivery-b2b-option-list.component';
|
||||
// end:ng42.barrel
|
||||
@@ -26,6 +26,8 @@ export class PickUpOptionListComponent {
|
||||
}
|
||||
|
||||
async selectBranch(branch: BranchDTO) {
|
||||
this._store.lastSelectedFilterOption$.next(undefined);
|
||||
|
||||
this._store.selectedPickUpBranch = branch;
|
||||
|
||||
const shoppingCartItems = await this._store.shoppingCartItems$.pipe(first()).toPromise();
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
{{ item?.product?.name }}
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="canAdd$ | async; let canAdd">
|
||||
<div class="item-can-add" *ngIf="canAdd !== true">
|
||||
{{ canAdd }}
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div class="item-format">
|
||||
<img
|
||||
*ngIf="item?.product?.format !== '--'"
|
||||
@@ -59,6 +65,7 @@
|
||||
|
||||
<div class="item-select">
|
||||
<ui-select-bullet
|
||||
*ngIf="selectVisible$ | async"
|
||||
[disabled]="selectDisabled$ | async"
|
||||
[ngModel]="isSelected$ | async"
|
||||
(ngModelChange)="selected($event)"
|
||||
@@ -106,9 +113,3 @@
|
||||
</ng-template>
|
||||
</ng-template>
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="canAdd$ | async; let canAdd">
|
||||
<div class="item-can-add" *ngIf="canAdd !== true">
|
||||
{{ canAdd }}
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
grid-template-areas:
|
||||
'item-thumbnail item-contributors item-contributors'
|
||||
'item-thumbnail item-title item-price-stock'
|
||||
'item-thumbnail item-can-add item-price-stock'
|
||||
'item-thumbnail item-format item-price-stock'
|
||||
'item-thumbnail item-info item-select'
|
||||
'item-thumbnail item-date item-select'
|
||||
'item-thumbnail item-ssc item-select'
|
||||
'item-thumbnail item-availability item-select'
|
||||
'item-thumbnail item-can-add item-can-add';
|
||||
'item-thumbnail item-availability item-select';
|
||||
}
|
||||
|
||||
.item-thumbnail {
|
||||
@@ -152,7 +152,7 @@
|
||||
}
|
||||
|
||||
.item-can-add {
|
||||
@apply text-xl text-dark-goldenrod mt-2;
|
||||
@apply text-xl text-dark-goldenrod font-semibold;
|
||||
grid-area: item-can-add;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
}
|
||||
|
||||
.hint {
|
||||
@apply text-dark-goldenrod font-bold;
|
||||
@apply text-xl text-dark-goldenrod font-semibold;
|
||||
}
|
||||
|
||||
@screen desktop {
|
||||
|
||||
@@ -114,10 +114,7 @@ export class PurchasingOptionsListItemComponent {
|
||||
availability = pickUp;
|
||||
break;
|
||||
case 'delivery':
|
||||
availability = deliveryDig || delivery;
|
||||
break;
|
||||
case 'b2b-delivery':
|
||||
availability = deliveryB2b;
|
||||
availability = deliveryDig || delivery || deliveryB2b;
|
||||
break;
|
||||
default:
|
||||
return this.item.availability?.price;
|
||||
@@ -129,9 +126,53 @@ export class PurchasingOptionsListItemComponent {
|
||||
|
||||
selectDisabled$ = this._store.selectedFilterOption$.pipe(map((selectedFilterOption) => !selectedFilterOption));
|
||||
|
||||
selectVisible$ = combineLatest([this._store.canAdd$, this._store.selectedShoppingCartItems$]).pipe(
|
||||
withLatestFrom(
|
||||
this._store.selectedFilterOption$,
|
||||
this._store.deliveryAvailabilities$,
|
||||
this._store.deliveryDigAvailabilities$,
|
||||
this._store.deliveryB2bAvailabilities$,
|
||||
this._store.fetchingAvailabilities$
|
||||
),
|
||||
map(([[canAdd, items], option, delivery, deliveryDig, deliveryB2b, fetching]) => {
|
||||
if (!option || fetching) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Select immer sichtbar bei ausgewählten Items
|
||||
if (items?.find((item) => item.product?.catalogProductNumber === this.item.product?.catalogProductNumber)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Select nur anzeigen, wenn ein anderes ausgewähltes Item die gleiche Verfügbarkeit hat (B2B Versand z.B.)
|
||||
if (items?.length > 0 && option === 'delivery' && canAdd[this.item.product.catalogProductNumber]?.status < 2) {
|
||||
if (items.every((item) => delivery[item.product?.catalogProductNumber]) && delivery[this.item.product?.catalogProductNumber]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
items.every((item) => deliveryDig[item.product?.catalogProductNumber]) &&
|
||||
deliveryDig[this.item.product?.catalogProductNumber]
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
items.every((item) => deliveryB2b[item.product?.catalogProductNumber]) &&
|
||||
deliveryB2b[this.item.product?.catalogProductNumber]
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return canAdd && canAdd[this.item.product.catalogProductNumber]?.status < 2;
|
||||
})
|
||||
);
|
||||
|
||||
canAdd$ = this._store.canAdd$.pipe(
|
||||
filter((canAdd) => !!this.item && !!canAdd),
|
||||
map((canAdd) => canAdd[this.item.product.catalogProductNumber])
|
||||
map((canAdd) => canAdd[this.item.product.catalogProductNumber]?.message)
|
||||
);
|
||||
|
||||
quantityRange$ = combineLatest([this._store.selectedFilterOption$, this.takeAwayAvailabilities$]).pipe(
|
||||
@@ -142,10 +183,6 @@ export class PurchasingOptionsListItemComponent {
|
||||
|
||||
selected(value: boolean) {
|
||||
this._store.selectShoppingCartItem([this.item], value);
|
||||
|
||||
if (value) {
|
||||
this._store.checkCanAddItem(this.item);
|
||||
}
|
||||
}
|
||||
|
||||
changeQuantity(quantity: number) {
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
<div class="options">
|
||||
<page-take-away-option-list></page-take-away-option-list>
|
||||
<page-pick-up-option-list></page-pick-up-option-list>
|
||||
|
||||
<page-delivery-b2b-option-list *ngIf="b2bCustomer$ | async; else delivery"></page-delivery-b2b-option-list>
|
||||
<ng-template #delivery>
|
||||
<page-delivery-option-list></page-delivery-option-list>
|
||||
</ng-template>
|
||||
<page-delivery-option-list></page-delivery-option-list>
|
||||
</div>
|
||||
|
||||
<div class="items" *ngIf="shoppingCartItems$ | async; let shoppingCartItems">
|
||||
<div class="item-actions">
|
||||
<button
|
||||
*ngIf="!(allShoppingCartItemsSelected$ | async); else unselectAll"
|
||||
class="cta-select-all"
|
||||
[disabled]="selectAllCtaDisabled$ | async"
|
||||
(click)="selectAll(shoppingCartItems, true)"
|
||||
>
|
||||
Alle auswählen
|
||||
</button>
|
||||
|
||||
<ng-template #unselectAll>
|
||||
<button class="cta-select-all" [disabled]="selectAllCtaDisabled$ | async" (click)="selectAll(shoppingCartItems, false)">
|
||||
Alle abwählen
|
||||
<ng-container>
|
||||
<button
|
||||
*ngIf="!(allShoppingCartItemsSelected$ | async); else unselectAll"
|
||||
class="cta-select-all"
|
||||
[disabled]="selectAllCtaDisabled$ | async"
|
||||
(click)="selectAll(shoppingCartItems, true)"
|
||||
>
|
||||
Alle auswählen
|
||||
</button>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #unselectAll>
|
||||
<button class="cta-select-all" [disabled]="selectAllCtaDisabled$ | async" (click)="selectAll(shoppingCartItems, false)">
|
||||
Alle abwählen
|
||||
</button>
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
|
||||
<br />
|
||||
{{ (selectedShoppingCartItems$ | async)?.length || 0 }} von {{ shoppingCartItems?.length || 0 }} Artikeln
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DomainCheckoutService } from '@domain/checkout';
|
||||
import { ShoppingCartItemDTO, UpdateShoppingCartItemDTO } from '@swagger/checkout';
|
||||
import { UiErrorModalComponent, UiModalRef, UiModalService } from '@ui/modal';
|
||||
import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
|
||||
import { first, map, shareReplay, takeUntil, withLatestFrom } from 'rxjs/operators';
|
||||
import { debounceTime, filter, first, map, shareReplay, takeUntil, withLatestFrom } from 'rxjs/operators';
|
||||
import { PurchasingOptionsListModalData } from './purchasing-options-list-modal.data';
|
||||
import { PurchasingOptionsListModalStore } from './purchasing-options-list-modal.store';
|
||||
|
||||
@@ -63,35 +63,39 @@ export class PurchasingOptionsListModalComponent implements OnInit {
|
||||
shareReplay()
|
||||
);
|
||||
|
||||
b2bCustomer$ = this._store.customerFeatures$.pipe(map((customerFeatures) => customerFeatures && customerFeatures['b2b']));
|
||||
|
||||
selectedShoppingCartItems$ = this._store.selectedShoppingCartItems$;
|
||||
|
||||
allShoppingCartItemsSelected$ = combineLatest([this.shoppingCartItems$, this.selectedShoppingCartItems$]).pipe(
|
||||
map(([shoppingCartItems, selectedShoppingCartItems]) =>
|
||||
shoppingCartItems.every((item) => selectedShoppingCartItems.find((i) => item.id === i.id))
|
||||
map(
|
||||
([shoppingCartItems, selectedShoppingCartItems]) =>
|
||||
shoppingCartItems.every((item) => selectedShoppingCartItems.find((i) => item.id === i.id)) && shoppingCartItems?.length > 0
|
||||
)
|
||||
);
|
||||
|
||||
selectAllCtaDisabled$ = this._store.selectedFilterOption$.pipe(
|
||||
withLatestFrom(this.shoppingCartItems$),
|
||||
map(([selectedFilterOption, items]) => !selectedFilterOption || items?.length === 0)
|
||||
canAddItems$ = this._store.canAdd$.pipe(
|
||||
map((canAdd) => {
|
||||
for (const key in canAdd) {
|
||||
if (Object.prototype.hasOwnProperty.call(canAdd, key)) {
|
||||
if (!!canAdd[key]?.message) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}),
|
||||
shareReplay()
|
||||
);
|
||||
|
||||
applyCtaDisabled$ = combineLatest([
|
||||
this.addItemsLoader$,
|
||||
this._store.selectedFilterOption$,
|
||||
this._store.selectedShoppingCartItems$,
|
||||
this._store.canAdd$,
|
||||
]).pipe(
|
||||
selectAllCtaDisabled$ = combineLatest([this._store.selectedFilterOption$, this.canAddItems$]).pipe(
|
||||
withLatestFrom(this.shoppingCartItems$),
|
||||
map(([[selectedFilterOption, canAddItems], items]) => !selectedFilterOption || items?.length === 0 || !canAddItems)
|
||||
);
|
||||
|
||||
applyCtaDisabled$ = combineLatest([this.addItemsLoader$, this._store.selectedFilterOption$, this._store.selectedShoppingCartItems$]).pipe(
|
||||
withLatestFrom(this.shoppingCartItems$),
|
||||
map(
|
||||
([[addItemsLoader, selectedFilterOption, selectedShoppingCartItems, canAdd], shoppingCartItems]) =>
|
||||
addItemsLoader ||
|
||||
!selectedFilterOption ||
|
||||
shoppingCartItems?.length === 0 ||
|
||||
selectedShoppingCartItems?.length === 0 ||
|
||||
!!selectedShoppingCartItems?.find((i) => !!canAdd && canAdd[i.product.catalogProductNumber] !== true)
|
||||
([[addItemsLoader, selectedFilterOption, selectedShoppingCartItems], shoppingCartItems]) =>
|
||||
addItemsLoader || !selectedFilterOption || shoppingCartItems?.length === 0 || selectedShoppingCartItems?.length === 0
|
||||
)
|
||||
);
|
||||
|
||||
@@ -110,19 +114,46 @@ export class PurchasingOptionsListModalComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this._store.loadBranches();
|
||||
|
||||
// Beim Wechsel der ausgewählten Filteroption die Auswahl leeren
|
||||
this._store.selectedFilterOption$.pipe(takeUntil(this._onDestroy$)).subscribe((_) => {
|
||||
this._store.clearSelectedShoppingCartItems();
|
||||
});
|
||||
// Beim Wechsel der ausgewählten Filteroption oder der Branches die Auswahl leeren
|
||||
combineLatest([this._store.selectedFilterOption$, this._store.selectedTakeAwayBranch$, this._store.selectedPickUpBranch$])
|
||||
.pipe(takeUntil(this._onDestroy$))
|
||||
.subscribe(() => this._store.clearSelectedShoppingCartItems());
|
||||
|
||||
this._store.selectedFilterOption$
|
||||
.pipe(takeUntil(this._onDestroy$), withLatestFrom(this.shoppingCartItems$))
|
||||
.subscribe(([option, items]) => this.checkCanAdd(option, items));
|
||||
|
||||
this._store.fetchingAvailabilities$
|
||||
.pipe(
|
||||
takeUntil(this._onDestroy$),
|
||||
debounceTime(250),
|
||||
filter((fetching) => !fetching),
|
||||
withLatestFrom(this.shoppingCartItems$, this._store.selectedFilterOption$)
|
||||
)
|
||||
.subscribe(([_, items, option]) => this.checkCanAdd(option, items));
|
||||
|
||||
this.canAddItems$
|
||||
.pipe(takeUntil(this._onDestroy$), withLatestFrom(this.shoppingCartItems$, this._store.selectedFilterOption$))
|
||||
.subscribe(([showSelectAll, items, option]) => {
|
||||
if (items?.length > 0 && this._store.lastSelectedFilterOption$.value !== option) {
|
||||
this.selectAll(items, showSelectAll && !!option);
|
||||
}
|
||||
|
||||
// Nach dem Übernehmen von Items wird eine neue CanAdd Abfrage ausgeführt, in diesem Fall soll aber nicht alles ausgewählt werden
|
||||
this._store.lastSelectedFilterOption$.next(option);
|
||||
});
|
||||
}
|
||||
|
||||
checkCanAdd(selectedFilterOption: string, items: ShoppingCartItemDTO[]) {
|
||||
if (!!selectedFilterOption && items?.length > 0) {
|
||||
this._store.checkCanAddItems(items);
|
||||
} else {
|
||||
this._store.patchState({ canAdd: {} });
|
||||
}
|
||||
}
|
||||
|
||||
async selectAll(items: ShoppingCartItemDTO[], value: boolean) {
|
||||
this._store.selectShoppingCartItem(items, value);
|
||||
|
||||
if (value) {
|
||||
const selectedItems = await this.selectedShoppingCartItems$.pipe(first()).toPromise();
|
||||
selectedItems.forEach((item) => this._store.checkCanAddItem(item));
|
||||
}
|
||||
}
|
||||
|
||||
async apply() {
|
||||
@@ -161,9 +192,6 @@ export class PurchasingOptionsListModalComponent implements OnInit {
|
||||
availability = deliveryB2bAvailabilities[item.product.catalogProductNumber];
|
||||
}
|
||||
break;
|
||||
case 'b2b-delivery':
|
||||
availability = deliveryB2bAvailabilities[item.product.catalogProductNumber];
|
||||
break;
|
||||
}
|
||||
|
||||
const price = this._availability.getPriceForAvailability(this._store.selectedFilterOption, item.availability, availability);
|
||||
@@ -226,5 +254,10 @@ export class PurchasingOptionsListModalComponent implements OnInit {
|
||||
} finally {
|
||||
this.addItemsLoader$.next(false);
|
||||
}
|
||||
|
||||
const shoppingCartItems = await this.shoppingCartItems$.pipe(first()).toPromise();
|
||||
if (shoppingCartItems?.length > 0) {
|
||||
this._store.checkCanAddItems(shoppingCartItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { DeliveryOptionListComponent } from './delivery-option/delivery-option-l
|
||||
import { PurchasingOptionsListItemComponent } from './purchasing-options-list-item/purchasing-options-list-item.component';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { UiBranchDropdownModule } from '@ui/branch-dropdown';
|
||||
import { DeliveryB2bOptionListComponent } from './delivery-option-b2b';
|
||||
import { UiTooltipModule } from '@ui/tooltip';
|
||||
import { UiSpinnerModule } from 'apps/ui/spinner/src/lib/ui-spinner.module';
|
||||
|
||||
@@ -37,7 +36,6 @@ import { UiSpinnerModule } from 'apps/ui/spinner/src/lib/ui-spinner.module';
|
||||
PickUpOptionListComponent,
|
||||
TakeAwayOptionListComponent,
|
||||
DeliveryOptionListComponent,
|
||||
DeliveryB2bOptionListComponent,
|
||||
],
|
||||
})
|
||||
export class PurchasingOptionsListModalModule {}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ComponentStore, tapResponse } from '@ngrx/component-store';
|
||||
import { AvailabilityDTO, BranchDTO, ShoppingCartItemDTO } from '@swagger/checkout';
|
||||
import { map, mergeMap, switchMap, withLatestFrom } from 'rxjs/operators';
|
||||
import { DomainAvailabilityService } from '@domain/availability';
|
||||
import { combineLatest, Observable } from 'rxjs';
|
||||
import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
|
||||
import { DomainCheckoutService } from '@domain/checkout';
|
||||
|
||||
interface PurchasingOptionsListModalState {
|
||||
@@ -16,7 +16,7 @@ interface PurchasingOptionsListModalState {
|
||||
deliveryB2bAvailabilities: { [key: string]: AvailabilityDTO | true };
|
||||
deliveryDigAvailabilities: { [key: string]: AvailabilityDTO | true };
|
||||
customerFeatures: { [key: string]: string };
|
||||
canAdd: { [key: string]: true | string };
|
||||
canAdd: { [key: string]: { message: string; status: number } };
|
||||
selectedShoppingCartItems: ShoppingCartItemDTO[];
|
||||
branches: BranchDTO[];
|
||||
currentBranch: BranchDTO;
|
||||
@@ -26,6 +26,8 @@ interface PurchasingOptionsListModalState {
|
||||
|
||||
@Injectable()
|
||||
export class PurchasingOptionsListModalStore extends ComponentStore<PurchasingOptionsListModalState> {
|
||||
lastSelectedFilterOption$ = new BehaviorSubject<string>(undefined);
|
||||
|
||||
branches$ = this.select((s) => s.branches);
|
||||
currentBranch$ = this.select((s) => s.currentBranch);
|
||||
takeAwayAvailabilities$ = this.select((s) => s.takeAwayAvailabilities);
|
||||
@@ -57,7 +59,7 @@ export class PurchasingOptionsListModalStore extends ComponentStore<PurchasingOp
|
||||
selectedFilterOption$ = this.select((s) => s.selectedFilterOption);
|
||||
|
||||
set selectedFilterOption(selectedFilterOption: string) {
|
||||
this.patchState({ selectedFilterOption, canAdd: {} });
|
||||
this.patchState({ selectedFilterOption });
|
||||
}
|
||||
|
||||
get selectedFilterOption() {
|
||||
@@ -416,8 +418,8 @@ export class PurchasingOptionsListModalStore extends ComponentStore<PurchasingOp
|
||||
)
|
||||
);
|
||||
|
||||
checkCanAddItem = this.effect((item$: Observable<ShoppingCartItemDTO>) =>
|
||||
item$.pipe(
|
||||
checkCanAddItems = this.effect((items$: Observable<ShoppingCartItemDTO[]>) =>
|
||||
items$.pipe(
|
||||
withLatestFrom(
|
||||
this.processId$,
|
||||
this.selectedFilterOption$,
|
||||
@@ -427,51 +429,70 @@ export class PurchasingOptionsListModalStore extends ComponentStore<PurchasingOp
|
||||
this.deliveryB2bAvailabilities$,
|
||||
this.deliveryDigAvailabilities$
|
||||
),
|
||||
mergeMap(([item, processId, selectedOption, takeAway, pickUp, delivery, deliveryB2b, deliveryDig]) => {
|
||||
let availability;
|
||||
let orderType;
|
||||
mergeMap(([items, processId, selectedOption, takeAway, pickUp, delivery, deliveryB2b, deliveryDig]) => {
|
||||
let orderType: string;
|
||||
const payload = items.map((item) => {
|
||||
switch (selectedOption) {
|
||||
case 'take-away':
|
||||
orderType = 'Rücklage';
|
||||
return {
|
||||
availabilities: [this.getOlaAvailability(takeAway[item.product.catalogProductNumber], item)],
|
||||
id: item.product.catalogProductNumber,
|
||||
};
|
||||
case 'pick-up':
|
||||
orderType = 'Abholung';
|
||||
return {
|
||||
availabilities: [this.getOlaAvailability(pickUp[item.product.catalogProductNumber], item)],
|
||||
id: item.product.catalogProductNumber,
|
||||
};
|
||||
case 'delivery':
|
||||
orderType = 'Versand';
|
||||
if (
|
||||
deliveryDig[item.product.catalogProductNumber] &&
|
||||
deliveryB2b[item.product.catalogProductNumber] &&
|
||||
delivery[item.product.catalogProductNumber]
|
||||
) {
|
||||
return {
|
||||
availabilities: [this.getOlaAvailability(delivery[item.product.catalogProductNumber], item)],
|
||||
id: item.product.catalogProductNumber,
|
||||
};
|
||||
} else if (deliveryDig[item.product.catalogProductNumber]) {
|
||||
return {
|
||||
availabilities: [this.getOlaAvailability(deliveryDig[item.product.catalogProductNumber], item)],
|
||||
id: item.product.catalogProductNumber,
|
||||
};
|
||||
} else if (deliveryB2b[item.product.catalogProductNumber]) {
|
||||
return {
|
||||
availabilities: [this.getOlaAvailability(deliveryB2b[item.product.catalogProductNumber], item)],
|
||||
id: item.product.catalogProductNumber,
|
||||
};
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
switch (selectedOption) {
|
||||
case 'take-away':
|
||||
availability = this.getOlaAvailability(takeAway[item.product.catalogProductNumber], item);
|
||||
orderType = 'Rücklage';
|
||||
break;
|
||||
case 'pick-up':
|
||||
availability = this.getOlaAvailability(pickUp[item.product.catalogProductNumber], item);
|
||||
orderType = 'Abholung';
|
||||
break;
|
||||
case 'delivery':
|
||||
orderType = 'Versand';
|
||||
if (
|
||||
deliveryDig[item.product.catalogProductNumber] &&
|
||||
deliveryB2b[item.product.catalogProductNumber] &&
|
||||
delivery[item.product.catalogProductNumber]
|
||||
) {
|
||||
availability = this.getOlaAvailability(delivery[item.product.catalogProductNumber], item);
|
||||
} else if (deliveryDig[item.product.catalogProductNumber]) {
|
||||
availability = this.getOlaAvailability(deliveryDig[item.product.catalogProductNumber], item);
|
||||
} else if (deliveryB2b[item.product.catalogProductNumber]) {
|
||||
availability = this.getOlaAvailability(deliveryB2b[item.product.catalogProductNumber], item);
|
||||
return this._checkoutService.canAddItems({ processId, payload, orderType }).pipe(
|
||||
tapResponse(
|
||||
(result: any) => {
|
||||
const canAdd = {};
|
||||
|
||||
result?.forEach((r) => {
|
||||
canAdd[r.id] = { message: r.message, status: r.status };
|
||||
});
|
||||
|
||||
this.patchState({ canAdd });
|
||||
},
|
||||
(error: Error) => {
|
||||
const canAdd = {};
|
||||
|
||||
items?.forEach((i) => {
|
||||
canAdd[i.product?.catalogProductNumber] = { message: error?.message };
|
||||
});
|
||||
|
||||
this.patchState({ canAdd });
|
||||
}
|
||||
break;
|
||||
case 'b2b-delivery':
|
||||
orderType = 'B2B-Versand';
|
||||
availability = this.getOlaAvailability(deliveryB2b[item.product.catalogProductNumber], item);
|
||||
break;
|
||||
}
|
||||
|
||||
return this._checkoutService
|
||||
.canAddItem({
|
||||
processId,
|
||||
availability,
|
||||
orderType,
|
||||
})
|
||||
.pipe(
|
||||
tapResponse(
|
||||
(canAddItem) => this.setCanAdd({ itemId: item.product.catalogProductNumber, canAddItem }),
|
||||
(error: Error) => this.setCanAdd({ itemId: item.product.catalogProductNumber, canAddItem: error?.message })
|
||||
)
|
||||
);
|
||||
)
|
||||
);
|
||||
})
|
||||
)
|
||||
);
|
||||
@@ -482,24 +503,17 @@ export class PurchasingOptionsListModalStore extends ComponentStore<PurchasingOp
|
||||
ean: item.product.ean,
|
||||
itemId: item.product.catalogProductNumber,
|
||||
format: item.product.format,
|
||||
at: availability.estimatedShippingDate,
|
||||
isPrebooked: availability.isPrebooked,
|
||||
status: availability.availabilityType,
|
||||
logisticianId: availability.logistician?.id,
|
||||
price: availability.price,
|
||||
ssc: availability.ssc,
|
||||
sscText: availability.sscText,
|
||||
supplierId: availability.supplier?.id,
|
||||
at: availability?.estimatedShippingDate,
|
||||
isPrebooked: availability?.isPrebooked,
|
||||
status: availability?.availabilityType,
|
||||
logisticianId: availability?.logistician?.id,
|
||||
price: availability?.price,
|
||||
ssc: availability?.ssc,
|
||||
sscText: availability?.sscText,
|
||||
supplierId: availability?.supplier?.id,
|
||||
};
|
||||
}
|
||||
|
||||
readonly setCanAdd = this.updater((state, data: { itemId: number; canAddItem: true | string }) => {
|
||||
const canAdd = { ...state.canAdd };
|
||||
canAdd[data.itemId] = data.canAddItem;
|
||||
|
||||
return { ...state, canAdd };
|
||||
});
|
||||
|
||||
readonly updateItemQuantity = this.updater((state, value: { itemId: number; quantity: number }) => {
|
||||
const itemToUpdate = state.shoppingCartItems.find((item) => item.id === value.itemId);
|
||||
const otherItems = state.shoppingCartItems.filter((item) => item.id !== value.itemId);
|
||||
|
||||
@@ -26,6 +26,8 @@ export class TakeAwayOptionListComponent {
|
||||
}
|
||||
|
||||
async selectBranch(branch: BranchDTO) {
|
||||
this._store.lastSelectedFilterOption$.next(undefined);
|
||||
|
||||
this._store.selectedTakeAwayBranch = branch;
|
||||
|
||||
const shoppingCartItems = await this._store.shoppingCartItems$.pipe(first()).toPromise();
|
||||
|
||||
@@ -432,19 +432,15 @@ export class PurchasingOptionsModalStore extends ComponentStore<PurchasingOption
|
||||
withLatestFrom(this.selectOlaAvailability, this.selectProcessId, this.selectOrderType),
|
||||
switchMap(([_, availability, processId, orderType]) => {
|
||||
this.patchState({ checkingCanAdd: true });
|
||||
return this.checkoutService
|
||||
.canAddItem({
|
||||
processId,
|
||||
availability,
|
||||
orderType,
|
||||
})
|
||||
.pipe(
|
||||
tapResponse(
|
||||
(canAdd) => this.setCanAdd(canAdd),
|
||||
(error: Error) => this.setCanAdd(error?.message)
|
||||
),
|
||||
tap((_) => this.patchState({ checkingCanAdd: false }))
|
||||
);
|
||||
return this.checkoutService.canAddItems({ processId, payload: [{ availabilities: [availability] }], orderType }).pipe(
|
||||
tapResponse(
|
||||
(response: any) => {
|
||||
this.setCanAdd(response?.find((_) => true)?.status === 0 ? true : response?.find((_) => true)?.message);
|
||||
},
|
||||
(error: Error) => this.setCanAdd(error?.message)
|
||||
),
|
||||
tap((_) => this.patchState({ checkingCanAdd: false }))
|
||||
);
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'page-checkout',
|
||||
|
||||
@@ -15,6 +15,9 @@ export { KeyValueDTOOfStringAndString } from './models/key-value-dtoof-string-an
|
||||
export { IPublicUserInfo } from './models/ipublic-user-info';
|
||||
export { ProblemDetails } from './models/problem-details';
|
||||
export { ItemPayload } from './models/item-payload';
|
||||
export { ResponseArgsOfItemsResult } from './models/response-args-of-items-result';
|
||||
export { ItemsResult } from './models/items-result';
|
||||
export { ItemsResultStatus } from './models/items-result-status';
|
||||
export { ResponseArgsOfBuyerResult } from './models/response-args-of-buyer-result';
|
||||
export { BuyerResult } from './models/buyer-result';
|
||||
export { QueryTokenDTO } from './models/query-token-dto';
|
||||
|
||||
@@ -16,6 +16,11 @@ export interface ItemPayload {
|
||||
*/
|
||||
customerFeatures?: {[key: string]: string};
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Art der Bestellung (Rücklage, Abholung, Versand, DIG-Versand, B2B-Versand, Download)
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,16 @@ export interface ItemResult {
|
||||
*/
|
||||
availability?: OLAAvailabilityDTO;
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Nachricht
|
||||
*/
|
||||
message?: string;
|
||||
|
||||
/**
|
||||
* Can Add
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/* tslint:disable */
|
||||
export type ItemsResultStatus = 0 | 1 | 2 | 4;
|
||||
29
apps/swagger/checkout/src/lib/models/items-result.ts
Normal file
29
apps/swagger/checkout/src/lib/models/items-result.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/* tslint:disable */
|
||||
import { OLAAvailabilityDTO } from './olaavailability-dto';
|
||||
import { ItemsResultStatus } from './items-result-status';
|
||||
|
||||
/**
|
||||
* Output
|
||||
*/
|
||||
export interface ItemsResult {
|
||||
|
||||
/**
|
||||
* Artikelverfügbarkeit
|
||||
*/
|
||||
availability?: OLAAvailabilityDTO;
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Nachricht
|
||||
*/
|
||||
message?: string;
|
||||
|
||||
/**
|
||||
* Can Add
|
||||
*/
|
||||
status: ItemsResultStatus;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/* tslint:disable */
|
||||
import { ResponseArgs } from './response-args';
|
||||
import { ItemsResult } from './items-result';
|
||||
export interface ResponseArgsOfItemsResult extends ResponseArgs{
|
||||
result?: ItemsResult;
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { map as __map, filter as __filter } from 'rxjs/operators';
|
||||
|
||||
import { ResponseArgsOfItemResult } from '../models/response-args-of-item-result';
|
||||
import { ItemPayload } from '../models/item-payload';
|
||||
import { ResponseArgsOfItemsResult } from '../models/response-args-of-items-result';
|
||||
import { ResponseArgsOfBuyerResult } from '../models/response-args-of-buyer-result';
|
||||
import { BuyerPayload } from '../models/buyer-payload';
|
||||
import { ResponseArgsOfDestinationResult } from '../models/response-args-of-destination-result';
|
||||
@@ -47,6 +48,7 @@ import { ResponseArgsOfLogisticianDTO } from '../models/response-args-of-logisti
|
||||
})
|
||||
class StoreCheckoutService extends __BaseService {
|
||||
static readonly StoreCheckoutCanAddItemPath = '/store/shoppingcart/{shoppingCartId}/item/canadd';
|
||||
static readonly StoreCheckoutCanAddItemsPath = '/store/shoppingcart/{shoppingCartId}/items/canadd';
|
||||
static readonly StoreCheckoutCanAddBuyerPath = '/store/shoppingcart/{shoppingCartId}/buyer/canadd';
|
||||
static readonly StoreCheckoutCanAddDestinationPath = '/store/shoppingcart/{shoppingCartId}/destination/canadd';
|
||||
static readonly StoreCheckoutSetLogisticianOnDestinationsByBuyerPath = '/store/shoppingcart/{shoppingCartId}/item/destination';
|
||||
@@ -125,7 +127,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/item/canadd`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/item/canadd`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -156,6 +158,56 @@ class StoreCheckoutService extends __BaseService {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Überprüfung, ob die übergebenen Artikel dem Warenkorb hinzugefügt werden können
|
||||
* @param params The `StoreCheckoutService.StoreCheckoutCanAddItemsParams` containing the following parameters:
|
||||
*
|
||||
* - `shoppingCartId`: Warenkorb PK
|
||||
*
|
||||
* - `payload`: Daten
|
||||
*
|
||||
* - `locale`: Lokalisierung
|
||||
*/
|
||||
StoreCheckoutCanAddItemsResponse(params: StoreCheckoutService.StoreCheckoutCanAddItemsParams): __Observable<__StrictHttpResponse<ResponseArgsOfItemsResult>> {
|
||||
let __params = this.newParams();
|
||||
let __headers = new HttpHeaders();
|
||||
let __body: any = null;
|
||||
|
||||
__body = params.payload;
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/items/canadd`,
|
||||
__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<ResponseArgsOfItemsResult>;
|
||||
})
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Überprüfung, ob die übergebenen Artikel dem Warenkorb hinzugefügt werden können
|
||||
* @param params The `StoreCheckoutService.StoreCheckoutCanAddItemsParams` containing the following parameters:
|
||||
*
|
||||
* - `shoppingCartId`: Warenkorb PK
|
||||
*
|
||||
* - `payload`: Daten
|
||||
*
|
||||
* - `locale`: Lokalisierung
|
||||
*/
|
||||
StoreCheckoutCanAddItems(params: StoreCheckoutService.StoreCheckoutCanAddItemsParams): __Observable<ResponseArgsOfItemsResult> {
|
||||
return this.StoreCheckoutCanAddItemsResponse(params).pipe(
|
||||
__map(_r => _r.body as ResponseArgsOfItemsResult)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Überprüfung, ob ein Kundentyp einem Warenkorb hinzugefügt werden kann
|
||||
* @param params The `StoreCheckoutService.StoreCheckoutCanAddBuyerParams` containing the following parameters:
|
||||
@@ -175,7 +227,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/buyer/canadd`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/buyer/canadd`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -225,7 +277,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/destination/canadd`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/destination/canadd`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -275,7 +327,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/item/destination`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/item/destination`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -324,7 +376,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/item`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/item`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -369,7 +421,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -418,7 +470,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/item/${encodeURIComponent(String(params.shoppingCartItemId))}`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/item/${encodeURIComponent(params.shoppingCartItemId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -471,7 +523,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/item/${encodeURIComponent(String(params.shoppingCartItemId))}/availability`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/item/${encodeURIComponent(params.shoppingCartItemId)}/availability`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -521,7 +573,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'DELETE',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/item/${encodeURIComponent(String(params.shoppingCartItemId))}/availability`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/item/${encodeURIComponent(params.shoppingCartItemId)}/availability`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -572,7 +624,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/item/${encodeURIComponent(String(params.shoppingCartItemId))}/promotion`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/item/${encodeURIComponent(params.shoppingCartItemId)}/promotion`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -622,7 +674,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'DELETE',
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}/item/${encodeURIComponent(String(params.shoppingCartItemId))}/promotion`,
|
||||
this.rootUrl + `/store/shoppingcart/${encodeURIComponent(params.shoppingCartId)}/item/${encodeURIComponent(params.shoppingCartItemId)}/promotion`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -744,7 +796,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/payer/requireddata`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/payer/requireddata`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -790,7 +842,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/destination/${encodeURIComponent(String(params.destinationId))}/requireddata`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/destination/${encodeURIComponent(params.destinationId)}/requireddata`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -835,7 +887,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/checkout/shoppingcart/${encodeURIComponent(String(params.shoppingCartId))}`,
|
||||
this.rootUrl + `/store/checkout/shoppingcart/${encodeURIComponent(params.shoppingCartId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -878,7 +930,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'DELETE',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -921,7 +973,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -964,7 +1016,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PATCH',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/reset`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/reset`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1007,7 +1059,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/requiredstep`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/requiredstep`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1056,7 +1108,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.checkoutId != null) __params = __params.set('checkoutId', params.checkoutId.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutPId))}/emailexists`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutPId)}/emailexists`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1109,7 +1161,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/account`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/account`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1162,7 +1214,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/buyer`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/buyer`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1215,7 +1267,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/buyer`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/buyer`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1268,7 +1320,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/payer`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/payer`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1321,7 +1373,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/payer`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/payer`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1419,7 +1471,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/destination`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/destination`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1470,7 +1522,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/destination/${encodeURIComponent(String(params.destinationId))}`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/destination/${encodeURIComponent(params.destinationId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1523,7 +1575,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'DELETE',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/destination/${encodeURIComponent(String(params.destinationId))}`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/destination/${encodeURIComponent(params.destinationId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1570,7 +1622,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/deliveries`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/deliveries`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1616,7 +1668,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/deliveries`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/deliveries`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1670,7 +1722,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/deliveries/${encodeURIComponent(String(params.deliveryId))}`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/deliveries/${encodeURIComponent(params.deliveryId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1719,7 +1771,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/branches`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/branches`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1858,7 +1910,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/countries`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/countries`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -1961,7 +2013,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.deliveryId != null) __params = __params.set('deliveryId', params.deliveryId.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PATCH',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/items/${encodeURIComponent(String(params.checkoutItemId))}`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/items/${encodeURIComponent(params.checkoutItemId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2018,7 +2070,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'DELETE',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/items/${encodeURIComponent(String(params.checkoutItemId))}`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/items/${encodeURIComponent(params.checkoutItemId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2074,7 +2126,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.deliveryId != null) __params = __params.set('deliveryId', params.deliveryId.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PATCH',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/items`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/items`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2123,7 +2175,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/payment`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/payment`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2172,7 +2224,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/payment`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/payment`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2222,7 +2274,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/delivery/${encodeURIComponent(String(params.deliveryId))}/payment`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/delivery/${encodeURIComponent(params.deliveryId)}/payment`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2273,7 +2325,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'PUT',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/notificationchannel`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/notificationchannel`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2326,7 +2378,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/vouchers`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/vouchers`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2379,7 +2431,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
if (params.locale != null) __params = __params.set('locale', params.locale.toString());
|
||||
let req = new HttpRequest<any>(
|
||||
'DELETE',
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(String(params.checkoutId))}/vouchers/${encodeURIComponent(String(params.voucherId))}`,
|
||||
this.rootUrl + `/store/checkout/${encodeURIComponent(params.checkoutId)}/vouchers/${encodeURIComponent(params.voucherId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2507,7 +2559,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/vat/${encodeURIComponent(String(vatId))}`,
|
||||
this.rootUrl + `/store/checkout/vat/${encodeURIComponent(vatId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2584,7 +2636,7 @@ class StoreCheckoutService extends __BaseService {
|
||||
|
||||
let req = new HttpRequest<any>(
|
||||
'GET',
|
||||
this.rootUrl + `/store/checkout/logistician/${encodeURIComponent(String(logisticianId))}`,
|
||||
this.rootUrl + `/store/checkout/logistician/${encodeURIComponent(logisticianId)}`,
|
||||
__body,
|
||||
{
|
||||
headers: __headers,
|
||||
@@ -2632,6 +2684,27 @@ module StoreCheckoutService {
|
||||
locale?: null | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for StoreCheckoutCanAddItems
|
||||
*/
|
||||
export interface StoreCheckoutCanAddItemsParams {
|
||||
|
||||
/**
|
||||
* Warenkorb PK
|
||||
*/
|
||||
shoppingCartId: number;
|
||||
|
||||
/**
|
||||
* Daten
|
||||
*/
|
||||
payload: Array<ItemPayload>;
|
||||
|
||||
/**
|
||||
* Lokalisierung
|
||||
*/
|
||||
locale?: null | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for StoreCheckoutCanAddBuyer
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user