refactor(checkout): consolidate adapters and implement unified checkout completion flow

Refactor checkout data-access layer to use centralized adapter pattern for converting between CRM and Checkout domain models. Extract business logic into dedicated helper modules and implement complete order button component for reward shopping cart.

Changes:
- Add 8 new adapters (availability, branch, customer, logistician, payer, product-number, shipping-address, shopping-cart-item) with comprehensive unit tests
- Create 3 helper modules: checkout-analysis, checkout-business-logic, checkout-data for separation of concerns
- Implement complete-order-button component with Tailwind styling for reward shopping cart
- Extend checkout models with Buyer and Payer types, update OrderOptions interface
- Add CustomerType, BuyerType, PayerType enums to common and CRM data-access layers
- Refactor customer component address selection to use new CustomerAdapter and ShippingAddressAdapter
- Update CheckoutService with refactored logic using new adapters and helpers
- Update CrmTabMetadataService to use consistent payer/shipping address ID tracking
- Add comprehensive documentation for checkout completion flow and service architecture
This commit is contained in:
Lorenz Hilpert
2025-10-07 13:50:11 +02:00
parent d9940740ce
commit 4fc5f16721
55 changed files with 8832 additions and 1453 deletions

View File

@@ -850,11 +850,11 @@ export class FilterService {
case InputType.NumberRange: {
const { min: minVal, max: maxVal } = input;
if (minVal != null && maxVal != null) {
result[input.key] = `"${minVal}-${maxVal}"`;
result[input.key] = `${minVal}-${maxVal}`;
} else if (minVal != null) {
result[input.key] = `"${minVal}-"`;
result[input.key] = `${minVal}-`;
} else if (maxVal != null) {
result[input.key] = `"-${maxVal}"`;
result[input.key] = `-${maxVal}`;
}
break;
}
@@ -978,13 +978,9 @@ export class FilterService {
}
case InputType.NumberRange: {
const decoded = decodeURIComponent(params[key]);
const [minRaw, maxRaw] = decoded.split('-"');
const min = minRaw
? Number(minRaw.replace(/"-/g, '').replace(/"/g, ''))
: undefined;
const max = maxRaw
? Number(maxRaw.replace(/"-/g, '').replace(/"/g, ''))
: undefined;
const [minRaw, maxRaw] = decoded.split('-');
const min = minRaw ? Number(minRaw.replace(/-/g, '')) : undefined;
const max = maxRaw ? Number(maxRaw.replace(/-/g, '')) : undefined;
this.setInputNumberRangeValue(key, min, max);
break;
}