Compare commits

...

10 Commits

Author SHA1 Message Date
Nino
d70c95743c feature(reward-header): Added Loading to GET Bonuscard 2025-09-17 12:10:25 +02:00
Nino
9c8c42da69 chore(swagger-oms, swagger-checkout): Update Swagger and resolved breaking changes 2025-09-17 12:09:51 +02:00
Nino
2fc83cd8f7 feat(reward-crm, crm-data-acces): implement customer card display and selection system
Add comprehensive customer card functionality to the reward catalog:
- Create new CRM data access layer with customer cards facade and services
- Implement customer card resource for fetching bonus card information
- Add reward customer card component to display customer details and points
- Update reward header to conditionally show customer card or start card
- Fix customer selection persistence by moving facade call outside conditional
- Add proper type definitions and models for bonus card information
- Export new facades and models through updated index files

The system now properly handles customer selection state across tabs
and displays relevant customer information including name and total points
when a customer with an active primary bonus card is selected.

Ref: #5262
2025-09-16 18:37:38 +02:00
Nino
9f775e01e2 Merge branch 'develop' into feature/5258-Praemie-Landing 2025-09-16 12:00:50 +02:00
Lorenz Hilpert
c5d057e3a7 Merged PR 1950: 5343-Filter-NumberRange
Related work items: #5343
2025-09-16 09:54:29 +00:00
Nino
e5c09c030c feat(reward): implement reward catalog with customer selection
Add comprehensive reward catalog functionality including:
- New reward catalog component with header switching between start card and customer card
- Customer selection integration with tab metadata service
- Reward checkout service with query settings fetching
- Customer search integration for reward context with proper filtering
- Tab metadata support for storing selected customer IDs
- Navigation improvements for reward workflow in customer details

The implementation includes proper error handling, logging, and follows
the established architectural patterns with facades and services.

Ref: #5262
2025-09-15 17:42:57 +02:00
Nino
0269473a18 feat(common/data-access): enhance error handling with ResponseArgsError operator
Add catchResponseArgsErrorPipe operator to transform HTTP errors into structured
ResponseArgsError instances. This provides consistent error handling across
data access services by automatically converting HttpErrorResponse objects
with ResponseArgs payloads into typed ResponseArgsError instances.

Changes include:
- New catchResponseArgsErrorPipe operator for standardized error transformation
- Enhanced DataAccessError with proper prototype chain setup
- Integration in CatalougeSearchService for loyalty items search
- Export operator from common data-access module

This improves error consistency and debugging capabilities across the application
by ensuring all API errors follow the same structure and typing.

Refs: #5258
2025-09-15 14:04:34 +02:00
Nino Righi
707802ce0d Merged PR 1944: feat(checkout-reward): #5258
- feat(loyalty): add loyalty program feature with list and navigation
- fix(isa-app-side-menu): Update customer expand to signals
- feat(catalogue-data-access): add searchLoyaltyItems method with comprehensive test coverage
- feat(project-structure): migrate loyalty system to reward-based architecture
- feat(checkout-reward): add query settings resolver and catalog resource
- feat(swagger-cat-search-api): Swagger Update
- feat(checkout-reward): update API call and prepare filter integration

Refs: #5258
2025-09-12 10:44:42 +00:00
Lorenz Hilpert
e00de7598d feat(crm): add crm-data-access library with initial component and tests
- Introduced the crm-data-access library with a basic component.
- Added necessary configuration files, including ESLint and TypeScript settings.
- Implemented unit tests for the component to ensure functionality.

Refs: #5254
2025-09-11 20:13:56 +02:00
Lorenz Hilpert
516b7748c2 chore: update .gitignore and package-lock.json to include new files 2025-09-09 11:19:04 +02:00
368 changed files with 5231 additions and 2019 deletions

185
.github/prompts/plan.prompt.md vendored Normal file
View File

@@ -0,0 +1,185 @@
---
mode: agent
tools: [ 'edit', 'search', 'usages', 'vscodeAPI', 'problems', 'changes', 'fetch', 'githubRepo', 'Nx Mcp Server', 'context7' ]
description: Plan Mode - Research and create a detailed implementation plan before making any changes.
---
# Plan Mode
You are now operating in **Plan Mode** - a research and planning phase that ensures thorough analysis before implementation. Plan mode is **ALWAYS ACTIVE** when using this prompt. You must follow these strict guidelines for every request:
## Phase 1: Research & Analysis (MANDATORY)
### ALLOWED Operations:
- ✅ Read files using Read, Glob, Grep tools
- ✅ Search documentation and codebases
- ✅ Analyze existing patterns and structures
- ✅ Use WebFetch for documentation research
- ✅ List and explore project structure
- ✅ Use Nx/Angular/Context7 MCP tools for workspace analysis
- ✅ Review dependencies and configurations
### FORBIDDEN Operations:
-**NEVER** create, edit, or modify any files
-**NEVER** run commands that change system state
-**NEVER** make commits or push changes
-**NEVER** install packages or modify configurations
-**NEVER** run build/test commands during planning
## Phase 2: Plan Presentation (REQUIRED FORMAT)
After thorough research, present your plan using this exact structure:
```markdown
## 📋 Implementation Plan
### 🎯 Objective
[Clear statement of what will be accomplished]
### 🔍 Research Summary
- **Current State**: [What exists now]
- **Requirements**: [What needs to be built/changed]
- **Constraints**: [Limitations and considerations]
### 📁 Files to be Modified/Created
1. **File**: `path/to/file.ts`
- **Action**: Create/Modify/Delete
- **Purpose**: [Why this file needs changes]
- **Key Changes**: [Specific modifications planned]
2. **File**: `path/to/another-file.ts`
- **Action**: Create/Modify/Delete
- **Purpose**: [Why this file needs changes]
- **Key Changes**: [Specific modifications planned]
### 🏗️ Implementation Steps
1. **Step 1**: [Detailed description]
- Files affected: `file1.ts`, `file2.ts`
- Rationale: [Why this step is necessary]
2. **Step 2**: [Detailed description]
- Files affected: `file3.ts`
- Rationale: [Why this step is necessary]
3. **Step N**: [Continue numbering...]
### ⚠️ Risks & Considerations
- **Risk 1**: [Potential issue and mitigation]
- **Risk 2**: [Potential issue and mitigation]
### 🧪 Testing Strategy
- [How the changes will be tested]
- [Specific test files or approaches]
### 📚 Architecture Decisions
- **Pattern Used**: [Which architectural pattern will be followed]
- **Libraries/Dependencies**: [What will be used and why]
- **Integration Points**: [How this fits with existing code]
### ✅ Success Criteria
- [ ] Criterion 1
- [ ] Criterion 2
- [ ] All tests pass
- [ ] No lint errors
```
## Phase 3: Await Approval
After presenting the plan:
1. **STOP** all implementation activities
2. **WAIT** for explicit user approval
3. **DO NOT** proceed with any file changes
4. **RESPOND** to questions or plan modifications
5. **EXIT PLAN MODE** only when user explicitly says "execute", "implement", "go ahead", "approved", or similar approval language
## Phase 4: Implementation (After Exiting Plan Mode)
Once the user explicitly approves and you exit plan mode:
1. **PLAN MODE IS NOW DISABLED** - you can proceed with normal implementation
2. Use TodoWrite to create implementation todos
3. Follow the plan step-by-step
4. Update todos as you progress
5. Run tests and lint checks as specified
6. Provide progress updates
## Key Behavioral Rules
### Research Thoroughly
- Spend significant time understanding the codebase
- Look for existing patterns to follow
- Identify all dependencies and integration points
- Consider edge cases and error scenarios
### Be Comprehensive
- Plans should be detailed enough for another developer to implement
- Include all necessary file changes
- Consider testing, documentation, and deployment
- Address potential conflicts or breaking changes
### Show Your Work
- Explain reasoning behind architectural decisions
- Reference existing code patterns when applicable
- Cite documentation or best practices
- Provide alternatives when multiple approaches exist
### Safety First
- Never make changes during planning phase
- Always wait for explicit approval
- Flag potentially risky changes
- Suggest incremental implementation when complex
## Example Interactions
### Good Plan Mode Behavior:
```
User: "Add a dark mode toggle to the settings page"
Assistant: I'll research the current theming system and create a comprehensive plan for implementing dark mode.
[Extensive research using Read, Grep, Glob tools]
## 📋 Implementation Plan
[Follows complete format above]
Ready to proceed? Please approve this plan before I begin implementation.
```
### What NOT to do:
```
User: "Add a dark mode toggle"
Assistant: I'll add that right away!
[Immediately starts editing files - WRONG!]
```
## Integration with Existing Copilot Instructions
This plan mode respects all existing project patterns:
- Follows Angular + Nx workspace conventions
- Uses existing import path aliases
- Respects testing strategy (Jest/Vitest)
- Follows NgRx Signals patterns
- Adheres to logging and configuration patterns
- Maintains library conventions and file naming
Remember: **RESEARCH FIRST, PLAN THOROUGHLY, WAIT FOR APPROVAL, THEN IMPLEMENT**

1
.gitignore vendored
View File

@@ -75,3 +75,4 @@ vitest.config.*.timestamp*
.memory.json
nx.instructions.md
CLAUDE.md

View File

@@ -87,6 +87,11 @@
}
],
"nxConsole.generateAiAgentRules": true,
"chat.mcp.enabled": true,
"chat.mcp.discovery.enabled": true
"chat.mcp.discovery.enabled": {
"claude-desktop": true,
"windsurf": true,
"cursor-global": true,
"cursor-workspace": true
},
"chat.mcp.access": "all"
}

148
CLAUDE.md Normal file
View File

@@ -0,0 +1,148 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is an Angular monorepo managed by Nx. The main application is `isa-app`, which appears to be an inventory and returns management system for retail/e-commerce.
## Architecture
### Monorepo Structure
- **apps/isa-app**: Main Angular application
- **libs/**: Reusable libraries organized by domain and type
- **core/**: Core utilities (config, logging, storage, tabs)
- **common/**: Shared utilities (data-access, decorators, print)
- **ui/**: UI component libraries (buttons, dialogs, inputs, etc.)
- **shared/**: Shared domain components (filter, scanner, product components)
- **oms/**: Order Management System features and utilities
- **remission/**: Remission/returns management features
- **catalogue/**: Product catalogue functionality
- **utils/**: General utilities (validation, scroll position, parsing)
- **icons/**: Icon library
- **generated/swagger/**: Auto-generated API client code from OpenAPI specs
### Key Architectural Patterns
- **Standalone Components**: Project uses Angular standalone components
- **Feature Libraries**: Domain features organized as separate libraries (e.g., `oms-feature-return-search`)
- **Data Access Layer**: Separate data-access libraries for each domain (e.g., `oms-data-access`, `remission-data-access`)
- **Shared UI Components**: Reusable UI components in `libs/ui/`
- **Generated API Clients**: Swagger/OpenAPI clients auto-generated in `generated/swagger/`
## Common Development Commands
### Build Commands
```bash
# Build the main application (development)
npx nx build isa-app --configuration=development
# Build for production
npx nx build isa-app --configuration=production
# Serve the application with SSL
npx nx serve isa-app --ssl
```
### Testing Commands
```bash
# Run tests for a specific library (always use --skip-cache)
npx nx run <project-name>:test --skip-cache
# Example: npx nx run remission-data-access:test --skip-cache
# Run tests for all libraries except the main app
npx nx run-many -t test --exclude isa-app --skip-cache
# Run a single test file
npx nx run <project-name>:test --testFile=<path-to-test-file> --skip-cache
# Run tests with coverage
npx nx run <project-name>:test --code-coverage --skip-cache
# Run tests in watch mode
npx nx run <project-name>:test --watch
```
### Linting Commands
```bash
# Lint a specific project
npx nx lint <project-name>
# Example: npx nx lint remission-data-access
# Run linting for all projects
npx nx run-many -t lint
```
### Other Useful Commands
```bash
# Generate Swagger API clients
npm run generate:swagger
# Start Storybook
npx nx run isa-app:storybook
# Format code with Prettier
npm run prettier
# List all projects in the workspace
npx nx list
# Show project dependencies graph
npx nx graph
# Run affected tests (based on git changes)
npx nx affected:test
```
## Testing Framework
### Current Setup
- **Jest**: Primary test runner for existing libraries
- **Vitest**: Being adopted for new libraries (migration in progress)
- **Testing Utilities**:
- **Angular Testing Utilities** (TestBed, ComponentFixture): Use for new tests
- **Spectator**: Legacy testing utility for existing tests
- **ng-mocks**: For advanced mocking scenarios
### Test File Requirements
- Test files must end with `.spec.ts`
- Use AAA pattern (Arrange-Act-Assert)
- Include E2E testing attributes (`data-what`, `data-which`) in HTML templates
- Mock external dependencies and child components
## State Management
- **NgRx**: Store, Effects, Entity, Component Store, Signals
- **RxJS**: For reactive programming patterns
## Styling
- **Tailwind CSS**: Primary styling framework with custom configuration
- **SCSS**: For component-specific styles
- **Custom Tailwind plugins**: For buttons, inputs, menus, typography
## API Integration
- **Generated Swagger Clients**: Auto-generated TypeScript clients from OpenAPI specs
- **Available APIs**: availability, cat-search, checkout, crm, eis, inventory, isa, oms, print, wws
## Build Configuration
- **Angular 20.1.2**: Latest Angular version
- **TypeScript 5.8.3**: For type safety
- **Node.js >= 22.0.0**: Required Node version
- **npm >= 10.0.0**: Required npm version
## Important Conventions
- **Component Prefix**: Each library has its own prefix (e.g., `remi` for remission, `oms` for OMS)
- **Standalone Components**: All new components should be standalone
- **Path Aliases**: Use TypeScript path aliases defined in `tsconfig.base.json` (e.g., `@isa/core/config`)
- **Project Names**: Can be found in each library's `project.json` file
## Development Workflow Tips
- Always use `npx nx run` pattern for executing tasks
- Include `--skip-cache` flag when running tests to ensure fresh results
- Use Nx's affected commands to optimize CI/CD pipelines
- Project graph visualization helps understand dependencies: `npx nx graph`
## Development Notes
- Use start target to start the application. Only one project can be started: isa-app
- Make sure to have a look at @docs/guidelines/testing.md before writing tests
- Make sure to add e2e attributes to the html. Those are important for my colleagues writen e2e tests
- Guide for the e2e testing attributes can be found in the testing.md
- When reviewing code follow the instructions @.github/review-instructions.md

View File

@@ -185,6 +185,11 @@ const routes: Routes = [
resolve: { process: tabResolverFn, tab: tabResolverFn },
canActivate: [IsAuthenticatedGuard],
children: [
{
path: 'reward',
loadChildren: () =>
import('@isa/checkout/feature/reward-catalog').then((m) => m.routes),
},
{
path: 'return',
loadChildren: () =>

View File

@@ -12,7 +12,13 @@ import {
ShoppingCartItemDTO,
} from '@generated/swagger/checkout-api';
import { DomainCheckoutService } from '@domain/checkout';
import { catchError, mergeMap, switchMap, tap, withLatestFrom } from 'rxjs/operators';
import {
catchError,
mergeMap,
switchMap,
tap,
withLatestFrom,
} from 'rxjs/operators';
import {
BranchService,
DisplayOrderDTO,
@@ -40,7 +46,10 @@ export interface KulturpassOrderModalState {
}
@Injectable()
export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderModalState> implements OnStoreInit {
export class KulturpassOrderModalStore
extends ComponentStore<KulturpassOrderModalState>
implements OnStoreInit
{
private _checkoutService = inject(DomainCheckoutService);
private _branchService = inject(BranchService);
private _authService = inject(AuthService);
@@ -87,23 +96,33 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
readonly order$ = this.select((state) => state.order);
readonly updateCheckout = this.updater((state, checkout: CheckoutDTO) => ({ ...state, checkout }));
readonly updateCheckout = this.updater((state, checkout: CheckoutDTO) => ({
...state,
checkout,
}));
readonly updateOrder = this.updater((state, order: OrderDTO) => ({ ...state, order }));
readonly updateOrder = this.updater((state, order: OrderDTO) => ({
...state,
order,
}));
readonly fetchShoppingCart$ = this.select((state) => state.fetchShoppingCart);
readonly updateFetchShoppingCart = this.updater((state, fetchShoppingCart: boolean) => ({
...state,
fetchShoppingCart,
}));
readonly updateFetchShoppingCart = this.updater(
(state, fetchShoppingCart: boolean) => ({
...state,
fetchShoppingCart,
}),
);
readonly ordering$ = this.select((state) => state.ordering);
loadBranch = this.effect(($) =>
$.pipe(
switchMap(() =>
this._branchService.BranchGetBranches({}).pipe(tapResponse(this.handleBranchResponse, this.handleBranchError)),
this._branchService
.BranchGetBranches({})
.pipe(tapResponse(this.handleBranchResponse, this.handleBranchError)),
),
),
);
@@ -111,31 +130,45 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
handleBranchResponse = (res: ResponseArgsOfIEnumerableOfBranchDTO) => {
const branchNumber = this._authService.getClaimByKey('branch_no');
this.patchState({ branch: res.result.find((b) => b.branchNumber === branchNumber) });
this.patchState({
branch: res.result.find((b) => b.branchNumber === branchNumber),
});
};
handleBranchError = (err) => {
this._modal.error('Fehler beim Laden der Filiale', err);
};
createShoppingCart = this.effect((orderItemListItem$: Observable<OrderItemListItemDTO>) =>
orderItemListItem$.pipe(
tap((orderItemListItem) => {
this.patchState({ orderItemListItem });
this.updateFetchShoppingCart(true);
}),
switchMap((orderItemListItem) =>
this._checkoutService
.getShoppingCart({ processId: this.processId })
.pipe(tapResponse(this.handleCreateShoppingCartResponse, this.handleCreateShoppingCartError)),
createShoppingCart = this.effect(
(orderItemListItem$: Observable<OrderItemListItemDTO>) =>
orderItemListItem$.pipe(
tap((orderItemListItem) => {
this.patchState({ orderItemListItem });
this.updateFetchShoppingCart(true);
}),
switchMap((orderItemListItem) =>
this._checkoutService
.getShoppingCart({ processId: this.processId })
.pipe(
tapResponse(
this.handleCreateShoppingCartResponse,
this.handleCreateShoppingCartError,
),
),
),
),
),
);
handleCreateShoppingCartResponse = (res: ShoppingCartDTO) => {
this.patchState({ shoppingCart: res });
this._checkoutService.setBuyer({ processId: this.processId, buyer: this.order.buyer });
this._checkoutService.setPayer({ processId: this.processId, payer: this.order.billing?.data });
this._checkoutService.setBuyer({
processId: this.processId,
buyer: this.order.buyer,
});
this._checkoutService.setPayer({
processId: this.processId,
payer: this.order.billing?.data,
});
this.updateFetchShoppingCart(false);
};
@@ -154,7 +187,9 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
processId: this.processId,
items: [add],
})
.pipe(tapResponse(this.handleAddItemResponse, this.handleAddItemError)),
.pipe(
tapResponse(this.handleAddItemResponse, this.handleAddItemError),
),
),
),
);
@@ -174,7 +209,12 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
shoppingCartItemId: change.id,
update: { quantity: change.quantity },
})
.pipe(tapResponse(this.handleQuantityChangeResponse, this.handleQuantityChangeError)),
.pipe(
tapResponse(
this.handleQuantityChangeResponse,
this.handleQuantityChangeError,
),
),
),
),
);
@@ -206,7 +246,10 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
this.onOrderSuccess(res.result.item1[0], res.result.item2);
};
onOrderSuccess = (displayOrder: DisplayOrderDTO, action: KeyValueDTOOfStringAndString[]) => {};
onOrderSuccess = (
displayOrder: DisplayOrderDTO,
action: KeyValueDTOOfStringAndString[],
) => {};
handleOrderError = (err: any) => {
this._modal.error('Fehler beim Bestellen', err);
@@ -215,8 +258,9 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
itemQuantityByCatalogProductNumber(catalogProductNumber: string) {
return (
this.shoppingCart?.items?.find((i) => getCatalogProductNumber(i?.data) === catalogProductNumber)?.data
?.quantity ?? 0
this.shoppingCart?.items?.find(
(i) => getCatalogProductNumber(i?.data) === catalogProductNumber,
)?.data?.quantity ?? 0
);
}
@@ -227,7 +271,11 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
.canAddItemsKulturpass([item?.product])
.pipe(
tapResponse(
(results) => this.handleCanAddItemResponse({ item, result: results?.find((_) => true) }),
(results) =>
this.handleCanAddItemResponse({
item,
result: results?.find((_) => true),
}),
this.handleCanAddItemError,
),
),
@@ -235,14 +283,23 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
),
);
handleCanAddItemResponse = ({ item, result }: { item: ItemDTO; result: KulturPassResult }) => {
handleCanAddItemResponse = ({
item,
result,
}: {
item: ItemDTO;
result: KulturPassResult;
}) => {
if (result?.canAdd) {
this.addItemToShoppingCart(item);
} else {
this._modal.open({
content: UiMessageModalComponent,
title: 'Artikel nicht förderfähig',
data: { message: result?.message, closeAction: 'ohne Artikel fortfahren' },
data: {
message: result?.message,
closeAction: 'ohne Artikel fortfahren',
},
});
}
};
@@ -254,14 +311,18 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
addItemToShoppingCart = this.effect((item$: Observable<ItemDTO>) =>
item$.pipe(
mergeMap((item) => {
const takeAwayAvailability$ = this._availabilityService.getTakeAwayAvailability({
item: {
ean: item.product.ean,
itemId: item.id,
price: item.catalogAvailability.price,
},
quantity: this.itemQuantityByCatalogProductNumber(getCatalogProductNumber(item)) + 1,
});
const takeAwayAvailability$ =
this._availabilityService.getTakeAwayAvailability({
item: {
ean: item.product.ean,
itemId: item.id,
price: item.catalogAvailability.price,
},
quantity:
this.itemQuantityByCatalogProductNumber(
getCatalogProductNumber(item),
) + 1,
});
const deliveryAvailability$ = this._availabilityService
.getDeliveryAvailability({
@@ -270,7 +331,10 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
itemId: item.id,
price: item.catalogAvailability.price,
},
quantity: this.itemQuantityByCatalogProductNumber(getCatalogProductNumber(item)) + 1,
quantity:
this.itemQuantityByCatalogProductNumber(
getCatalogProductNumber(item),
) + 1,
})
.pipe(
catchError((err) => {
@@ -279,7 +343,10 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
);
return zip(takeAwayAvailability$, deliveryAvailability$).pipe(
tapResponse(this.handleAddItemToShoppingCartResponse2(item), this.handleAddItemToShoppingCartError),
tapResponse(
this.handleAddItemToShoppingCartResponse2(item),
this.handleAddItemToShoppingCartError,
),
);
}),
),
@@ -287,20 +354,27 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
handleAddItemToShoppingCartResponse2 =
(item: ItemDTO) =>
([takeAwayAvailability, deliveryAvailability]: [AvailabilityDTO, AvailabilityDTO]) => {
([takeAwayAvailability, deliveryAvailability]: [
AvailabilityDTO,
AvailabilityDTO,
]) => {
let isPriceMaintained = item?.catalogAvailability?.priceMaintained;
let onlinePrice = -1;
if (deliveryAvailability) {
isPriceMaintained = isPriceMaintained ?? deliveryAvailability['priceMaintained'] ?? false;
isPriceMaintained =
isPriceMaintained ?? deliveryAvailability['priceMaintained'] ?? false;
onlinePrice = deliveryAvailability?.price?.value?.value ?? -1;
}
// Preis und priceMaintained werden immer erst vom Katalog genommen. Bei nicht Verfügbarkeit greifen die anderen Availabilities
const offlinePrice =
item?.catalogAvailability?.price?.value?.value ?? takeAwayAvailability?.price?.value?.value ?? -1;
item?.catalogAvailability?.price?.value?.value ??
takeAwayAvailability?.price?.value?.value ??
-1;
const availability = takeAwayAvailability;
availability.price = item?.catalogAvailability?.price ?? takeAwayAvailability?.price;
availability.price =
item?.catalogAvailability?.price ?? takeAwayAvailability?.price;
/**
* Onlinepreis ist niedliger als der Offlinepreis
@@ -314,7 +388,11 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
* wenn der Artikel Preisgebunden ist, wird der Ladenpreis verwendet
*/
if (!!deliveryAvailability && onlinePrice < offlinePrice && !isPriceMaintained) {
if (
!!deliveryAvailability &&
onlinePrice < offlinePrice &&
!isPriceMaintained
) {
availability.price = deliveryAvailability.price;
}
@@ -333,10 +411,13 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
},
},
promotion: {
points: 0,
value: 0,
},
itemType: item.type,
product: { catalogProductNumber: getCatalogProductNumber(item), ...item.product },
product: {
catalogProductNumber: getCatalogProductNumber(item),
...item.product,
},
};
this.addItem(addToShoppingCartDTO);
@@ -346,15 +427,28 @@ export class KulturpassOrderModalStore extends ComponentStore<KulturpassOrderMod
this._modal.error('Fehler beim Hinzufügen des Artikels', err);
};
setAvailability = this.updater((state, data: { catalogProductNumber: string; availability: AvailabilityDTO }) => {
return { ...state, availabilities: { ...state.availabilities, [data.catalogProductNumber]: data.availability } };
});
setAvailability = this.updater(
(
state,
data: { catalogProductNumber: string; availability: AvailabilityDTO },
) => {
return {
...state,
availabilities: {
...state.availabilities,
[data.catalogProductNumber]: data.availability,
},
};
},
);
getAvailability(catalogProductNumber: string): AvailabilityDTO | undefined {
return this.get((state) => state.availabilities[catalogProductNumber]);
}
getAvailability$(catalogProductNumber: string): Observable<AvailabilityDTO | undefined> {
getAvailability$(
catalogProductNumber: string,
): Observable<AvailabilityDTO | undefined> {
return this.select((state) => state.availabilities[catalogProductNumber]);
}
}

View File

@@ -26,7 +26,11 @@ import {
} from './purchase-options.helpers';
import { Observable } from 'rxjs';
import { first, switchMap } from 'rxjs/operators';
import { DEFAULT_PRICE_DTO, DEFAULT_PRICE_VALUE, DEFAULT_VAT_VALUE } from '../constants';
import {
DEFAULT_PRICE_DTO,
DEFAULT_PRICE_VALUE,
DEFAULT_VAT_VALUE,
} from '../constants';
import {
AddToShoppingCartDTO,
EntityDTOContainerOfDestinationDTO,
@@ -103,7 +107,9 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
return this.get(Selectors.getPurchaseOptionsInAvailabilities);
}
getPurchaseOptionsInAvailabilities$ = this.select(Selectors.getPurchaseOptionsInAvailabilities);
getPurchaseOptionsInAvailabilities$ = this.select(
Selectors.getPurchaseOptionsInAvailabilities,
);
get itemsForList() {
return this.get(Selectors.getItemsForList);
@@ -160,29 +166,48 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
});
}
addFetchingAvailability = this.updater((state, fetchState: FetchingAvailability) => {
return {
...state,
fetchingAvailabilities: [...state.fetchingAvailabilities, fetchState],
};
});
addFetchingAvailability = this.updater(
(state, fetchState: FetchingAvailability) => {
return {
...state,
fetchingAvailabilities: [...state.fetchingAvailabilities, fetchState],
};
},
);
removeFetchingAvailability = this.updater((state, fetchState: FetchingAvailability) => {
return {
...state,
fetchingAvailabilities: state.fetchingAvailabilities.filter((f) => f.id !== fetchState.id),
};
});
removeFetchingAvailability = this.updater(
(state, fetchState: FetchingAvailability) => {
return {
...state,
fetchingAvailabilities: state.fetchingAvailabilities.filter(
(f) => f.id !== fetchState.id,
),
};
},
);
async initialize({ items, processId, type, inStoreBranch, pickupBranch }: PurchaseOptionsModalData) {
const selectedBranch = await this._service.getSelectedBranchForProcess(processId).toPromise();
async initialize({
items,
processId,
type,
inStoreBranch,
pickupBranch,
}: PurchaseOptionsModalData) {
const selectedBranch = await this._service
.getSelectedBranchForProcess(processId)
.toPromise();
const defaultBranch = await this._service.fetchDefaultBranch().toPromise();
const customerFeatures = await this._service.getCustomerFeatures(processId).toPromise();
const customerFeatures = await this._service
.getCustomerFeatures(processId)
.toPromise();
this.patchState({
processId: processId,
type: type,
items: items.map((item) => ({ ...item, quantity: item['quantity'] ?? 1 })),
items: items.map((item) => ({
...item,
quantity: item['quantity'] ?? 1,
})),
defaultBranch: selectedBranch ?? defaultBranch,
pickupBranch: pickupBranch ?? selectedBranch,
inStoreBranch: inStoreBranch ?? selectedBranch,
@@ -255,7 +280,8 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
const items = await this._catalogService
.searchByEans({ eans: this.items.map((item) => item.product.ean) })
.toPromise();
if (items.result.length > 0) await this._addCatalogueAvailabilities(items.result);
if (items.result.length > 0)
await this._addCatalogueAvailabilities(items.result);
} else {
await this._addCatalogueAvailabilities(items as ItemDTO[]);
}
@@ -264,7 +290,9 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
// #4813 - Function updated - "this.updater" didn't work, so "this.patchState" gets used instead
// Added firstDayOfSale for catalogAvailability via ShoppingCart Route
private async _addCatalogueAvailabilities(items: ItemDTO[]) {
const currentAvailabilities = await this.availabilities$.pipe(first()).toPromise();
const currentAvailabilities = await this.availabilities$
.pipe(first())
.toPromise();
const availabilities = [...currentAvailabilities];
items.forEach((item) => {
const catalogAvailability = item.catalogAvailability;
@@ -272,7 +300,10 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
purchaseOption: 'catalog',
itemId: item.id,
ean: item.product.ean, // Hier brauchen wir zusätzlich die EAN - siehe purchase-options-list-item.component.ts: "get isEVT()"
data: { price: catalogAvailability?.price, firstDayOfSale: catalogAvailability?.firstDayOfSale },
data: {
price: catalogAvailability?.price,
firstDayOfSale: catalogAvailability?.firstDayOfSale,
},
});
});
@@ -287,8 +318,14 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
const id = uniqueId('availability_');
try {
this.addFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'pickup' });
const res = await this._service.fetchPickupAvailability(itemData, itemData.quantity, branch).toPromise();
this.addFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'pickup',
});
const res = await this._service
.fetchPickupAvailability(itemData, itemData.quantity, branch)
.toPromise();
const availability: Availability = {
itemId: itemData.sourceId,
@@ -301,7 +338,11 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
console.error('_loadPickupAvailability', err);
}
this.removeFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'pickup' });
this.removeFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'pickup',
});
}
private async _loadInStoreAvailability(itemData: ItemData) {
@@ -310,8 +351,14 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
const id = uniqueId('availability_');
try {
this.addFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'in-store' });
const res = await this._service.fetchInStoreAvailability(itemData, itemData.quantity, branch).toPromise();
this.addFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'in-store',
});
const res = await this._service
.fetchInStoreAvailability(itemData, itemData.quantity, branch)
.toPromise();
const availability: Availability = {
itemId: itemData.sourceId,
@@ -324,14 +371,24 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
console.error('_loadInStoreAvailability', err);
}
this.removeFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'in-store' });
this.removeFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'in-store',
});
}
private async _loadDeliveryAvailability(itemData: ItemData) {
const id = uniqueId('availability_');
try {
this.addFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'delivery' });
const res = await this._service.fetchDeliveryAvailability(itemData, itemData.quantity).toPromise();
this.addFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'delivery',
});
const res = await this._service
.fetchDeliveryAvailability(itemData, itemData.quantity)
.toPromise();
const availability: Availability = {
itemId: itemData.sourceId,
purchaseOption: 'delivery',
@@ -343,14 +400,24 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
console.error('_loadDeliveryAvailability', error);
}
this.removeFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'delivery' });
this.removeFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'delivery',
});
}
private async _loadDigDeliveryAvailability(itemData: ItemData) {
const id = uniqueId('availability_');
try {
this.addFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'dig-delivery' });
const res = await this._service.fetchDigDeliveryAvailability(itemData, itemData.quantity).toPromise();
this.addFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'dig-delivery',
});
const res = await this._service
.fetchDigDeliveryAvailability(itemData, itemData.quantity)
.toPromise();
const availability: Availability = {
itemId: itemData.sourceId,
@@ -363,14 +430,24 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
console.error('_loadDigDeliveryAvailability', error);
}
this.removeFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'dig-delivery' });
this.removeFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'dig-delivery',
});
}
private async _loadB2bDeliveryAvailability(itemData: ItemData) {
const id = uniqueId('availability_');
try {
this.addFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'b2b-delivery' });
const res = await this._service.fetchB2bDeliveryAvailability(itemData, itemData.quantity).toPromise();
this.addFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'b2b-delivery',
});
const res = await this._service
.fetchB2bDeliveryAvailability(itemData, itemData.quantity)
.toPromise();
const availability: Availability = {
itemId: itemData.sourceId,
@@ -383,14 +460,24 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
console.error('_loadB2bDeliveryAvailability', error);
}
this.removeFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'b2b-delivery' });
this.removeFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'b2b-delivery',
});
}
private async _loadDownloadAvailability(itemData: ItemData) {
const id = uniqueId('availability_');
try {
this.addFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'download' });
const res = await this._service.fetchDownloadAvailability(itemData).toPromise();
this.addFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'download',
});
const res = await this._service
.fetchDownloadAvailability(itemData)
.toPromise();
const availability: Availability = {
itemId: itemData.sourceId,
@@ -403,7 +490,11 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
console.error('_loadDownloadAvailability', error);
}
this.removeFetchingAvailability({ id, itemId: itemData.sourceId, purchaseOption: 'download' });
this.removeFetchingAvailability({
id,
itemId: itemData.sourceId,
purchaseOption: 'download',
});
}
private _checkAndSetAvailability(availability: Availability) {
@@ -411,7 +502,9 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
const availabilities = this.availabilities;
const index = availabilities.findIndex(
(a) => a.itemId === availability.itemId && a.purchaseOption === availability.purchaseOption,
(a) =>
a.itemId === availability.itemId &&
a.purchaseOption === availability.purchaseOption,
);
if (index > -1) {
@@ -423,7 +516,11 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
this.patchState({ availabilities });
} else {
let availabilities = this.availabilities.filter(
(a) => !(a.itemId === availability.itemId && a.purchaseOption === availability.purchaseOption),
(a) =>
!(
a.itemId === availability.itemId &&
a.purchaseOption === availability.purchaseOption
),
);
this.patchState({ availabilities });
}
@@ -432,7 +529,11 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
private _addCanAddResult(canAdd: CanAdd) {
let canAddResults = this.canAddResults;
canAddResults = canAddResults.filter(
(c) => !(c.itemId === canAdd.itemId && c.purchaseOption === canAdd.purchaseOption),
(c) =>
!(
c.itemId === canAdd.itemId &&
c.purchaseOption === canAdd.purchaseOption
),
);
canAddResults.push(canAdd);
this.patchState({ canAddResults });
@@ -474,7 +575,10 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
const b2bDeliveryAvailability = this.availabilities.find(
(a) => a.itemId === item.id && a.purchaseOption === 'b2b-delivery',
);
deliveryAvailability = deliveryAvailability || digDeliveryAvailability || b2bDeliveryAvailability;
deliveryAvailability =
deliveryAvailability ||
digDeliveryAvailability ||
b2bDeliveryAvailability;
if (deliveryAvailability) {
payloads['Versand'].push(
mapToItemPayload({
@@ -487,7 +591,9 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
}
// Get Abholung availability
let pickupAvailability = this.availabilities.find((a) => a.itemId === item.id && a.purchaseOption === 'pickup');
let pickupAvailability = this.availabilities.find(
(a) => a.itemId === item.id && a.purchaseOption === 'pickup',
);
if (pickupAvailability) {
payloads['Abholung'].push(
mapToItemPayload({
@@ -519,7 +625,9 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
const itemPayloads = payloads[key];
if (itemPayloads.length > 0) {
try {
const res = await this._service.fetchCanAdd(this.processId, key, itemPayloads).toPromise();
const res = await this._service
.fetchCanAdd(this.processId, key, itemPayloads)
.toPromise();
res.forEach((canAdd) => {
const item = itemPayloads.find((i) => i.id === canAdd.id);
this._addCanAddResult({
@@ -549,7 +657,9 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
if (value && !selectedItemIds.includes(itemId)) {
this.patchState({ selectedItemIds: [...selectedItemIds, itemId] });
} else if (!value && selectedItemIds.includes(itemId)) {
this.patchState({ selectedItemIds: selectedItemIds.filter((id) => id !== itemId) });
this.patchState({
selectedItemIds: selectedItemIds.filter((id) => id !== itemId),
});
}
}
@@ -561,7 +671,9 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
canAddItem(itemId: number): boolean {
const purchaseOption = this.purchaseOption;
const canAdd = this.canAddResults.find((c) => c.itemId === itemId && c.purchaseOption === purchaseOption);
const canAdd = this.canAddResults.find(
(c) => c.itemId === itemId && c.purchaseOption === purchaseOption,
);
if (canAdd) {
return canAdd.canAdd;
@@ -574,20 +686,40 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
this.patchState({ selectedItemIds: [] });
}
getItemsThatHaveAnAvailabilityForPurchaseOption(purchaseOption: PurchaseOption): Item[] {
return this.get(Selectors.getItemsThatHaveAnAvailabilityForPurchaseOption(purchaseOption));
getItemsThatHaveAnAvailabilityForPurchaseOption(
purchaseOption: PurchaseOption,
): Item[] {
return this.get(
Selectors.getItemsThatHaveAnAvailabilityForPurchaseOption(purchaseOption),
);
}
getItemsThatHaveAnAvailabilityForPurchaseOption$(purchaseOption: PurchaseOption): Observable<Item[]> {
return this.select(Selectors.getItemsThatHaveAnAvailabilityForPurchaseOption(purchaseOption));
getItemsThatHaveAnAvailabilityForPurchaseOption$(
purchaseOption: PurchaseOption,
): Observable<Item[]> {
return this.select(
Selectors.getItemsThatHaveAnAvailabilityForPurchaseOption(purchaseOption),
);
}
getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption(purchaseOption: PurchaseOption): Item[] {
return this.get(Selectors.getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption(purchaseOption));
getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption(
purchaseOption: PurchaseOption,
): Item[] {
return this.get(
Selectors.getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption(
purchaseOption,
),
);
}
getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption$(purchaseOption: PurchaseOption): Observable<Item[]> {
return this.select(Selectors.getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption(purchaseOption));
getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption$(
purchaseOption: PurchaseOption,
): Observable<Item[]> {
return this.select(
Selectors.getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption(
purchaseOption,
),
);
}
getAvailabilitiesForItem(itemId: number): Availability[] {
@@ -679,15 +811,21 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
}
getPrice$(itemId: number) {
return this.purchaseOption$.pipe(switchMap((po) => this.getPriceForPurchaseOption$(itemId, po)));
return this.purchaseOption$.pipe(
switchMap((po) => this.getPriceForPurchaseOption$(itemId, po)),
);
}
getPriceForPurchaseOption(itemId: number, purchaseOption: PurchaseOption) {
return this.get(Selectors.getPriceForPurchaseOption(itemId, purchaseOption));
return this.get(
Selectors.getPriceForPurchaseOption(itemId, purchaseOption),
);
}
getPriceForPurchaseOption$(itemId: number, purchaseOption: PurchaseOption) {
return this.select(Selectors.getPriceForPurchaseOption(itemId, purchaseOption));
return this.select(
Selectors.getPriceForPurchaseOption(itemId, purchaseOption),
);
}
getCanEditPrice(itemId: number) {
@@ -748,27 +886,51 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
}
getCanAddResultForItemAndCurrentPurchaseOption(itemId: number) {
return this.get(Selectors.getCanAddResultForItemAndCurrentPurchaseOption(itemId));
return this.get(
Selectors.getCanAddResultForItemAndCurrentPurchaseOption(itemId),
);
}
getCanAddResultForItemAndCurrentPurchaseOption$(itemId: number) {
return this.select(Selectors.getCanAddResultForItemAndCurrentPurchaseOption(itemId));
return this.select(
Selectors.getCanAddResultForItemAndCurrentPurchaseOption(itemId),
);
}
getAvailabilityWithPurchaseOption(itemId: number, purchaseOption: PurchaseOption) {
return this.get(Selectors.getAvailabilityWithPurchaseOption(itemId, purchaseOption));
getAvailabilityWithPurchaseOption(
itemId: number,
purchaseOption: PurchaseOption,
) {
return this.get(
Selectors.getAvailabilityWithPurchaseOption(itemId, purchaseOption),
);
}
getAvailabilityWithPurchaseOption$(itemId: number, purchaseOption: PurchaseOption) {
return this.select(Selectors.getAvailabilityWithPurchaseOption(itemId, purchaseOption));
getAvailabilityWithPurchaseOption$(
itemId: number,
purchaseOption: PurchaseOption,
) {
return this.select(
Selectors.getAvailabilityWithPurchaseOption(itemId, purchaseOption),
);
}
getCanAddResultWithPurchaseOption(itemId: number, purchaseOption: PurchaseOption) {
return this.get(Selectors.getCanAddResultWithPurchaseOption(itemId, purchaseOption));
getCanAddResultWithPurchaseOption(
itemId: number,
purchaseOption: PurchaseOption,
) {
return this.get(
Selectors.getCanAddResultWithPurchaseOption(itemId, purchaseOption),
);
}
getCanAddResultWithPurchaseOption$(itemId: number, purchaseOption: PurchaseOption) {
return this.select(Selectors.getCanAddResultWithPurchaseOption(itemId, purchaseOption));
getCanAddResultWithPurchaseOption$(
itemId: number,
purchaseOption: PurchaseOption,
) {
return this.select(
Selectors.getCanAddResultWithPurchaseOption(itemId, purchaseOption),
);
}
addItemsToShoppingCart() {
@@ -777,10 +939,16 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
}
}
getAddToShoppingCartDTOForItem(itemId: number, purchaseOption: PurchaseOption): AddToShoppingCartDTO {
getAddToShoppingCartDTOForItem(
itemId: number,
purchaseOption: PurchaseOption,
): AddToShoppingCartDTO {
const item = this.items.find((i) => i.id === itemId);
const price = this.getPriceForPurchaseOption(itemId, this.purchaseOption);
const availability = this.getAvailabilityWithPurchaseOption(itemId, purchaseOption);
const availability = this.getAvailabilityWithPurchaseOption(
itemId,
purchaseOption,
);
if (!isItemDTO(item, this.type)) {
throw new Error('Invalid item');
@@ -802,8 +970,12 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
availability: { ...availability.data, price },
destination,
itemType: item.type,
product: { ...item.product, catalogProductNumber: item?.product?.catalogProductNumber ?? String(item.id) },
promotion: { points: item.promoPoints },
product: {
...item.product,
catalogProductNumber:
item?.product?.catalogProductNumber ?? String(item.id),
},
promotion: { value: item.promoPoints },
// retailPrice: {
// value: price.value.value,
// currency: price.value.currency,
@@ -813,10 +985,16 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
};
}
getUpdateShoppingCartItemDTOForItem(itemId: number, purchaseOption: PurchaseOption): UpdateShoppingCartItemDTO {
getUpdateShoppingCartItemDTOForItem(
itemId: number,
purchaseOption: PurchaseOption,
): UpdateShoppingCartItemDTO {
const item = this.items.find((i) => i.id === itemId);
const price = this.getPriceForPurchaseOption(itemId, this.purchaseOption);
const availability = this.getAvailabilityWithPurchaseOption(itemId, purchaseOption);
const availability = this.getAvailabilityWithPurchaseOption(
itemId,
purchaseOption,
);
if (!isShoppingCartItemDTO(item, this.type)) {
throw new Error('Invalid item');
@@ -856,7 +1034,9 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
const payloads = this.selectedItemIds.map((itemId) =>
this.getAddToShoppingCartDTOForItem(itemId, purchaseOption),
);
await this._service.addItemToShoppingCart(this.processId, payloads).toPromise();
await this._service
.addItemToShoppingCart(this.processId, payloads)
.toPromise();
} else if (type === 'update') {
const payloads = this.selectedItemIds.map((itemId) =>
this.getUpdateShoppingCartItemDTOForItem(itemId, purchaseOption),
@@ -864,8 +1044,13 @@ export class PurchaseOptionsStore extends ComponentStore<PurchaseOptionsState> {
for (const itemId of this.selectedItemIds) {
const item = this.items.find((i) => i.id === itemId);
const payload = this.getUpdateShoppingCartItemDTOForItem(itemId, purchaseOption);
await this._service.updateItemInShoppingCart(this.processId, item.id, payload).toPromise();
const payload = this.getUpdateShoppingCartItemDTOForItem(
itemId,
purchaseOption,
);
await this._service
.updateItemInShoppingCart(this.processId, item.id, payload)
.toPromise();
}
} else {
throw new Error('Invalid type');

View File

@@ -22,12 +22,21 @@ import { UiErrorModalComponent, UiModalService } from '@ui/modal';
import { CacheService } from '@core/cache';
import { isEqual } from 'lodash';
import { BehaviorSubject, combineLatest, Subscription } from 'rxjs';
import { debounceTime, first, map, switchMap, withLatestFrom } from 'rxjs/operators';
import {
debounceTime,
first,
map,
switchMap,
withLatestFrom,
} from 'rxjs/operators';
import { ArticleSearchService } from '../article-search.store';
import { AddedToCartModalComponent } from './added-to-cart-modal/added-to-cart-modal.component';
import { SearchResultItemComponent } from './search-result-item.component';
import { ProductCatalogNavigationService } from '@shared/services/navigation';
import { Filter, FilterInputGroupMainComponent } from '@shared/components/filter';
import {
Filter,
FilterInputGroupMainComponent,
} from '@shared/components/filter';
import { DomainAvailabilityService, ItemData } from '@domain/availability';
import { asapScheduler } from 'rxjs';
import { ShellService } from '@shared/shell';
@@ -39,8 +48,11 @@ import { ShellService } from '@shared/shell';
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
})
export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterViewInit {
@ViewChildren(SearchResultItemComponent) listItems: QueryList<SearchResultItemComponent>;
export class ArticleSearchResultsComponent
implements OnInit, OnDestroy, AfterViewInit
{
@ViewChildren(SearchResultItemComponent)
listItems: QueryList<SearchResultItemComponent>;
@ViewChild(CdkVirtualScrollViewport, { static: false })
scrollContainer: CdkVirtualScrollViewport;
@@ -59,7 +71,9 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
selectedItems$ = combineLatest([this.results$, this.selectedItemIds$]).pipe(
map(([items, selectedItemIds]) => {
return items?.filter((item) => selectedItemIds?.find((selectedItemId) => item.id === selectedItemId));
return items?.filter((item) =>
selectedItemIds?.find((selectedItemId) => item.id === selectedItemId),
);
}),
);
@@ -81,7 +95,10 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
return this._environment.matchDesktopLarge();
}
hasFilter$ = combineLatest([this.searchService.filter$, this.searchService.defaultSettings$]).pipe(
hasFilter$ = combineLatest([
this.searchService.filter$,
this.searchService.defaultSettings$,
]).pipe(
map(([filter, defaultFilter]) => {
const filterQueryParams = filter?.getQueryParams();
return !isEqual(
@@ -100,11 +117,15 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
}
get filterQueryParams() {
return this.cleanupQueryParams(this.searchService?.filter?.getQueryParams());
return this.cleanupQueryParams(
this.searchService?.filter?.getQueryParams(),
);
}
get primaryOutletActive$() {
return this._environment.matchDesktop$.pipe(map((matches) => matches && this.route.outlet === 'primary'));
return this._environment.matchDesktop$.pipe(
map((matches) => matches && this.route.outlet === 'primary'),
);
}
private readonly SCROLL_INDEX_TOKEN = 'CATALOG_RESULTS_LIST_SCROLL_INDEX';
@@ -129,28 +150,42 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
ngOnInit() {
this.subscriptions.add(
combineLatest([this.application.activatedProcessId$, this.route.queryParams])
combineLatest([
this.application.activatedProcessId$,
this.route.queryParams,
])
.pipe(
debounceTime(0),
switchMap(([processId, queryParams]) =>
this.application
.getSelectedBranch$(processId)
.pipe(map((selectedBranch) => ({ processId, queryParams, selectedBranch }))),
this.application.getSelectedBranch$(processId).pipe(
map((selectedBranch) => ({
processId,
queryParams,
selectedBranch,
})),
),
),
)
.subscribe(async ({ processId, queryParams, selectedBranch }) => {
const processChanged = processId !== this.searchService.processId;
const branchChanged = selectedBranch?.id !== this.searchService?.selectedBranch?.id;
const branchChanged =
selectedBranch?.id !== this.searchService?.selectedBranch?.id;
if (processChanged) {
if (!!this.searchService.processId && this.searchService.filter instanceof Filter) {
if (
!!this.searchService.processId &&
this.searchService.filter instanceof Filter
) {
this.cacheCurrentData(
this.searchService.processId,
this.searchService.filter.getQueryParams(),
this.searchService?.selectedBranch?.id,
);
this.updateBreadcrumbs(this.searchService.processId, this.searchService.filter.getQueryParams());
this.updateBreadcrumbs(
this.searchService.processId,
this.searchService.filter.getQueryParams(),
);
}
this.searchService.setProcess(processId);
}
@@ -169,9 +204,20 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
this.scrollToItem(await this._getScrollIndexFromCache());
}
if (!isEqual(cleanQueryParams, this.cleanupQueryParams(this.searchService.filter.getQueryParams()))) {
if (
!isEqual(
cleanQueryParams,
this.cleanupQueryParams(
this.searchService.filter.getQueryParams(),
),
)
) {
await this.searchService.setDefaultFilter(queryParams);
const data = await this.getCachedData(processId, queryParams, selectedBranch?.id);
const data = await this.getCachedData(
processId,
queryParams,
selectedBranch?.id,
);
if (data.items?.length > 0) {
this.searchService.setItems(data.items);
@@ -179,21 +225,29 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
}
if (
data.items?.length === 0 &&
this.route?.parent?.children?.find((childRoute) => childRoute?.outlet === 'side')?.snapshot?.routeConfig
?.path !== 'filter'
this.route?.parent?.children?.find(
(childRoute) => childRoute?.outlet === 'side',
)?.snapshot?.routeConfig?.path !== 'filter'
) {
this.search({ clear: true });
} else {
const selectedItemIds: Array<string> = queryParams?.selected_item_ids?.split(',') ?? [];
const selectedItemIds: Array<string> =
queryParams?.selected_item_ids?.split(',') ?? [];
for (const id of selectedItemIds) {
if (id) {
this.searchService.setSelected({ selected: true, itemId: Number(id) });
this.searchService.setSelected({
selected: true,
itemId: Number(id),
});
}
}
}
}
const process = await this.application.getProcessById$(processId).pipe(first()).toPromise();
const process = await this.application
.getProcessById$(processId)
.pipe(first())
.toPromise();
if (process) {
await this.updateBreadcrumbs(processId, queryParams);
await this.createBreadcrumb(processId, queryParams);
@@ -240,7 +294,10 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
})
.navigate();
}
} else if (searchCompleted?.clear || this.route.outlet === 'primary') {
} else if (
searchCompleted?.clear ||
this.route.outlet === 'primary'
) {
const ean = this.route?.snapshot?.params?.ean;
if (ean) {
@@ -253,7 +310,9 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
.navigate();
} else {
await this._navigationService
.getArticleSearchResultsPath(processId, { queryParams: params })
.getArticleSearchResultsPath(processId, {
queryParams: params,
})
.navigate();
}
}
@@ -266,7 +325,9 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
this.searchService.searchStarted.subscribe(async (options) => {
if (!options?.clear) {
const queryParams = {
...this.cleanupQueryParams(this.searchService.filter.getQueryParams()),
...this.cleanupQueryParams(
this.searchService.filter.getQueryParams(),
),
main_qs: this.sharedFilterInputGroupMain?.uiInput?.value,
};
@@ -281,11 +342,19 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
}
private _addScrollIndexToCache(index: number): void {
this.cache.set<number>({ processId: this.getProcessId(), token: this.SCROLL_INDEX_TOKEN }, index);
this.cache.set<number>(
{ processId: this.getProcessId(), token: this.SCROLL_INDEX_TOKEN },
index,
);
}
private async _getScrollIndexFromCache(): Promise<number> {
return (await this.cache.get<number>({ processId: this.getProcessId(), token: this.SCROLL_INDEX_TOKEN })) ?? 0;
return (
(await this.cache.get<number>({
processId: this.getProcessId(),
token: this.SCROLL_INDEX_TOKEN,
})) ?? 0
);
}
async scrollToItem(i?: number) {
@@ -303,12 +372,14 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
}
scrolledIndexChange(index: number) {
const completeListFetched = this.searchService.items.length === this.searchService.hits;
const completeListFetched =
this.searchService.items.length === this.searchService.hits;
if (
index &&
!completeListFetched &&
this.searchService.items.length <= this.scrollContainer?.getRenderedRange()?.end
this.searchService.items.length <=
this.scrollContainer?.getRenderedRange()?.end
) {
this.search({ clear: false });
}
@@ -326,7 +397,10 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
this.searchService.filter.getQueryParams(),
this.searchService?.selectedBranch?.id,
);
await this.updateBreadcrumbs(this.searchService.processId, this.searchService.filter.getQueryParams());
await this.updateBreadcrumbs(
this.searchService.processId,
this.searchService.filter.getQueryParams(),
);
this.unselectAll();
}
@@ -345,7 +419,15 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
return clean;
}
search({ filter, clear = false, orderBy = false }: { filter?: Filter; clear?: boolean; orderBy?: boolean }) {
search({
filter,
clear = false,
orderBy = false,
}: {
filter?: Filter;
clear?: boolean;
orderBy?: boolean;
}) {
if (filter) {
this.sharedFilterInputGroupMain.cancelAutocomplete();
}
@@ -354,19 +436,28 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
}
getDetailsPath(itemId: number) {
return this._navigationService.getArticleDetailsPath({ processId: this.application.activatedProcessId, itemId })
.path;
return this._navigationService.getArticleDetailsPath({
processId: this.application.activatedProcessId,
itemId,
}).path;
}
async updateBreadcrumbs(
processId: number = this.searchService.processId,
queryParams: Record<string, string> = this.searchService.filter?.getQueryParams(),
queryParams: Record<
string,
string
> = this.searchService.filter?.getQueryParams(),
) {
const selected_item_ids = this.searchService?.selectedItemIds?.toString();
if (queryParams) {
const crumbs = await this.breadcrumb
.getBreadcrumbsByKeyAndTags$(processId, ['catalog', 'filter', 'results'])
.getBreadcrumbsByKeyAndTags$(processId, [
'catalog',
'filter',
'results',
])
.pipe(first())
.toPromise();
@@ -382,13 +473,18 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
}
}
async createBreadcrumb(processId: number, queryParams: Record<string, string>) {
async createBreadcrumb(
processId: number,
queryParams: Record<string, string>,
) {
if (queryParams) {
const name = queryParams.main_qs ? queryParams.main_qs : 'Alle Artikel';
await this.breadcrumb.addBreadcrumbIfNotExists({
key: processId,
name,
path: this._navigationService.getArticleSearchResultsPath(processId, { queryParams }).path,
path: this._navigationService.getArticleSearchResultsPath(processId, {
queryParams,
}).path,
params: queryParams,
section: 'customer',
tags: ['catalog', 'filter', 'results'],
@@ -405,8 +501,16 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
crumbs?.forEach((crumb) => this.breadcrumb.removeBreadcrumb(crumb.id));
}
cacheCurrentData(processId: number, params: Record<string, string> = {}, branchId: number) {
const qparams = this.cleanupQueryParams({ ...params, processId: String(processId), branchId: String(branchId) });
cacheCurrentData(
processId: number,
params: Record<string, string> = {},
branchId: number,
) {
const qparams = this.cleanupQueryParams({
...params,
processId: String(processId),
branchId: String(branchId),
});
this.cache.set(qparams, {
items: this.searchService.items,
@@ -414,8 +518,16 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
});
}
async getCachedData(processId: number, params: Record<string, string> = {}, branchId: number) {
const qparams = this.cleanupQueryParams({ ...params, processId: String(processId), branchId: String(branchId) });
async getCachedData(
processId: number,
params: Record<string, string> = {},
branchId: number,
) {
const qparams = this.cleanupQueryParams({
...params,
processId: String(processId),
branchId: String(branchId),
});
const cacheData = await this.cache.get<{
items: ItemDTO[];
hits: number;
@@ -452,7 +564,12 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
}
unselectAll() {
this.listItems.forEach((listItem) => this.searchService.setSelected({ selected: false, itemId: listItem.item.id }));
this.listItems.forEach((listItem) =>
this.searchService.setSelected({
selected: false,
itemId: listItem.item.id,
}),
);
this.searchService.patchState({ selectedItemIds: [] });
}
@@ -474,39 +591,46 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
availability: {
availabilityType: item?.catalogAvailability?.status,
price: item?.catalogAvailability?.price,
supplierProductNumber: item?.ids?.dig ? String(item?.ids?.dig) : item?.product?.supplierProductNumber,
supplierProductNumber: item?.ids?.dig
? String(item?.ids?.dig)
: item?.product?.supplierProductNumber,
},
product: {
catalogProductNumber: String(item?.id),
...item?.product,
},
itemType: item?.type,
promotion: { points: item?.promoPoints },
promotion: { value: item?.promoPoints },
};
}
async addItemsToCart(item?: ItemDTO) {
const selectedItems = !item ? await this.selectedItems$.pipe(first()).toPromise() : [item];
const selectedItems = !item
? await this.selectedItems$.pipe(first()).toPromise()
: [item];
const items: AddToShoppingCartDTO[] = [];
const canAddItemsPayload = [];
for (const item of selectedItems) {
const isDownload = item?.product?.format === 'EB' || item?.product?.format === 'DL';
const isDownload =
item?.product?.format === 'EB' || item?.product?.format === 'DL';
const price = item?.catalogAvailability?.price;
const shoppingCartItem: AddToShoppingCartDTO = {
quantity: 1,
availability: {
availabilityType: item?.catalogAvailability?.status,
price,
supplierProductNumber: item?.ids?.dig ? String(item.ids?.dig) : item?.product?.supplierProductNumber,
supplierProductNumber: item?.ids?.dig
? String(item.ids?.dig)
: item?.product?.supplierProductNumber,
},
product: {
catalogProductNumber: String(item?.id),
...item?.product,
},
itemType: item.type,
promotion: { points: item?.promoPoints },
promotion: { value: item?.promoPoints },
};
if (isDownload) {
@@ -519,9 +643,14 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
.getDownloadAvailability({ item: downloadItem })
.pipe(first())
.toPromise();
shoppingCartItem.destination = { data: { target: 16, logistician: downloadAvailability?.logistician } };
shoppingCartItem.destination = {
data: { target: 16, logistician: downloadAvailability?.logistician },
};
if (downloadAvailability) {
shoppingCartItem.availability = { ...shoppingCartItem.availability, ...downloadAvailability };
shoppingCartItem.availability = {
...shoppingCartItem.availability,
...downloadAvailability,
};
}
canAddItemsPayload.push({
availabilities: [{ ...item.catalogAvailability, format: 'DL' }],
@@ -546,7 +675,10 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
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 });
this.openModal({
itemLength: cantAdd.length,
canAddMessage: cantAdd[0].message,
});
return;
}
}
@@ -571,7 +703,15 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
}
}
openModal({ itemLength, canAddMessage, error }: { itemLength: number; canAddMessage?: string; error?: Error }) {
openModal({
itemLength,
canAddMessage,
error,
}: {
itemLength: number;
canAddMessage?: string;
error?: Error;
}) {
const modal = this._uiModal.open({
title:
!error && !canAddMessage

View File

@@ -114,15 +114,21 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
readonly processId$ = this._application.activatedProcessId$;
readonly customer$ = this.processId$.pipe(switchMap((processId) => this._checkoutService.getBuyer({ processId })));
readonly customer$ = this.processId$.pipe(
switchMap((processId) => this._checkoutService.getBuyer({ processId })),
);
readonly customerFeatures$ = this.processId$.pipe(
switchMap((processId) => this._checkoutService.getCustomerFeatures({ processId })),
switchMap((processId) =>
this._checkoutService.getCustomerFeatures({ processId }),
),
);
readonly customerFilter$ = this.customerFeatures$.pipe(
withLatestFrom(this.processId$),
switchMap(([customerFeatures, processId]) => this._checkoutService.canSetCustomer({ processId, customerFeatures })),
switchMap(([customerFeatures, processId]) =>
this._checkoutService.canSetCustomer({ processId, customerFeatures }),
),
map((res) => res.filter),
);
@@ -169,7 +175,11 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
tapResponse(
(res) => {
const item = res.result[0];
if (!!item && item?.product?.format !== 'EB' && item?.product?.format !== 'DL') {
if (
!!item &&
item?.product?.format !== 'EB' &&
item?.product?.format !== 'DL'
) {
this.patchState({
item: res.result[0],
message: '',
@@ -229,12 +239,22 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
updateCart = this.effect((cb$: Observable<Function>) =>
cb$.pipe(
tap((_) => this.patchState({ fetching: true })),
withLatestFrom(this.processId$, this.addToCartItem$, this.shoppingCartItemId$),
withLatestFrom(
this.processId$,
this.addToCartItem$,
this.shoppingCartItemId$,
),
switchMap(([cb, processId, newItem, shoppingCartItemId]) => {
const availability = newItem.availability;
const quantity = newItem.quantity;
const destination = newItem.destination;
return this.updateCartRequest({ processId, shoppingCartItemId, availability, quantity, destination }).pipe(
return this.updateCartRequest({
processId,
shoppingCartItemId,
availability,
quantity,
destination,
}).pipe(
tapResponse(
(res) => {
this.patchState({
@@ -270,7 +290,10 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
}
addToCartRequest(processId: number, newItem: AddToShoppingCartDTO) {
return this._checkoutService.addItemToShoppingCart({ processId, items: [newItem] });
return this._checkoutService.addItemToShoppingCart({
processId,
items: [newItem],
});
}
updateCartRequest({
@@ -297,7 +320,11 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
});
}
async createAddToCartItem(control: UntypedFormGroup, branch: BranchDTO, update?: boolean) {
async createAddToCartItem(
control: UntypedFormGroup,
branch: BranchDTO,
update?: boolean,
) {
let item: ItemDTO;
const quantity = Number(control.get('quantity').value);
const price = this._createPriceDTO(control);
@@ -305,7 +332,11 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
// Check if item exists or ean inside the control changed in the meantime
if (!!this.item && this.item.product.ean === control.get('ean').value) {
item = this.item;
promoPoints = await this._getPromoPoints({ itemId: item.id, quantity, price: price.value.value });
promoPoints = await this._getPromoPoints({
itemId: item.id,
quantity,
price: price.value.value,
});
} else {
item = undefined;
}
@@ -316,21 +347,33 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
quantity,
availability,
product,
promotion: item ? { points: promoPoints } : undefined,
promotion: item ? { value: promoPoints } : undefined,
destination: {
data: { target: 1, targetBranch: { id: branch?.id } },
},
itemType: this.item?.type ?? this.get((s) => s.shoppingCartItem)?.itemType,
itemType:
this.item?.type ?? this.get((s) => s.shoppingCartItem)?.itemType,
};
if (update) {
const existingItem = this.get((s) => s.shoppingCartItem);
this.patchState({ addToCartItem: newItem, shoppingCartItemId: existingItem?.id });
this.patchState({
addToCartItem: newItem,
shoppingCartItemId: existingItem?.id,
});
}
this.patchState({ addToCartItem: newItem });
}
private async _getPromoPoints({ itemId, quantity, price }: { itemId: number; quantity: number; price: number }) {
private async _getPromoPoints({
itemId,
quantity,
price,
}: {
itemId: number;
quantity: number;
price: number;
}) {
let points: number;
try {
points = await this._catalogService
@@ -371,7 +414,13 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
};
}
private _createAvailabilityDTO({ price, control }: { price: PriceDTO; control: UntypedFormGroup }): AvailabilityDTO {
private _createAvailabilityDTO({
price,
control,
}: {
price: PriceDTO;
control: UntypedFormGroup;
}): AvailabilityDTO {
return {
availabilityType: 1024,
supplier: {
@@ -383,7 +432,13 @@ export class CheckoutDummyStore extends ComponentStore<CheckoutDummyState> {
};
}
private _createProductDTO({ item, control }: { item?: ItemDTO; control: UntypedFormGroup }): ProductDTO {
private _createProductDTO({
item,
control,
}: {
item?: ItemDTO;
control: UntypedFormGroup;
}): ProductDTO {
const formValues: Partial<ProductDTO> = {
ean: control.get('ean').value,
name: control.get('name').value,

View File

@@ -1,7 +1,9 @@
<shared-loader [loading]="fetching$ | async" background="true" spinnerSize="32">
<div class="overflow-scroll max-h-[calc(100vh-15rem)]">
<div class="customer-details-header grid grid-flow-row pb-6">
<div class="customer-details-header-actions flex flex-row justify-end pt-4 px-4">
<div
class="customer-details-header-actions flex flex-row justify-end pt-4 px-4"
>
<page-customer-menu
[customerId]="customerId$ | async"
[processId]="processId$ | async"
@@ -16,8 +18,12 @@
<p>Sind Ihre Kundendaten korrekt?</p>
</div>
</div>
<div class="customer-details-customer-type flex flex-row justify-between items-center bg-surface-2 text-surface-2-content h-14">
<div class="pl-4 font-bold grid grid-flow-col justify-start items-center gap-2">
<div
class="customer-details-customer-type flex flex-row justify-between items-center bg-surface-2 text-surface-2-content h-14"
>
<div
class="pl-4 font-bold grid grid-flow-col justify-start items-center gap-2"
>
<shared-icon [icon]="customerType$ | async"></shared-icon>
<span>
{{ customerType$ | async }}
@@ -30,19 +36,22 @@
[queryParams]="editRoute.queryParams"
[queryParamsHandling]="'merge'"
class="btn btn-label font-bold text-brand"
>
>
Bearbeiten
</a>
}
}
</div>
<div class="customer-details-customer-main-data px-5 py-3 grid grid-flow-row gap-3">
<div
class="customer-details-customer-main-data px-5 py-3 grid grid-flow-row gap-3"
>
<div class="flex flex-row">
<div class="data-label">Erstellungsdatum</div>
@if (created$ | async; as created) {
<div class="data-value">
{{ created | date: 'dd.MM.yyyy' }} | {{ created | date: 'HH:mm' }} Uhr
{{ created | date: 'dd.MM.yyyy' }} |
{{ created | date: 'HH:mm' }} Uhr
</div>
}
</div>
@@ -136,7 +145,9 @@
@if (!(isBusinessKonto$ | async)) {
<div class="customer-details-customer-main-row">
<div class="data-label">Geburtstag</div>
<div class="data-value">{{ dateOfBirth$ | async | date: 'dd.MM.yyyy' }}</div>
<div class="data-value">
{{ dateOfBirth$ | async | date: 'dd.MM.yyyy' }}
</div>
</div>
}
@if (!(isBusinessKonto$ | async) && (organisationName$ | async)) {
@@ -162,24 +173,41 @@
</div>
</shared-loader>
@if (shoppingCartHasNoItems$ | async) {
<button
type="button"
(click)="continue()"
class="text-white text-lg bg-brand rounded-full px-5 py-3 absolute top-[calc(100vh-19.375rem)] left-1/2 -translate-x-1/2 font-bold disabled:bg-inactive-branch"
[disabled]="showLoader$ | async"
@if (!isRewardTab()) {
@if (shoppingCartHasNoItems$ | async) {
<button
type="button"
(click)="continue()"
class="text-white text-lg bg-brand rounded-full px-5 py-3 absolute top-[calc(100vh-19.375rem)] left-1/2 -translate-x-1/2 font-bold disabled:bg-inactive-branch"
[disabled]="showLoader$ | async"
>
<shared-loader [loading]="showLoader$ | async" spinnerSize="32">Weiter zur Artikelsuche</shared-loader>
</button>
}
<shared-loader [loading]="showLoader$ | async" spinnerSize="32"
>Weiter zur Artikelsuche</shared-loader
>
</button>
}
@if (shoppingCartHasItems$ | async) {
@if (shoppingCartHasItems$ | async) {
<button
type="button"
(click)="continue()"
class="text-white text-lg bg-brand rounded-full px-5 py-3 absolute top-[calc(100vh-19.375rem)] left-1/2 -translate-x-1/2 font-bold disabled:bg-inactive-branch"
[disabled]="showLoader$ | async"
>
<shared-loader [loading]="showLoader$ | async" spinnerSize="32"
>Weiter zum Warenkorb</shared-loader
>
</button>
}
} @else {
<button
type="button"
(click)="continue()"
class="text-white text-lg bg-brand rounded-full px-5 py-3 absolute top-[calc(100vh-19.375rem)] left-1/2 -translate-x-1/2 font-bold disabled:bg-inactive-branch"
[disabled]="showLoader$ | async"
class="w-60 text-white text-lg bg-brand rounded-full px-5 py-3 absolute top-[calc(100vh-19.375rem)] left-1/2 -translate-x-1/2 font-bold disabled:bg-inactive-branch"
[disabled]="!(hasKundenkarte$ | async)"
>
<shared-loader [loading]="showLoader$ | async" spinnerSize="32"
>Auswählen</shared-loader
>
<shared-loader [loading]="showLoader$ | async" spinnerSize="32">Weiter zum Warenkorb</shared-loader>
</button>
}

View File

@@ -1,4 +1,11 @@
import { Component, ChangeDetectionStrategy, OnInit, OnDestroy, inject } from '@angular/core';
import {
Component,
ChangeDetectionStrategy,
OnInit,
OnDestroy,
inject,
linkedSignal,
} from '@angular/core';
import { Subject, combineLatest } from 'rxjs';
import { first, map, switchMap, takeUntil } from 'rxjs/operators';
import { CustomerSearchNavigation } from '@shared/services/navigation';
@@ -19,12 +26,18 @@ import {
import { UiModalService } from '@ui/modal';
import { ComponentStore } from '@ngrx/component-store';
import { ApplicationService } from '@core/application';
import { CheckoutNavigationService, ProductCatalogNavigationService } from '@shared/services/navigation';
import {
CheckoutNavigationService,
ProductCatalogNavigationService,
} from '@shared/services/navigation';
import { ActivatedRoute, Router } from '@angular/router';
import { log, logAsync } from '@utils/common';
import { CrmCustomerService } from '@domain/crm';
import { MessageModalComponent, MessageModalData } from '@modal/message';
import { GenderSettingsService } from '@shared/services/gender';
import { injectTab } from '@isa/core/tabs';
import { toSignal } from '@angular/core/rxjs-interop';
import { SelectedCustomerFacade } from '@isa/crm/data-access';
export interface CustomerDetailsViewMainState {
isBusy: boolean;
@@ -57,62 +70,105 @@ export class CustomerDetailsViewMainComponent
private _onDestroy$ = new Subject<void>();
customerService = inject(CrmCustomerService);
selectCustomerFacade = inject(SelectedCustomerFacade);
tab = injectTab();
fetching$ = combineLatest([this._store.fetchingCustomer$, this._store.fetchingCustomerList$]).pipe(
fetching$ = combineLatest([
this._store.fetchingCustomer$,
this._store.fetchingCustomerList$,
]).pipe(
map(([fetchingCustomer, fetchingList]) => fetchingCustomer || fetchingList),
);
isBusy$ = this.select((s) => s.isBusy);
showLoader$ = combineLatest([this.fetching$, this.isBusy$]).pipe(map(([fetching, isBusy]) => fetching || isBusy));
showLoader$ = combineLatest([this.fetching$, this.isBusy$]).pipe(
map(([fetching, isBusy]) => fetching || isBusy),
);
processId$ = this._store.processId$;
processIdSignal = toSignal(this.processId$);
customerId$ = this._store.customerId$;
historyRoute$ = combineLatest([this.processId$, this.customerId$]).pipe(
map(([processId, customerId]) => this._navigation.historyRoute({ processId, customerId })),
map(([processId, customerId]) =>
this._navigation.historyRoute({ processId, customerId }),
),
);
ordersRoute$ = combineLatest([this.processId$, this.customerId$]).pipe(
map(([processId, customerId]) => this._navigation.ordersRoute({ processId, customerId })),
map(([processId, customerId]) =>
this._navigation.ordersRoute({ processId, customerId }),
),
);
isB2b$ = this._store.isBusinessKonto$;
editRoute$ = combineLatest([this.processId$, this.customerId$, this.isB2b$]).pipe(
map(([processId, customerId, isB2b]) => this._navigation.editRoute({ processId, customerId, isB2b })),
);
showEditButton$ = combineLatest([this._store.isOnlinekonto$, this._store.isBestellungOhneKonto$]).pipe(
map(([isOnlinekonto, isBestellungOhneKonto]) => !isOnlinekonto && !isBestellungOhneKonto),
);
hasKundenkarte$ = combineLatest([this._store.isKundenkarte$, this._store.isOnlineKontoMitKundenkarte$]).pipe(
map(([isKundenkarte, isOnlineKontoMitKundenkarte]) => isKundenkarte || isOnlineKontoMitKundenkarte),
);
kundenkarteRoute$ = combineLatest([this.hasKundenkarte$, this.processId$, this.customerId$]).pipe(
map(([hasKundenkarte, processId, customerId]) =>
hasKundenkarte ? this._navigation.kundenkarteRoute({ processId, customerId }) : undefined,
editRoute$ = combineLatest([
this.processId$,
this.customerId$,
this.isB2b$,
]).pipe(
map(([processId, customerId, isB2b]) =>
this._navigation.editRoute({ processId, customerId, isB2b }),
),
);
customerType$ = this._store.select((s) => s.customer?.features?.find((f) => f.enabled)?.description);
showEditButton$ = combineLatest([
this._store.isOnlinekonto$,
this._store.isBestellungOhneKonto$,
]).pipe(
map(
([isOnlinekonto, isBestellungOhneKonto]) =>
!isOnlinekonto && !isBestellungOhneKonto,
),
);
hasKundenkarte$ = combineLatest([
this._store.isKundenkarte$,
this._store.isOnlineKontoMitKundenkarte$,
]).pipe(
map(
([isKundenkarte, isOnlineKontoMitKundenkarte]) =>
isKundenkarte || isOnlineKontoMitKundenkarte,
),
);
kundenkarteRoute$ = combineLatest([
this.hasKundenkarte$,
this.processId$,
this.customerId$,
]).pipe(
map(([hasKundenkarte, processId, customerId]) =>
hasKundenkarte
? this._navigation.kundenkarteRoute({ processId, customerId })
: undefined,
),
);
customerType$ = this._store.select(
(s) => s.customer?.features?.find((f) => f.enabled)?.description,
);
created$ = this._store.select((s) => s.customer?.created);
customerNumber$ = this._store.select((s) => s.customer?.customerNumber);
customerNumberDig$ = this._store.select(
(s) => s.customer?.linkedRecords?.find((r) => r.repository === 'dig')?.number,
(s) =>
s.customer?.linkedRecords?.find((r) => r.repository === 'dig')?.number,
);
customerNumberBeeline$ = this._store.select(
(s) => s.customer?.linkedRecords?.find((r) => r.repository === 'beeline')?.number,
(s) =>
s.customer?.linkedRecords?.find((r) => r.repository === 'beeline')
?.number,
);
gender$ = this._store.select((s) => this._genderSettings.getGenderByValue(s.customer?.gender));
gender$ = this._store.select((s) =>
this._genderSettings.getGenderByValue(s.customer?.gender),
);
title$ = this._store.select((s) => s.customer?.title);
@@ -134,7 +190,9 @@ export class CustomerDetailsViewMainComponent
info$ = this._store.select((s) => s.customer?.address?.info);
landline$ = this._store.select((s) => s.customer?.communicationDetails?.phone);
landline$ = this._store.select(
(s) => s.customer?.communicationDetails?.phone,
);
mobile$ = this._store.select((s) => s.customer?.communicationDetails?.mobile);
@@ -148,7 +206,9 @@ export class CustomerDetailsViewMainComponent
shoppingCartHasItems$ = this.select((s) => s.shoppingCart?.items?.length > 0);
shoppingCartHasNoItems$ = this.shoppingCartHasItems$.pipe(map((hasItems) => !hasItems));
shoppingCartHasNoItems$ = this.shoppingCartHasItems$.pipe(
map((hasItems) => !hasItems),
);
dateOfBirth$ = this._store.select((s) => s.customer?.dateOfBirth);
@@ -199,8 +259,12 @@ export class CustomerDetailsViewMainComponent
firstName: customer.firstName,
lastName: customer.lastName,
dateOfBirth: customer.dateOfBirth,
communicationDetails: customer.communicationDetails ? { ...customer.communicationDetails } : undefined,
organisation: customer.organisation ? { ...customer.organisation } : undefined,
communicationDetails: customer.communicationDetails
? { ...customer.communicationDetails }
: undefined,
organisation: customer.organisation
? { ...customer.organisation }
: undefined,
address: customer.address ? { ...customer.address } : undefined,
};
}
@@ -213,12 +277,18 @@ export class CustomerDetailsViewMainComponent
return this._activatedRoute.snapshot;
}
isOnlineOrCustomerCardUser$ = combineLatest([this.customerType$, this.hasKundenkarte$]).pipe(
map(([type, hasCard]) => type === 'webshop' || hasCard),
);
isOnlineOrCustomerCardUser$ = combineLatest([
this.customerType$,
this.hasKundenkarte$,
]).pipe(map(([type, hasCard]) => type === 'webshop' || hasCard));
constructor() {
super({ isBusy: false, shoppingCart: undefined, shippingAddress: undefined, payer: undefined });
super({
isBusy: false,
shoppingCart: undefined,
shippingAddress: undefined,
payer: undefined,
});
}
setIsBusy(isBusy: boolean) {
@@ -235,6 +305,16 @@ export class CustomerDetailsViewMainComponent
this.patchState({ payer });
}
// TODO: Adjust Logic after new TabService Adapter PR is merged
isRewardTab = linkedSignal(() => {
const tab = this.tab();
const processId = this.processIdSignal();
if (processId === tab?.id) {
return tab?.metadata?.['context'] === 'reward';
}
return false;
});
ngOnInit() {
this.processId$
.pipe(
@@ -254,16 +334,18 @@ export class CustomerDetailsViewMainComponent
// Dies geschieht bereits in der customer-search.component.ts immer wenn eine Navigation ausgeführt wird (sprich für Fälle in denen ein neuer Kunde gesetzt wird).
// Falls aber nach exakt dem gleichen Kunden gesucht wird, muss man diesen hier manuell erneut setzen, ansonsten bleibt dieser im Store auf undefined.
// Da dies nur für die Detailansicht relevant ist, wird hier auch auf hits 1 überprüft, ansonsten befindet man sich sowieso in der Trefferliste.
this._store.customerListResponse$.pipe(takeUntil(this._onDestroy$)).subscribe(([result]) => {
if (result.hits === 1) {
const customerId = result?.result[0].id;
const selectedCustomerId = +this.snapshot.params.customerId;
this._store.customerListResponse$
.pipe(takeUntil(this._onDestroy$))
.subscribe(([result]) => {
if (result.hits === 1) {
const customerId = result?.result[0].id;
const selectedCustomerId = +this.snapshot.params.customerId;
if (customerId === selectedCustomerId) {
this._store.selectCustomer({ customerId });
if (customerId === selectedCustomerId) {
this._store.selectCustomer({ customerId });
}
}
}
});
});
}
ngOnDestroy() {
@@ -316,19 +398,36 @@ export class CustomerDetailsViewMainComponent
this._setShippingAddress();
if (this.shoppingCartHasItems) {
// Navigation zum Warenkorb
const path = this._checkoutNavigation.getCheckoutReviewPath(this.processId).path;
this._router.navigate(path);
console.log('HÖÄÄÄÄÄ', this.processId, this.customer.id, this.tab());
// #5262 Damit der Prämienshop den selektierten Customer mitbekommt
// Evtl. nicht mehr notwendig, wenn der neue TabService Adapter in Develop ist
this.selectCustomerFacade.set(this.processId, this.customer.id);
console.log('HÖÄÄÄÄÄ', this.processId, this.customer.id, this.tab());
if (this.isRewardTab()) {
await this._router.navigate(['/', this.processId, 'reward']);
} else {
// Navigation zur Artikelsuche
const path = this._catalogNavigation.getArticleSearchBasePath(this.processId).path;
this._router.navigate(path);
if (this.shoppingCartHasItems) {
// Navigation zum Warenkorb
const path = this._checkoutNavigation.getCheckoutReviewPath(
this.processId,
).path;
this._router.navigate(path);
} else {
// Navigation zur Artikelsuche
const path = this._catalogNavigation.getArticleSearchBasePath(
this.processId,
).path;
this._router.navigate(path);
}
}
try {
} catch (error) {
this._modalService.error('Warenkorb kann dem Kunden nicht zugewiesen werden', error);
this._modalService.error(
'Warenkorb kann dem Kunden nicht zugewiesen werden',
error,
);
} finally {
this.setIsBusy(false);
}
@@ -336,7 +435,10 @@ export class CustomerDetailsViewMainComponent
@logAsync
_getCurrentBuyer() {
return this._checkoutService.getBuyer({ processId: this.processId }).pipe(first()).toPromise();
return this._checkoutService
.getBuyer({ processId: this.processId })
.pipe(first())
.toPromise();
}
@logAsync
@@ -352,7 +454,9 @@ export class CustomerDetailsViewMainComponent
return true;
}
const required = await this.customerService.canUpgrade(this.customer.id).toPromise();
const required = await this.customerService
.canUpgrade(this.customer.id)
.toPromise();
const upgradeableTo = res.create;
const data: CantAddCustomerToCartData = {
@@ -407,7 +511,10 @@ export class CustomerDetailsViewMainComponent
processId: this.processId,
customerId: this.customer.id,
});
this._router.navigate(nav.path, { queryParams: nav.queryParams, queryParamsHandling: 'merge' });
this._router.navigate(nav.path, {
queryParams: nav.queryParams,
queryParamsHandling: 'merge',
});
},
},
],
@@ -490,7 +597,9 @@ export class CustomerDetailsViewMainComponent
async _updateNotifcationChannelsAsync(currentBuyer: BuyerDTO | undefined) {
if (currentBuyer?.buyerNumber !== this.customer.customerNumber) {
const notificationChannels =
this.customer.notificationChannels === (3 as NotificationChannel) ? 1 : this.customer.notificationChannels;
this.customer.notificationChannels === (3 as NotificationChannel)
? 1
: this.customer.notificationChannels;
this._checkoutService.setNotificationChannels({
processId: this.processId,

View File

@@ -16,14 +16,16 @@
</a>
<div class="side-menu-group-sub-item-wrapper">
@if (customerSearchRoute$ | async; as customerSearchRoute) {
@if (
customerSearchRoute() || customerCreateRoute() || customerRewardRoute()
) {
<a
class="side-menu-group-item"
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="customerSearchRoute.path"
[queryParams]="customerSearchRoute.queryParams"
[routerLink]="customerSearchRoute().path"
[queryParams]="customerSearchRoute().queryParams"
sharedRegexRouterLinkActive="active"
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/customer"
sharedRegexRouterLinkActiveTest="^(\/kunde\/\d*\/customer|\/\d*\/reward)"
(isActiveChange)="customerActive($event); focusSearchBox()"
>
<span class="side-menu-group-item-icon">
@@ -32,11 +34,11 @@
<span class="side-menu-group-item-label">Kunden</span>
<button
class="side-menu-group-arrow"
[class.side-menu-item-rotate]="customerExpanded"
[class.side-menu-item-rotate]="customerExpanded()"
(click)="
$event.stopPropagation();
$event.preventDefault();
customerExpanded = !customerExpanded
toggleCustomerExpanded()
"
>
<shared-icon icon="keyboard-arrow-down"></shared-icon>
@@ -44,13 +46,16 @@
</a>
}
<div class="side-menu-group-sub-items" [class.hidden]="!customerExpanded">
@if (customerSearchRoute$ | async; as customerSearchRoute) {
<div
class="side-menu-group-sub-items"
[class.hidden]="!customerExpanded()"
>
@if (customerSearchRoute() || customerRewardRoute()) {
<a
class="side-menu-group-item"
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="customerSearchRoute.path"
[queryParams]="customerSearchRoute.queryParams"
[routerLink]="customerSearchRoute().path"
[queryParams]="customerSearchRoute().queryParams"
sharedRegexRouterLinkActive="active"
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/customer\/(\(search|search)"
(isActiveChange)="focusSearchBox()"
@@ -59,12 +64,12 @@
<span class="side-menu-group-item-label">Suchen</span>
</a>
}
@if (customerCreateRoute$ | async; as customerCreateRoute) {
@if (customerCreateRoute() || customerRewardRoute()) {
<a
class="side-menu-group-item"
(click)="closeSideMenu()"
[routerLink]="customerCreateRoute.path"
[queryParams]="customerCreateRoute.queryParams"
[routerLink]="customerCreateRoute().path"
[queryParams]="customerCreateRoute().queryParams"
sharedRegexRouterLinkActive="active"
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/customer\/(\(create|create)"
>
@@ -72,6 +77,19 @@
<span class="side-menu-group-item-label">Erfassen</span>
</a>
}
@if (customerRewardRoute()) {
<a
class="side-menu-group-item"
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="customerRewardRoute()"
(isActiveChange)="focusSearchBox()"
sharedRegexRouterLinkActive="active"
sharedRegexRouterLinkActiveTest="^\/\d*\/reward"
>
<span class="side-menu-group-item-icon"> </span>
<span class="side-menu-group-item-label">Prämienshop</span>
</a>
}
</div>
</div>
@@ -95,7 +113,7 @@
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="[
'/',
processService.activatedTab()?.id || processService.nextId(),
tabService.activatedTab()?.id || tabService.nextId(),
'return',
]"
(isActiveChange)="focusSearchBox()"
@@ -289,7 +307,7 @@
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="[
'/',
processService.activatedTab()?.id || processService.nextId(),
tabService.activatedTab()?.id || tabService.nextId(),
'remission',
]"
(isActiveChange)="focusSearchBox(); remissionExpanded.set($event)"
@@ -319,7 +337,7 @@
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="[
'/',
processService.activatedTab()?.id || processService.nextId(),
tabService.activatedTab()?.id || tabService.nextId(),
'remission',
]"
(isActiveChange)="focusSearchBox()"
@@ -334,7 +352,7 @@
(click)="closeSideMenu(); focusSearchBox()"
[routerLink]="[
'/',
processService.activatedTab()?.id || processService.nextId(),
tabService.activatedTab()?.id || tabService.nextId(),
'remission',
'return-receipt',
]"

View File

@@ -1,7 +1,7 @@
import {
Component,
ChangeDetectionStrategy,
Inject,
computed,
ChangeDetectorRef,
inject,
DOCUMENT,
@@ -29,6 +29,7 @@ import {
PickUpShelfOutNavigationService,
ProductCatalogNavigationService,
} from '@shared/services/navigation';
import { toSignal } from '@angular/core/rxjs-interop';
import { TabService } from '@isa/core/tabs';
import { NgIconComponent, provideIcons } from '@ng-icons/core';
@@ -68,7 +69,7 @@ export class ShellSideMenuComponent {
#pickUpShelfInNavigation = inject(PickupShelfInNavigationService);
#cdr = inject(ChangeDetectorRef);
#document = inject(DOCUMENT);
processService = inject(TabService);
tabService = inject(TabService);
branchKey$ = this.#stockService.StockCurrentBranch().pipe(
retry(3),
@@ -109,18 +110,32 @@ export class ShellSideMenuComponent {
}),
);
customerSearchRoute$ = this.getLastActivatedCustomerProcessId$().pipe(
map((processId) => {
return this.#customerSearchNavigation.defaultRoute({ processId });
}),
customerSearchRoute = toSignal(
this.getLastActivatedCustomerProcessId$().pipe(
map((processId) => {
return this.#customerSearchNavigation.defaultRoute({ processId });
}),
),
);
customerCreateRoute$ = this.getLastActivatedCustomerProcessId$().pipe(
map((processId) => {
return this.#customerCreateNavigation.defaultRoute({ processId });
}),
customerCreateRoute = toSignal(
this.getLastActivatedCustomerProcessId$().pipe(
map((processId) => {
return this.#customerCreateNavigation.defaultRoute({ processId });
}),
),
);
customerRewardRoute = computed(() => {
const routeName = 'reward';
const tabId = this.tabService.activatedTab()?.id;
return this.#router.createUrlTree([
'/',
tabId || this.tabService.nextId(),
routeName,
]);
});
pickUpShelfOutRoutePath$ = this.getLastActivatedCustomerProcessId$().pipe(
map((processId) => {
if (processId) {
@@ -212,26 +227,25 @@ export class ShellSideMenuComponent {
}
shelfExpanded = false;
customerExpanded = false;
customerExpanded = signal(false);
remissionExpanded = signal(false);
customerActive(isActive: boolean) {
if (isActive) {
this.expandCustomer();
this.customerExpanded.set(true);
}
}
toggleCustomerExpanded() {
this.customerExpanded.set(!this.customerExpanded());
}
shelfActive(isActive: boolean) {
if (isActive) {
this.expandShelf();
}
}
expandCustomer() {
this.customerExpanded = true;
this.#cdr.markForCheck();
}
expandShelf() {
this.shelfExpanded = true;
this.#cdr.markForCheck();

View File

@@ -0,0 +1,59 @@
import {
argsToTemplate,
moduleMetadata,
type Meta,
type StoryObj,
} from '@storybook/angular';
import {
InlineInputComponent,
InputControlDirective,
} from '@isa/ui/input-controls';
const meta: Meta<InlineInputComponent> = {
component: InlineInputComponent,
title: 'ui/input-controls/InlineInput',
argTypes: {
size: { control: 'select', options: ['small', 'medium'] },
},
args: {
size: 'medium',
},
decorators: [
moduleMetadata({
imports: [InputControlDirective],
}),
],
render: (args) => ({
props: args,
template: `
<ui-inline-input ${argsToTemplate(args)}>
<input type="text" placeholder="Enter inline text" />
</ui-inline-input>
`,
}),
};
export default meta;
type Story = StoryObj<InlineInputComponent>;
export const Primary: Story = {
args: {
size: 'medium',
},
};
export const WithLabel: Story = {
args: {
size: 'medium',
},
render: (args) => ({
props: args,
template: `
<ui-inline-input ${argsToTemplate(args)}>
<label>Label</label>
<input type="text" placeholder="Enter inline text" />
</ui-inline-input>
`,
}),
};

View File

@@ -1,128 +1,136 @@
# Tech Stack Documentation
## Core Technologies
### Frontend Framework
- **[Angular](https://angular.dev/overview)** (Latest Version)
- Modern web framework for building scalable single-page applications
- Leverages TypeScript for enhanced type safety and developer experience
### State Management
- **[NgRx](https://ngrx.io/docs)**
- Redux-inspired state management for Angular applications
- Provides predictable state container and powerful dev tools
- Used for managing complex application state and side effects
### Styling
- **[Tailwind CSS](https://tailwindcss.com/)**
- Utility-first CSS framework
- Enables rapid UI development with pre-built classes
- Highly customizable through configuration
## Development Tools
### Language
- **[TypeScript](https://www.typescriptlang.org/docs/handbook/intro.html)**
- Strongly typed programming language
- Provides enhanced IDE support and compile-time error checking
- Used throughout the entire application
### Runtime
- **[Node.js](https://nodejs.org/docs/latest-v22.x/api/index.html)**
- JavaScript runtime environment
- Used for development server and build tools
- Required for running npm scripts and development tools
### Testing Framework
- **[Jest](https://jestjs.io/docs/getting-started)**
- Primary testing framework
- Used for unit and integration tests
- Provides snapshot testing capabilities
- **[Spectator](https://ngneat.github.io/spectator/)**
- Angular testing utility library
- Simplifies component testing
- Reduces boilerplate in test files
### UI Development
- **[Storybook](https://storybook.js.org/docs/get-started/frameworks/angular)**
- UI component development environment
- Enables isolated component development
- Serves as living documentation for components
### Utilities
- **[date-fns](https://date-fns.org/docs/Getting-Started)**
- Modern JavaScript date utility library
- Used for consistent date formatting and manipulation
- Tree-shakeable to optimize bundle size
- **[Lodash](https://lodash.com/)**
- Utility library for common JavaScript tasks
- **[UUID](https://www.npmjs.com/package/uuid)**
- Generates unique identifiers
- **[Zod](https://github.com/colinhacks/zod)**
- TypeScript-first schema validation library
## Additional Technical Areas
### Authentication & Authorization
- **[angular-oauth2-oidc](https://github.com/manfredsteyer/angular-oauth2-oidc)**
- Simplifies implementing OAuth2 and OIDC authentication in Angular.
- **[angular-oauth2-oidc-jwks](https://github.com/manfredsteyer/angular-oauth2-oidc)**
- Adds JWKS support for secure token management.
### Real-Time Communication
- **[@microsoft/signalr](https://www.npmjs.com/package/@microsoft/signalr)**
- Provides real-time communication between client and server components.
### Barcode Scanning
- **[Scandit Web Data Capture Barcode](https://www.scandit.com/documentation/web/)**
- Robust barcode scanning capabilities integrated into the application.
- **[Scandit Web Data Capture Core](https://www.scandit.com/documentation/web/)**
- Core library supporting the barcode scanning features.
### Tooling
- **[Nx](https://nx.dev/)**
- Powerful monorepo tool for Angular and other frontend applications.
- **[Husky](https://typicode.github.io/husky/#/)**
- Manages Git hooks for consistent developer workflows.
- **[ESLint](https://eslint.org/) & [Prettier](https://prettier.io/)**
- Linting and formatting tools to maintain consistent code quality.
- **[Storybook](https://storybook.js.org/)**
- Isolated component development and living documentation environment.
## Development Environment Setup
1. **Required Software**
- Node.js (Latest LTS version)
- npm (comes with Node.js)
- Git
2. **IDE Recommendations**
- Visual Studio Code with following extensions:
- Angular Language Service
- ESLint
- Prettier
- Tailwind CSS IntelliSense
3. **Getting Started**
```bash
npm install # Install dependencies
npm run start # Start development server
npm run test # Run tests
npm run storybook # Start Storybook
```
# Tech Stack Documentation
## Core Technologies
### Frontend Framework
- **[Angular](https://angular.dev/overview)** (Latest Version)
- Modern web framework for building scalable single-page applications
- Leverages TypeScript for enhanced type safety and developer experience
### State Management
- **[NgRx](https://ngrx.io/docs)**
- Redux-inspired state management for Angular applications
- Provides predictable state container and powerful dev tools
- Used for managing complex application state and side effects
### Styling
- **[Tailwind CSS](https://tailwindcss.com/)**
- Utility-first CSS framework
- Enables rapid UI development with pre-built classes
- Highly customizable through configuration
## Development Tools
### Language
- **[TypeScript](https://www.typescriptlang.org/docs/handbook/intro.html)**
- Strongly typed programming language
- Provides enhanced IDE support and compile-time error checking
- Used throughout the entire application
### Runtime
- **[Node.js](https://nodejs.org/docs/latest-v22.x/api/index.html)**
- JavaScript runtime environment
- Used for development server and build tools
- Required for running npm scripts and development tools
### Testing Framework
- **[Jest](https://jestjs.io/docs/getting-started)**
- Primary testing framework
- Used for unit and integration tests
- Provides snapshot testing capabilities
- **[Spectator](https://ngneat.github.io/spectator/)**
- Angular testing utility library
- Simplifies component testing
- Reduces boilerplate in test files
### UI Development
- **[Storybook](https://storybook.js.org/docs/get-started/frameworks/angular)**
- UI component development environment
- Enables isolated component development
- Serves as living documentation for components
### Utilities
- **[date-fns](https://date-fns.org/docs/Getting-Started)**
- Modern JavaScript date utility library
- Used for consistent date formatting and manipulation
- Tree-shakeable to optimize bundle size
- **[Lodash](https://lodash.com/)**
- Utility library for common JavaScript tasks
- **[UUID](https://www.npmjs.com/package/uuid)**
- Generates unique identifiers
- **[Zod](https://github.com/colinhacks/zod)**
- TypeScript-first schema validation library
## Additional Technical Areas
### Authentication & Authorization
- **[angular-oauth2-oidc](https://github.com/manfredsteyer/angular-oauth2-oidc)**
- Simplifies implementing OAuth2 and OIDC authentication in Angular.
- **[angular-oauth2-oidc-jwks](https://github.com/manfredsteyer/angular-oauth2-oidc)**
- Adds JWKS support for secure token management.
### Real-Time Communication
- **[@microsoft/signalr](https://www.npmjs.com/package/@microsoft/signalr)**
- Provides real-time communication between client and server components.
### Barcode Scanning
- **[Scandit Web Data Capture Barcode](https://www.scandit.com/documentation/web/)**
- Robust barcode scanning capabilities integrated into the application.
- **[Scandit Web Data Capture Core](https://www.scandit.com/documentation/web/)**
- Core library supporting the barcode scanning features.
### Tooling
- **[Nx](https://nx.dev/)**
- Powerful monorepo tool for Angular and other frontend applications.
- **[Husky](https://typicode.github.io/husky/#/)**
- Manages Git hooks for consistent developer workflows.
- **[ESLint](https://eslint.org/) & [Prettier](https://prettier.io/)**
- Linting and formatting tools to maintain consistent code quality.
- **[Storybook](https://storybook.js.org/)**
- Isolated component development and living documentation environment.
## Domain Libraries
### Customer Relationship Management (CRM)
- **`@isa/crm/data-access`**
- Handles data access logic for customer-related features.
- Contains services for fetching and managing customer data.
## Development Environment Setup
1. **Required Software**
- Node.js (Latest LTS version)
- npm (comes with Node.js)
- Git
2. **IDE Recommendations**
- Visual Studio Code with following extensions:
- Angular Language Service
- ESLint
- Prettier
- Tailwind CSS IntelliSense
3. **Getting Started**
```bash
npm install # Install dependencies
npm run start # Start development server
npm run test # Run tests
npm run storybook # Start Storybook
```

View File

@@ -31,8 +31,9 @@ const PARAMETER_CODEC = new ParameterCodec();
export class BaseService {
constructor(
protected config: CatConfiguration,
protected http: HttpClient,
) {}
protected http: HttpClient
) {
}
private _rootUrl: string = '';
@@ -56,7 +57,7 @@ export class BaseService {
*/
protected newParams(): HttpParams {
return new HttpParams({
encoder: PARAMETER_CODEC,
encoder: PARAMETER_CODEC
});
}
}

View File

@@ -4,6 +4,7 @@
* Auocomplete-Ergebnis
*/
export interface AutocompleteDTO {
/**
* Anzeige / Bezeichner
*/

View File

@@ -5,6 +5,7 @@ import { CatalogType } from './catalog-type';
* Suchabfrage
*/
export interface AutocompleteTokenDTO {
/**
* Katalogbereich
*/
@@ -13,7 +14,7 @@ export interface AutocompleteTokenDTO {
/**
* Filter
*/
filter?: { [key: string]: string };
filter?: {[key: string]: string};
/**
* Eingabe

View File

@@ -7,6 +7,7 @@ import { AvailabilityType } from './availability-type';
* Verfügbarkeit
*/
export interface AvailabilityDTO {
/**
* Voraussichtliches Lieferdatum
*/

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type AvailabilityType = 0 | 1 | 2 | 32 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384;
export type AvailabilityType = 0 | 1 | 2 | 32 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type Avoirdupois = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;
export type Avoirdupois = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;

View File

@@ -3,4 +3,4 @@
/**
* Katalogbereich
*/
export type CatalogType = 0 | 1 | 2 | 4;
export type CatalogType = 0 | 1 | 2 | 4;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type CRUDA = 0 | 1 | 2 | 4 | 8 | 16;
export type CRUDA = 0 | 1 | 2 | 4 | 8 | 16;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type DialogContentType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128;
export type DialogContentType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type DialogSettings = 0 | 1 | 2 | 4;
export type DialogSettings = 0 | 1 | 2 | 4;

View File

@@ -2,7 +2,7 @@
import { TouchedBase } from './touched-base';
import { CRUDA } from './cruda';
import { EntityStatus } from './entity-status';
export interface EntityDTO extends TouchedBase {
export interface EntityDTO extends TouchedBase{
changed?: string;
created?: string;
cruda?: CRUDA;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type EntityStatus = 0 | 1 | 2 | 4 | 8;
export type EntityStatus = 0 | 1 | 2 | 4 | 8;

View File

@@ -4,6 +4,7 @@
* Bild
*/
export interface ImageDTO {
/**
* Copyright
*/

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type InputType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 3072 | 4096 | 8192 | 12288;
export type InputType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 3072 | 4096 | 8192 | 12288;

View File

@@ -11,7 +11,8 @@ import { StockInfoDTO } from './stock-info-dto';
import { Successor } from './successor';
import { TextDTO } from './text-dto';
import { ItemType } from './item-type';
export interface ItemDTO extends EntityDTO {
export interface ItemDTO extends EntityDTO{
/**
* Verfügbarkeit laut Katalog
*/
@@ -30,7 +31,7 @@ export interface ItemDTO extends EntityDTO {
/**
* Weitere Artikel-IDs
*/
ids?: { [key: string]: number };
ids?: {[key: string]: number};
/**
* Primary image / Id des Hauptbilds
@@ -45,7 +46,7 @@ export interface ItemDTO extends EntityDTO {
/**
* Markierungen (Lesezeichen) wie (BOD, Prämie)
*/
labels?: { [key: string]: string };
labels?: {[key: string]: string};
/**
* Produkt-Stammdaten

View File

@@ -3,4 +3,4 @@
/**
* Artikel-/Produkttyp
*/
export type ItemType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768 | 65536;
export type ItemType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768 | 65536;

View File

@@ -1,5 +1,6 @@
/* tslint:disable */
export interface LesepunkteRequest {
/**
* Artikel ID
*/

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgsOfIEnumerableOfAutocompleteDTO } from './response-args-of-ienumerable-of-autocomplete-dto';
export interface ListResponseArgsOfAutocompleteDTO extends ResponseArgsOfIEnumerableOfAutocompleteDTO {
export interface ListResponseArgsOfAutocompleteDTO extends ResponseArgsOfIEnumerableOfAutocompleteDTO{
completed?: boolean;
hits?: number;
skip?: number;

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgsOfIEnumerableOfItemDTO } from './response-args-of-ienumerable-of-item-dto';
export interface ListResponseArgsOfItemDTO extends ResponseArgsOfIEnumerableOfItemDTO {
export interface ListResponseArgsOfItemDTO extends ResponseArgsOfIEnumerableOfItemDTO{
completed?: boolean;
hits?: number;
skip?: number;

View File

@@ -2,7 +2,7 @@
import { TouchedBase } from './touched-base';
import { PriceValueDTO } from './price-value-dto';
import { VATValueDTO } from './vatvalue-dto';
export interface PriceDTO extends TouchedBase {
export interface PriceDTO extends TouchedBase{
value?: PriceValueDTO;
vat?: VATValueDTO;
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
export interface PriceValueDTO extends TouchedBase {
export interface PriceValueDTO extends TouchedBase{
currency?: string;
currencySymbol?: string;
value?: number;

View File

@@ -1,7 +1,7 @@
/* tslint:disable */
export interface ProblemDetails {
detail?: string;
extensions: { [key: string]: any };
extensions: {[key: string]: any};
instance?: string;
status?: number;
title?: string;

View File

@@ -2,7 +2,7 @@
import { TouchedBase } from './touched-base';
import { SizeOfString } from './size-of-string';
import { WeightOfAvoirdupois } from './weight-of-avoirdupois';
export interface ProductDTO extends TouchedBase {
export interface ProductDTO extends TouchedBase{
additionalName?: string;
catalogProductNumber?: string;
contributors?: string;

View File

@@ -1,7 +1,8 @@
/* tslint:disable */
import { QueryTokenDTO2 } from './query-token-dto2';
import { CatalogType } from './catalog-type';
export interface QueryTokenDTO extends QueryTokenDTO2 {
export interface QueryTokenDTO extends QueryTokenDTO2{
/**
* Katalogbereich
*/

View File

@@ -1,13 +1,13 @@
/* tslint:disable */
import { OrderByDTO } from './order-by-dto';
export interface QueryTokenDTO2 {
filter?: { [key: string]: string };
filter?: {[key: string]: string};
friendlyName?: string;
fuzzy?: number;
hitsOnly?: boolean;
ids?: Array<number>;
input?: { [key: string]: string };
options?: { [key: string]: string };
input?: {[key: string]: string};
options?: {[key: string]: string};
orderBy?: Array<OrderByDTO>;
skip?: number;
take?: number;

View File

@@ -1,5 +1,5 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
export interface ResponseArgsOfIDictionaryOfLongAndNullableInteger extends ResponseArgs {
result?: { [key: string]: number };
export interface ResponseArgsOfIDictionaryOfLongAndNullableInteger extends ResponseArgs{
result?: {[key: string]: number};
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { AutocompleteDTO } from './autocomplete-dto';
export interface ResponseArgsOfIEnumerableOfAutocompleteDTO extends ResponseArgs {
export interface ResponseArgsOfIEnumerableOfAutocompleteDTO extends ResponseArgs{
result?: Array<AutocompleteDTO>;
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { InputGroupDTO } from './input-group-dto';
export interface ResponseArgsOfIEnumerableOfInputGroupDTO extends ResponseArgs {
export interface ResponseArgsOfIEnumerableOfInputGroupDTO extends ResponseArgs{
result?: Array<InputGroupDTO>;
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { ItemDTO } from './item-dto';
export interface ResponseArgsOfIEnumerableOfItemDTO extends ResponseArgs {
export interface ResponseArgsOfIEnumerableOfItemDTO extends ResponseArgs{
result?: Array<ItemDTO>;
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { OrderByDTO } from './order-by-dto';
export interface ResponseArgsOfIEnumerableOfOrderByDTO extends ResponseArgs {
export interface ResponseArgsOfIEnumerableOfOrderByDTO extends ResponseArgs{
result?: Array<OrderByDTO>;
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { QueryTokenDTO } from './query-token-dto';
export interface ResponseArgsOfIEnumerableOfQueryTokenDTO extends ResponseArgs {
export interface ResponseArgsOfIEnumerableOfQueryTokenDTO extends ResponseArgs{
result?: Array<QueryTokenDTO>;
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { ItemDTO } from './item-dto';
export interface ResponseArgsOfItemDTO extends ResponseArgs {
export interface ResponseArgsOfItemDTO extends ResponseArgs{
result?: ItemDTO;
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { UISettingsDTO } from './uisettings-dto';
export interface ResponseArgsOfUISettingsDTO extends ResponseArgs {
export interface ResponseArgsOfUISettingsDTO extends ResponseArgs{
result?: UISettingsDTO;
}

View File

@@ -3,7 +3,7 @@ import { DialogOfString } from './dialog-of-string';
export interface ResponseArgs {
dialog?: DialogOfString;
error: boolean;
invalidProperties?: { [key: string]: string };
invalidProperties?: {[key: string]: string};
message?: string;
requestId?: number;
}

View File

@@ -1,5 +1,6 @@
/* tslint:disable */
export interface ReviewDTO {
/**
* Autor
*/

View File

@@ -4,6 +4,7 @@
* Regalinfo
*/
export interface ShelfInfoDTO {
/**
* Sortiment
*/

View File

@@ -3,4 +3,5 @@
/**
* Shop
*/
export interface ShopDTO {}
export interface ShopDTO {
}

View File

@@ -4,6 +4,7 @@
* Eigenchaften
*/
export interface SpecDTO {
/**
* PK
*/

View File

@@ -5,6 +5,7 @@ import { StockStatus } from './stock-status';
* Bestandsinformation
*/
export interface StockInfoDTO {
/**
* Filiale PK
*/

View File

@@ -3,4 +3,4 @@
/**
* Dispositionsstatus
*/
export type StockStatus = 0 | 1 | 2 | 3 | 4;
export type StockStatus = 0 | 1 | 2 | 3 | 4;

View File

@@ -1,6 +1,7 @@
/* tslint:disable */
import { ProductDTO } from './product-dto';
export interface Successor extends ProductDTO {
export interface Successor extends ProductDTO{
/**
* PK
*/

View File

@@ -1,5 +1,6 @@
/* tslint:disable */
export interface TextDTO {
/**
* PK
*/

View File

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

View File

@@ -1,5 +1,5 @@
/* tslint:disable */
export interface TranslationDTO {
target?: string;
values?: { [key: string]: string };
values?: {[key: string]: string};
}

View File

@@ -1,7 +1,8 @@
/* tslint:disable */
import { QuerySettingsDTO } from './query-settings-dto';
import { TranslationDTO } from './translation-dto';
export interface UISettingsDTO extends QuerySettingsDTO {
export interface UISettingsDTO extends QuerySettingsDTO{
/**
* Url Template für Detail-Bild
*/

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type VATType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128;
export type VATType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128;

View File

@@ -1,7 +1,7 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
import { VATType } from './vattype';
export interface VATValueDTO extends TouchedBase {
export interface VATValueDTO extends TouchedBase{
inPercent?: number;
label?: string;
value?: number;

View File

@@ -16,7 +16,10 @@ class PromotionService extends __BaseService {
static readonly PromotionLesepunktePath = '/promotion/lesepunkte';
static readonly PromotionLesepunkte2Path = '/stock/{stockId}/promotion/lesepunkte';
constructor(config: __Configuration, http: HttpClient) {
constructor(
config: __Configuration,
http: HttpClient
) {
super(config, http);
}
@@ -24,24 +27,26 @@ class PromotionService extends __BaseService {
* Lesepunkte
* @param items Ids und Mengen
*/
PromotionLesepunkteResponse(
items: Array<LesepunkteRequest>,
): __Observable<__StrictHttpResponse<ResponseArgsOfIDictionaryOfLongAndNullableInteger>> {
PromotionLesepunkteResponse(items: Array<LesepunkteRequest>): __Observable<__StrictHttpResponse<ResponseArgsOfIDictionaryOfLongAndNullableInteger>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = items;
let req = new HttpRequest<any>('POST', this.rootUrl + `/promotion/lesepunkte`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/promotion/lesepunkte`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIDictionaryOfLongAndNullableInteger>;
}),
})
);
}
/**
@@ -49,7 +54,9 @@ class PromotionService extends __BaseService {
* @param items Ids und Mengen
*/
PromotionLesepunkte(items: Array<LesepunkteRequest>): __Observable<ResponseArgsOfIDictionaryOfLongAndNullableInteger> {
return this.PromotionLesepunkteResponse(items).pipe(__map((_r) => _r.body as ResponseArgsOfIDictionaryOfLongAndNullableInteger));
return this.PromotionLesepunkteResponse(items).pipe(
__map(_r => _r.body as ResponseArgsOfIDictionaryOfLongAndNullableInteger)
);
}
/**
@@ -60,9 +67,7 @@ class PromotionService extends __BaseService {
*
* - `items`: Ids und Mengen
*/
PromotionLesepunkte2Response(
params: PromotionService.PromotionLesepunkte2Params,
): __Observable<__StrictHttpResponse<ResponseArgsOfIDictionaryOfLongAndNullableInteger>> {
PromotionLesepunkte2Response(params: PromotionService.PromotionLesepunkte2Params): __Observable<__StrictHttpResponse<ResponseArgsOfIDictionaryOfLongAndNullableInteger>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
@@ -75,15 +80,14 @@ class PromotionService extends __BaseService {
{
headers: __headers,
params: __params,
responseType: 'json',
},
);
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIDictionaryOfLongAndNullableInteger>;
}),
})
);
}
/**
@@ -94,18 +98,20 @@ class PromotionService extends __BaseService {
*
* - `items`: Ids und Mengen
*/
PromotionLesepunkte2(
params: PromotionService.PromotionLesepunkte2Params,
): __Observable<ResponseArgsOfIDictionaryOfLongAndNullableInteger> {
return this.PromotionLesepunkte2Response(params).pipe(__map((_r) => _r.body as ResponseArgsOfIDictionaryOfLongAndNullableInteger));
PromotionLesepunkte2(params: PromotionService.PromotionLesepunkte2Params): __Observable<ResponseArgsOfIDictionaryOfLongAndNullableInteger> {
return this.PromotionLesepunkte2Response(params).pipe(
__map(_r => _r.body as ResponseArgsOfIDictionaryOfLongAndNullableInteger)
);
}
}
module PromotionService {
/**
* Parameters for PromotionLesepunkte2
*/
export interface PromotionLesepunkte2Params {
/**
* Lager PK (optional)
*/
@@ -118,4 +124,4 @@ module PromotionService {
}
}
export { PromotionService };
export { PromotionService }

View File

@@ -37,12 +37,16 @@ class SearchService extends __BaseService {
static readonly SearchDetailByEANPath = '/s/ean/{ean}';
static readonly SearchDetailByEAN2Path = '/stock/{stockId}/ean/{ean}';
static readonly SearchSettingsPath = '/s/settings';
static readonly SearchLoyaltySettingsPath = '/s/loyalty/settings';
static readonly SearchSearchFilterPath = '/s/filter';
static readonly SearchSearchSortPath = '/s/sort';
static readonly SearchHistoryPath = '/s/history';
static readonly SearchGetRecommendationsPath = '/s/recommendations/{digId}';
constructor(config: __Configuration, http: HttpClient) {
constructor(
config: __Configuration,
http: HttpClient
) {
super(config, http);
}
@@ -55,17 +59,21 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
__body = queryToken;
let req = new HttpRequest<any>('POST', this.rootUrl + `/s/top`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/s/top`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -73,7 +81,9 @@ class SearchService extends __BaseService {
* @param queryToken Suchkriterien
*/
SearchTop(queryToken: QueryTokenDTO): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchTopResponse(queryToken).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchTopResponse(queryToken).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -90,17 +100,21 @@ class SearchService extends __BaseService {
let __body: any = null;
__body = params.queryToken;
let req = new HttpRequest<any>('POST', this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/top`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/top`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -112,7 +126,9 @@ class SearchService extends __BaseService {
* - `queryToken`: Suchkriterien
*/
SearchTop2(params: SearchService.SearchTop2Params): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchTop2Response(params).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchTop2Response(params).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -124,17 +140,21 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
__body = queryToken;
let req = new HttpRequest<any>('POST', this.rootUrl + `/s`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/s`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -142,7 +162,9 @@ class SearchService extends __BaseService {
* @param queryToken Suchkriterien
*/
SearchSearch(queryToken: QueryTokenDTO): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchSearchResponse(queryToken).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchSearchResponse(queryToken).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -159,17 +181,21 @@ class SearchService extends __BaseService {
let __body: any = null;
__body = params.queryToken;
let req = new HttpRequest<any>('POST', this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -181,7 +207,9 @@ class SearchService extends __BaseService {
* - `queryToken`: Suchkriterien
*/
SearchSearch2(params: SearchService.SearchSearch2Params): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchSearch2Response(params).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchSearch2Response(params).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -193,17 +221,21 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
__body = queryToken;
let req = new HttpRequest<any>('POST', this.rootUrl + `/s/complete`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/s/complete`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfAutocompleteDTO>;
}),
})
);
}
/**
@@ -211,7 +243,9 @@ class SearchService extends __BaseService {
* @param queryToken Suchbegriff
*/
SearchAutocomplete(queryToken: AutocompleteTokenDTO): __Observable<ListResponseArgsOfAutocompleteDTO> {
return this.SearchAutocompleteResponse(queryToken).pipe(__map((_r) => _r.body as ListResponseArgsOfAutocompleteDTO));
return this.SearchAutocompleteResponse(queryToken).pipe(
__map(_r => _r.body as ListResponseArgsOfAutocompleteDTO)
);
}
/**
@@ -222,25 +256,27 @@ class SearchService extends __BaseService {
*
* - `queryToken`: Suchbegriff
*/
SearchAutocomplete2Response(
params: SearchService.SearchAutocomplete2Params,
): __Observable<__StrictHttpResponse<ListResponseArgsOfAutocompleteDTO>> {
SearchAutocomplete2Response(params: SearchService.SearchAutocomplete2Params): __Observable<__StrictHttpResponse<ListResponseArgsOfAutocompleteDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
__body = params.queryToken;
let req = new HttpRequest<any>('POST', this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/complete`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/complete`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfAutocompleteDTO>;
}),
})
);
}
/**
@@ -252,7 +288,9 @@ class SearchService extends __BaseService {
* - `queryToken`: Suchbegriff
*/
SearchAutocomplete2(params: SearchService.SearchAutocomplete2Params): __Observable<ListResponseArgsOfAutocompleteDTO> {
return this.SearchAutocomplete2Response(params).pipe(__map((_r) => _r.body as ListResponseArgsOfAutocompleteDTO));
return this.SearchAutocomplete2Response(params).pipe(
__map(_r => _r.body as ListResponseArgsOfAutocompleteDTO)
);
}
/**
@@ -264,17 +302,21 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
__body = ids;
let req = new HttpRequest<any>('POST', this.rootUrl + `/s/byid`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/s/byid`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -282,7 +324,9 @@ class SearchService extends __BaseService {
* @param ids PKs
*/
SearchById(ids: Array<number>): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchByIdResponse(ids).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchByIdResponse(ids).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -299,17 +343,21 @@ class SearchService extends __BaseService {
let __body: any = null;
__body = params.ids;
let req = new HttpRequest<any>('POST', this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/byid`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/byid`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -321,7 +369,9 @@ class SearchService extends __BaseService {
* - `ids`: PKs
*/
SearchById2(params: SearchService.SearchById2Params): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchById2Response(params).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchById2Response(params).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -333,17 +383,21 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
__body = eans;
let req = new HttpRequest<any>('POST', this.rootUrl + `/s/byean`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/s/byean`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -351,7 +405,9 @@ class SearchService extends __BaseService {
* @param eans EANs
*/
SearchByEAN(eans: Array<string>): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchByEANResponse(eans).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchByEANResponse(eans).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -368,17 +424,21 @@ class SearchService extends __BaseService {
let __body: any = null;
__body = params.eans;
let req = new HttpRequest<any>('POST', this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/byean`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/s/byean`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -390,7 +450,9 @@ class SearchService extends __BaseService {
* - `eans`: EANs
*/
SearchByEAN2(params: SearchService.SearchByEAN2Params): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchByEAN2Response(params).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchByEAN2Response(params).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -407,17 +469,21 @@ class SearchService extends __BaseService {
let __body: any = null;
__body = params.eans;
let req = new HttpRequest<any>('POST', this.rootUrl + `/branch/${encodeURIComponent(String(params.branchNumber))}/s/byean`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'POST',
this.rootUrl + `/branch/${encodeURIComponent(String(params.branchNumber))}/s/byean`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ListResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -429,7 +495,9 @@ class SearchService extends __BaseService {
* - `branchNumber`: Filiale-Nr (optional)
*/
SearchByEAN3(params: SearchService.SearchByEAN3Params): __Observable<ListResponseArgsOfItemDTO> {
return this.SearchByEAN3Response(params).pipe(__map((_r) => _r.body as ListResponseArgsOfItemDTO));
return this.SearchByEAN3Response(params).pipe(
__map(_r => _r.body as ListResponseArgsOfItemDTO)
);
}
/**
@@ -446,17 +514,21 @@ 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))}`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/${encodeURIComponent(String(params.id))}`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -468,7 +540,9 @@ class SearchService extends __BaseService {
* - `doNotTrack`:
*/
SearchDetail(params: SearchService.SearchDetailParams): __Observable<ResponseArgsOfItemDTO> {
return this.SearchDetailResponse(params).pipe(__map((_r) => _r.body as ResponseArgsOfItemDTO));
return this.SearchDetailResponse(params).pipe(
__map(_r => _r.body as ResponseArgsOfItemDTO)
);
}
/**
@@ -486,6 +560,7 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
if (params.doNotTrack != null) __params = __params.set('doNotTrack', params.doNotTrack.toString());
let req = new HttpRequest<any>(
'GET',
@@ -494,15 +569,14 @@ class SearchService extends __BaseService {
{
headers: __headers,
params: __params,
responseType: 'json',
},
);
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -516,7 +590,9 @@ class SearchService extends __BaseService {
* - `doNotTrack`:
*/
SearchDetail2(params: SearchService.SearchDetail2Params): __Observable<ResponseArgsOfItemDTO> {
return this.SearchDetail2Response(params).pipe(__map((_r) => _r.body as ResponseArgsOfItemDTO));
return this.SearchDetail2Response(params).pipe(
__map(_r => _r.body as ResponseArgsOfItemDTO)
);
}
/**
@@ -528,17 +604,21 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
let req = new HttpRequest<any>('GET', this.rootUrl + `/s/ean/${encodeURIComponent(String(ean))}`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/ean/${encodeURIComponent(String(ean))}`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -546,7 +626,9 @@ class SearchService extends __BaseService {
* @param ean EAN
*/
SearchDetailByEAN(ean: string): __Observable<ResponseArgsOfItemDTO> {
return this.SearchDetailByEANResponse(ean).pipe(__map((_r) => _r.body as ResponseArgsOfItemDTO));
return this.SearchDetailByEANResponse(ean).pipe(
__map(_r => _r.body as ResponseArgsOfItemDTO)
);
}
/**
@@ -562,6 +644,7 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/stock/${encodeURIComponent(String(params.stockId))}/ean/${encodeURIComponent(String(params.ean))}`,
@@ -569,15 +652,14 @@ class SearchService extends __BaseService {
{
headers: __headers,
params: __params,
responseType: 'json',
},
);
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfItemDTO>;
}),
})
);
}
/**
@@ -589,7 +671,9 @@ class SearchService extends __BaseService {
* - `ean`: EAN
*/
SearchDetailByEAN2(params: SearchService.SearchDetailByEAN2Params): __Observable<ResponseArgsOfItemDTO> {
return this.SearchDetailByEAN2Response(params).pipe(__map((_r) => _r.body as ResponseArgsOfItemDTO));
return this.SearchDetailByEAN2Response(params).pipe(
__map(_r => _r.body as ResponseArgsOfItemDTO)
);
}
/**
@@ -599,24 +683,63 @@ class SearchService extends __BaseService {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
let req = new HttpRequest<any>('GET', this.rootUrl + `/s/settings`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/settings`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfUISettingsDTO>;
}),
})
);
}
/**
* Settings
*/
SearchSettings(): __Observable<ResponseArgsOfUISettingsDTO> {
return this.SearchSettingsResponse().pipe(__map((_r) => _r.body as ResponseArgsOfUISettingsDTO));
return this.SearchSettingsResponse().pipe(
__map(_r => _r.body as ResponseArgsOfUISettingsDTO)
);
}
/**
* Settings
*/
SearchLoyaltySettingsResponse(): __Observable<__StrictHttpResponse<ResponseArgsOfUISettingsDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/loyalty/settings`,
__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<ResponseArgsOfUISettingsDTO>;
})
);
}
/**
* Settings
*/
SearchLoyaltySettings(): __Observable<ResponseArgsOfUISettingsDTO> {
return this.SearchLoyaltySettingsResponse().pipe(
__map(_r => _r.body as ResponseArgsOfUISettingsDTO)
);
}
/**
@@ -626,24 +749,30 @@ class SearchService extends __BaseService {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
let req = new HttpRequest<any>('GET', this.rootUrl + `/s/filter`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/filter`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfInputGroupDTO>;
}),
})
);
}
/**
* Filter
*/
SearchSearchFilter(): __Observable<ResponseArgsOfIEnumerableOfInputGroupDTO> {
return this.SearchSearchFilterResponse().pipe(__map((_r) => _r.body as ResponseArgsOfIEnumerableOfInputGroupDTO));
return this.SearchSearchFilterResponse().pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfInputGroupDTO)
);
}
/**
@@ -653,24 +782,30 @@ class SearchService extends __BaseService {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
let req = new HttpRequest<any>('GET', this.rootUrl + `/s/sort`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/sort`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfOrderByDTO>;
}),
})
);
}
/**
* Filter
*/
SearchSearchSort(): __Observable<ResponseArgsOfIEnumerableOfOrderByDTO> {
return this.SearchSearchSortResponse().pipe(__map((_r) => _r.body as ResponseArgsOfIEnumerableOfOrderByDTO));
return this.SearchSearchSortResponse().pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfOrderByDTO)
);
}
/**
@@ -682,17 +817,21 @@ class SearchService extends __BaseService {
let __headers = new HttpHeaders();
let __body: any = null;
if (take != null) __params = __params.set('take', take.toString());
let req = new HttpRequest<any>('GET', this.rootUrl + `/s/history`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/history`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfQueryTokenDTO>;
}),
})
);
}
/**
@@ -700,7 +839,9 @@ class SearchService extends __BaseService {
* @param take Take
*/
SearchHistory(take?: null | number): __Observable<ResponseArgsOfIEnumerableOfQueryTokenDTO> {
return this.SearchHistoryResponse(take).pipe(__map((_r) => _r.body as ResponseArgsOfIEnumerableOfQueryTokenDTO));
return this.SearchHistoryResponse(take).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfQueryTokenDTO)
);
}
/**
@@ -713,25 +854,27 @@ class SearchService extends __BaseService {
*
* @return ResponseArgs of Recomendations
*/
SearchGetRecommendationsResponse(
params: SearchService.SearchGetRecommendationsParams,
): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfItemDTO>> {
SearchGetRecommendationsResponse(params: SearchService.SearchGetRecommendationsParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfItemDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
if (params.sessionId != null) __params = __params.set('sessionId', params.sessionId.toString());
let req = new HttpRequest<any>('GET', this.rootUrl + `/s/recommendations/${encodeURIComponent(String(params.digId))}`, __body, {
headers: __headers,
params: __params,
responseType: 'json',
});
let req = new HttpRequest<any>(
'GET',
this.rootUrl + `/s/recommendations/${encodeURIComponent(String(params.digId))}`,
__body,
{
headers: __headers,
params: __params,
responseType: 'json'
});
return this.http.request<any>(req).pipe(
__filter((_r) => _r instanceof HttpResponse),
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfItemDTO>;
}),
})
);
}
/**
@@ -745,15 +888,19 @@ class SearchService extends __BaseService {
* @return ResponseArgs of Recomendations
*/
SearchGetRecommendations(params: SearchService.SearchGetRecommendationsParams): __Observable<ResponseArgsOfIEnumerableOfItemDTO> {
return this.SearchGetRecommendationsResponse(params).pipe(__map((_r) => _r.body as ResponseArgsOfIEnumerableOfItemDTO));
return this.SearchGetRecommendationsResponse(params).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfItemDTO)
);
}
}
module SearchService {
/**
* Parameters for SearchTop2
*/
export interface SearchTop2Params {
/**
* Lager PK (optional)
*/
@@ -769,6 +916,7 @@ module SearchService {
* Parameters for SearchSearch2
*/
export interface SearchSearch2Params {
/**
* Lager PK (optional)
*/
@@ -784,6 +932,7 @@ module SearchService {
* Parameters for SearchAutocomplete2
*/
export interface SearchAutocomplete2Params {
/**
* Lager PK (optional)
*/
@@ -799,6 +948,7 @@ module SearchService {
* Parameters for SearchById2
*/
export interface SearchById2Params {
/**
* Lager PK (optional)
*/
@@ -814,6 +964,7 @@ module SearchService {
* Parameters for SearchByEAN2
*/
export interface SearchByEAN2Params {
/**
* Lager PK (optional)
*/
@@ -829,6 +980,7 @@ module SearchService {
* Parameters for SearchByEAN3
*/
export interface SearchByEAN3Params {
/**
* EANs
*/
@@ -844,6 +996,7 @@ module SearchService {
* Parameters for SearchDetail
*/
export interface SearchDetailParams {
/**
* PK
*/
@@ -855,6 +1008,7 @@ module SearchService {
* Parameters for SearchDetail2
*/
export interface SearchDetail2Params {
/**
* Lager PK (optional)
*/
@@ -871,6 +1025,7 @@ module SearchService {
* Parameters for SearchDetailByEAN2
*/
export interface SearchDetailByEAN2Params {
/**
* Lager PK (optional)
*/
@@ -895,4 +1050,4 @@ module SearchService {
}
}
export { SearchService };
export { SearchService }

View File

@@ -6,4 +6,4 @@ import { HttpResponse } from '@angular/common/http';
*/
export type StrictHttpResponse<T> = HttpResponse<T> & {
readonly body: T;
};
}

View File

@@ -31,8 +31,9 @@ const PARAMETER_CODEC = new ParameterCodec();
export class BaseService {
constructor(
protected config: CheckoutConfiguration,
protected http: HttpClient,
) {}
protected http: HttpClient
) {
}
private _rootUrl: string = '';
@@ -56,7 +57,7 @@ export class BaseService {
*/
protected newParams(): HttpParams {
return new HttpParams({
encoder: PARAMETER_CODEC,
encoder: PARAMETER_CODEC
});
}
}

View File

@@ -8,7 +8,7 @@ import { Injectable } from '@angular/core';
providedIn: 'root',
})
export class CheckoutConfiguration {
rootUrl: string = 'https://isa-test.paragon-data.net';
rootUrl: string = 'https://isa-test.paragon-data.net/checkout/v6';
}
export interface CheckoutConfigurationInterface {

View File

@@ -131,8 +131,9 @@ export { PaymentType } from './models/payment-type';
export { CountryTargetDTO } from './models/country-target-dto';
export { BranchTargetDTO } from './models/branch-target-dto';
export { EntityDTOBaseOfShopDTOAndIShop } from './models/entity-dtobase-of-shop-dtoand-ishop';
export { CampaignDTO } from './models/campaign-dto';
export { LoyaltyDTO } from './models/loyalty-dto';
export { PromotionDTO } from './models/promotion-dto';
export { EntityDTOBaseOfShoppingCartItemDTOAndIShoppingCartItem } from './models/entity-dtobase-of-shopping-cart-item-dtoand-ishopping-cart-item';
export { EntityDTOBaseOfCheckoutItemDTOAndICheckoutItem } from './models/entity-dtobase-of-checkout-item-dtoand-icheckout-item';
export { DisplayItemDTO } from './models/display-item-dto';
export { EntityDTOBaseOfCheckoutDeliveryDTOAndICheckoutDelivery } from './models/entity-dtobase-of-checkout-delivery-dtoand-icheckout-delivery';

View File

@@ -1,14 +1,18 @@
/* tslint:disable */
import { AvailabilityDTO } from './availability-dto';
import { CampaignDTO } from './campaign-dto';
import { EntityDTOContainerOfDestinationDTO } from './entity-dtocontainer-of-destination-dto';
import { ItemType } from './item-type';
import { LoyaltyDTO } from './loyalty-dto';
import { ProductDTO } from './product-dto';
import { PromotionDTO } from './promotion-dto';
import { Price } from './price';
export interface AddToShoppingCartDTO {
availability?: AvailabilityDTO;
campaign?: CampaignDTO;
destination?: EntityDTOContainerOfDestinationDTO;
itemType?: ItemType;
loyalty?: LoyaltyDTO;
product?: ProductDTO;
promotion?: PromotionDTO;
quantity: number;

View File

@@ -1,7 +1,7 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
import { GeoLocation } from './geo-location';
export interface AddressDTO extends TouchedBase {
export interface AddressDTO extends TouchedBase{
apartment?: string;
careOf?: string;
city?: string;

View File

@@ -4,7 +4,7 @@ import { AddressDTO } from './address-dto';
import { CommunicationDetailsDTO } from './communication-details-dto';
import { Gender } from './gender';
import { OrganisationDTO } from './organisation-dto';
export interface AddresseeWithReferenceDTO extends EntityReferenceDTO {
export interface AddresseeWithReferenceDTO extends EntityReferenceDTO{
address?: AddressDTO;
communicationDetails?: CommunicationDetailsDTO;
firstName?: string;

View File

@@ -1,43 +1,2 @@
/* tslint:disable */
export type AllergeneType =
| 0
| 1
| 2
| 4
| 6
| 8
| 16
| 32
| 64
| 128
| 256
| 512
| 1024
| 1536
| 2048
| 6144
| 10240
| 18432
| 34816
| 67584
| 133120
| 264192
| 526336
| 1048576
| 3145728
| 5242880
| 9437184
| 17825792
| 34603008
| 68157440
| 135266304
| 268435456
| 805306368
| 1342177280
| 2415919104
| 4563402752
| 8858370048
| 17448304640
| 34628173824
| 68987912192
| 137438953472;
export type AllergeneType = 0 | 1 | 2 | 4 | 6 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 1536 | 2048 | 6144 | 10240 | 18432 | 34816 | 67584 | 133120 | 264192 | 526336 | 1048576 | 3145728 | 5242880 | 9437184 | 17825792 | 34603008 | 68157440 | 135266304 | 268435456 | 805306368 | 1342177280 | 2415919104 | 4563402752 | 8858370048 | 17448304640 | 34628173824 | 68987912192 | 137438953472;

View File

@@ -6,7 +6,7 @@ import { EntityDTOContainerOfLogisticianDTO } from './entity-dtocontainer-of-log
import { PriceDTO } from './price-dto';
import { EntityDTOContainerOfShopItemDTO } from './entity-dtocontainer-of-shop-item-dto';
import { EntityDTOContainerOfSupplierDTO } from './entity-dtocontainer-of-supplier-dto';
export interface AvailabilityDTO extends TouchedBase {
export interface AvailabilityDTO extends TouchedBase{
availabilityType?: AvailabilityType;
estimatedDelivery?: DateRangeDTO;
estimatedShippingDate?: string;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type AvailabilityType = 0 | 1 | 2 | 32 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384;
export type AvailabilityType = 0 | 1 | 2 | 32 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type Avoirdupois = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;
export type Avoirdupois = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;

View File

@@ -4,7 +4,7 @@ import { AddressDTO } from './address-dto';
import { BranchType } from './branch-type';
import { EntityDTOContainerOfLabelDTO } from './entity-dtocontainer-of-label-dto';
import { EntityDTOContainerOfBranchDTO } from './entity-dtocontainer-of-branch-dto';
export interface BranchDTO extends EntityDTOBaseOfBranchDTOAndIBranch {
export interface BranchDTO extends EntityDTOBaseOfBranchDTOAndIBranch{
address?: AddressDTO;
branchNumber?: string;
branchType?: BranchType;

View File

@@ -2,7 +2,7 @@
import { BranchType } from './branch-type';
export interface BranchQueryTokenDTO {
branchType?: BranchType;
input?: { [key: string]: string };
input?: {[key: string]: string};
labelKey?: string;
skip?: number;
take?: number;

View File

@@ -1,7 +1,7 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
import { EntityDTOContainerOfBranchDTO } from './entity-dtocontainer-of-branch-dto';
export interface BranchTargetDTO extends TouchedBase {
export interface BranchTargetDTO extends TouchedBase{
isDefault?: string;
start?: string;
stop?: string;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type BranchType = 0 | 1 | 2 | 4 | 8 | 16;
export type BranchType = 0 | 1 | 2 | 4 | 8 | 16;

View File

@@ -2,7 +2,7 @@
import { AddresseeWithReferenceDTO } from './addressee-with-reference-dto';
import { BuyerStatus } from './buyer-status';
import { BuyerType } from './buyer-type';
export interface BuyerDTO extends AddresseeWithReferenceDTO {
export interface BuyerDTO extends AddresseeWithReferenceDTO{
buyerNumber?: string;
buyerStatus?: BuyerStatus;
buyerType?: BuyerType;

View File

@@ -4,8 +4,9 @@
* Input
*/
export interface BuyerPayload {
/**
* Kundenattribute
*/
customerFeatures?: { [key: string]: string };
customerFeatures?: {[key: string]: string};
}

View File

@@ -7,6 +7,7 @@ import { QueryTokenDTO } from './query-token-dto';
* Output
*/
export interface BuyerResult {
/**
* Kundenattribute
*/

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type BuyerStatus = 0 | 1 | 2 | 4 | 8 | 16;
export type BuyerStatus = 0 | 1 | 2 | 4 | 8 | 16;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type BuyerType = 0 | 1 | 2 | 4 | 8 | 16;
export type BuyerType = 0 | 1 | 2 | 4 | 8 | 16;

View File

@@ -0,0 +1,8 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
export interface CampaignDTO extends TouchedBase{
code?: string;
label?: string;
type?: string;
value?: number;
}

View File

@@ -2,7 +2,7 @@
import { EntityDTOBase } from './entity-dtobase';
import { EntityDTOContainerOfCategoryDTO } from './entity-dtocontainer-of-category-dto';
import { EntityDTOContainerOfTenantDTO } from './entity-dtocontainer-of-tenant-dto';
export interface CategoryDTO extends EntityDTOBase {
export interface CategoryDTO extends EntityDTOBase{
key?: string;
name?: string;
parent?: EntityDTOContainerOfCategoryDTO;

View File

@@ -6,7 +6,7 @@ import { PriceValueDTO } from './price-value-dto';
import { DisplayItemDTO } from './display-item-dto';
import { EntityDTOContainerOfCheckoutItemDTO } from './entity-dtocontainer-of-checkout-item-dto';
import { TermsOfDeliveryDTO } from './terms-of-delivery-dto';
export interface CheckoutDeliveryDTO extends EntityDTOBaseOfCheckoutDeliveryDTOAndICheckoutDelivery {
export interface CheckoutDeliveryDTO extends EntityDTOBaseOfCheckoutDeliveryDTOAndICheckoutDelivery{
checkout?: EntityDTOContainerOfCheckoutDTO;
destination?: EntityDTOContainerOfDestinationDTO;
discount?: PriceValueDTO;

View File

@@ -11,7 +11,7 @@ import { EntityDTOContainerOfBranchDTO } from './entity-dtocontainer-of-branch-d
import { PayerDTO } from './payer-dto';
import { PaymentDTO } from './payment-dto';
import { UserAccountDTO } from './user-account-dto';
export interface CheckoutDTO extends EntityDTOBaseOfCheckoutDTOAndICheckout {
export interface CheckoutDTO extends EntityDTOBaseOfCheckoutDTOAndICheckout{
agreements?: Array<KeyValueDTOOfStringAndString>;
availableShippingTargets?: Array<SelectionDTOOfShippingTarget>;
buyer?: BuyerDTO;

View File

@@ -4,7 +4,7 @@ import { EntityDTOContainerOfShoppingCartItemDTO } from './entity-dtocontainer-o
import { EntityDTOContainerOfCheckoutDTO } from './entity-dtocontainer-of-checkout-dto';
import { EntityDTOContainerOfCheckoutDeliveryDTO } from './entity-dtocontainer-of-checkout-delivery-dto';
import { PriceValueDTO } from './price-value-dto';
export interface CheckoutItemDTO extends EntityDTOBaseOfCheckoutItemDTOAndICheckoutItem {
export interface CheckoutItemDTO extends EntityDTOBaseOfCheckoutItemDTOAndICheckoutItem{
accessories?: Array<EntityDTOContainerOfShoppingCartItemDTO>;
checkout?: EntityDTOContainerOfCheckoutDTO;
delivery?: EntityDTOContainerOfCheckoutDeliveryDTO;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type CheckoutStep = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;
export type CheckoutStep = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
export interface CommunicationDetailsDTO extends TouchedBase {
export interface CommunicationDetailsDTO extends TouchedBase{
email?: string;
fax?: string;
mobile?: string;

View File

@@ -2,7 +2,7 @@
import { EntityDTOBaseOfCompanyDTOAndICompany } from './entity-dtobase-of-company-dtoand-icompany';
import { AddressDTO } from './address-dto';
import { EntityDTOContainerOfCompanyDTO } from './entity-dtocontainer-of-company-dto';
export interface CompanyDTO extends EntityDTOBaseOfCompanyDTOAndICompany {
export interface CompanyDTO extends EntityDTOBaseOfCompanyDTOAndICompany{
address?: AddressDTO;
companyNumber?: string;
costUnit?: string;

View File

@@ -1,2 +1,2 @@
/* tslint:disable */
export type ComponentItemDisplayType = 0 | 1 | 2;
export type ComponentItemDisplayType = 0 | 1 | 2;

View File

@@ -4,7 +4,7 @@ import { EntityDTOContainerOfCategoryDTO } from './entity-dtocontainer-of-catego
import { ComponentItemDisplayType } from './component-item-display-type';
import { EntityDTOContainerOfItemDTO } from './entity-dtocontainer-of-item-dto';
import { QuantityUnitType } from './quantity-unit-type';
export interface ComponentItemDTO extends TouchedBase {
export interface ComponentItemDTO extends TouchedBase{
category?: EntityDTOContainerOfCategoryDTO;
description?: string;
displayType?: ComponentItemDisplayType;

View File

@@ -3,7 +3,7 @@ import { EntityDTOBaseOfComponentsDTOAndIComponents } from './entity-dtobase-of-
import { ComponentItemDTO } from './component-item-dto';
import { QuantityUnitType } from './quantity-unit-type';
import { SetType } from './set-type';
export interface ComponentsDTO extends EntityDTOBaseOfComponentsDTOAndIComponents {
export interface ComponentsDTO extends EntityDTOBaseOfComponentsDTOAndIComponents{
items?: Array<ComponentItemDTO>;
overallQuantityMax?: number;
overallQuantityMin?: number;

View File

@@ -3,7 +3,7 @@ import { EntityDTOBaseOfContributorDTOAndIContributor } from './entity-dtobase-o
import { OrganisationNamesDTO } from './organisation-names-dto';
import { PersonNamesDTO } from './person-names-dto';
import { EntityDTOContainerOfTenantDTO } from './entity-dtocontainer-of-tenant-dto';
export interface ContributorDTO extends EntityDTOBaseOfContributorDTOAndIContributor {
export interface ContributorDTO extends EntityDTOBaseOfContributorDTOAndIContributor{
friendlyName?: string;
organisation?: OrganisationNamesDTO;
person?: PersonNamesDTO;

View File

@@ -1,7 +1,7 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
import { EntityDTOContainerOfContributorDTO } from './entity-dtocontainer-of-contributor-dto';
export interface ContributorHelperDTO extends TouchedBase {
export interface ContributorHelperDTO extends TouchedBase{
contributor?: EntityDTOContainerOfContributorDTO;
type?: string;
}

View File

@@ -1,6 +1,6 @@
/* tslint:disable */
import { EntityDTOBaseOfCountryDTOAndICountry } from './entity-dtobase-of-country-dtoand-icountry';
export interface CountryDTO extends EntityDTOBaseOfCountryDTOAndICountry {
export interface CountryDTO extends EntityDTOBaseOfCountryDTOAndICountry{
isDefault?: string;
isO3166_A_3?: string;
name?: string;

View File

@@ -1,7 +1,7 @@
/* tslint:disable */
import { TouchedBase } from './touched-base';
import { EntityDTOContainerOfCountryDTO } from './entity-dtocontainer-of-country-dto';
export interface CountryTargetDTO extends TouchedBase {
export interface CountryTargetDTO extends TouchedBase{
isDefault?: string;
start?: string;
stop?: string;

View File

@@ -2,7 +2,7 @@
import { EntityDTOBaseOfCouponDTOAndICoupon } from './entity-dtobase-of-coupon-dtoand-icoupon';
import { CouponType } from './coupon-type';
import { PriceValueDTO } from './price-value-dto';
export interface CouponDTO extends EntityDTOBaseOfCouponDTOAndICoupon {
export interface CouponDTO extends EntityDTOBaseOfCouponDTOAndICoupon{
code?: string;
couponType: CouponType;
discount?: number;

Some files were not shown because too many files have changed in this diff Show More