🐛 fix(checkout): include download orders in destination update flow
Fixes#5448 - Prämienshop download orders now properly update destination
logistician before order creation. Previously, download orders were excluded
from the destination update step, causing null logistician errors during
order creation in the reward shop.
The fix adds hasDownload to the condition that determines whether to update
destination shipping addresses, ensuring download items (including those
purchased with loyalty points) get their logistician properly assigned.
Related work items: #5448
feat(shared-filter, ui-switch): add switch filter menu button for inline toggle filters
Add a new SwitchMenuButtonComponent that renders filter inputs as compact toggle switches
without an overlay menu. This provides a more streamlined UX for simple boolean/single-option
filters directly in the controls panel.
Key changes:
- Create new switch-menu module with button component and tests
- Extend FilterControlsPanelComponent to accept switchFilters input array
- Rename IconSwitchComponent to SwitchComponent for consistency
- Update filter actions to use 'target' property instead of 'group' for filtering
- Add isEmptyFilterInput support for NumberRange inputs
- Export switch-menu module from shared/filter public API
The switch button auto-commits on toggle and uses the checkbox filter model internally,
allowing simple configuration like:
switchFilters = [{ filter: stockFilter, icon: 'isaFiliale' }]
This implementation follows the existing filter architecture patterns and maintains
full accessibility support through ARIA attributes and keyboard navigation.
Ref: #5427
- Upgrade Angular from 20.1.2 to 20.3.6
- Upgrade Angular CDK from 20.1.2 to 20.2.9
- Upgrade ng-icons from 32.0.0 to 32.2.0
- Upgrade angular-eslint from 20.1.1 to 20.4.0
- Upgrade @ngneat/spectator from 19.6.2 to 22.0.0
- Upgrade ng-mocks from 14.13.5 to 14.14.0
- Upgrade ng-packagr from 20.1.0 to 20.3.0
- Upgrade @analogjs tools from 1.19.1 to 1.21.3
- Update Node.js engine requirement to >=22.12.0 <23.0.0
- Update npm engine requirement to >=11.6.0 <11.7.0
feat(crm): introduce PrimaryCustomerCardResource and format-name utility
Replace SelectedCustomerBonusCardsResource with a new PrimaryCustomerCardResource
that automatically loads and exposes the primary customer card as a signal.
This simplifies customer card access across the application by providing a
centralized, root-level injectable resource with automatic tab synchronization.
Create new @isa/utils/format-name library to consolidate customer name formatting
logic previously duplicated across components. The utility formats names with
configurable first name, last name, and organization name fields.
Key changes:
- Add PrimaryCustomerCardResource as providedIn root service with automatic
customer selection tracking via effect
- Remove SelectedCustomerBonusCardsResource and its manual provisioning
- Extract formatName function to dedicated utility library with Vitest setup
- Update all reward-related components to use new resource pattern
- Migrate OMS components to use centralized format-name utility
- Add comprehensive unit tests for formatName function
BREAKING CHANGE: SelectedCustomerBonusCardsResource has been removed
Ref: #5389
- Add new reward-order-confirmation feature library with components and store
- Implement checkout completion orchestrator service for order finalization
- Migrate checkout/oms/crm models to Zod schemas for better type safety
- Add order creation facade and display order schemas
- Update shopping cart facade with order completion flow
- Add comprehensive tests for shopping cart facade
- Update routing to include order confirmation page
hotfix(remission-list-item, remission-list-empty-state): improve empty state logic and cleanup selected items on destroy
Refactor empty state display conditions in remission-list-empty-state component
to correctly handle search term validation. Move hasValidSearchTerm check to
parent condition to prevent displaying empty states during active searches.
Add ngOnDestroy lifecycle hook to remission-list-item component to properly
clean up selected quantities from the store when items are removed from the list.
This prevents memory leaks and ensures the store state remains synchronized with
the displayed items.
Changes:
- Move hasValidSearchTerm check in displayEmptyState computed signal to improve
empty state display logic
- Implement OnDestroy interface in RemissionListItemComponent
- Add removeItem call in ngOnDestroy to clean up store state
- Add corresponding unit tests for the cleanup behavior
Ref: #5387
- Add BatchingResource base class for automatic API request batching
- Refactor StockInfoComponent to use StockInfoResource with batching
- Remove redundant StockResource provider from RewardShoppingCartItemComponent
- Update tests to match new BatchingResourceRef API
- Add comprehensive documentation for BatchingResource pattern
The BatchingResource pattern optimizes multiple simultaneous stock info
requests by collecting params within a 250ms window and making a single
batched API call, significantly reducing network overhead.
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
feat: implement reward points system in purchase options
- Add version tracking to application store for data migration support
- Integrate redemption points display in purchase options list items
- Update purchase options modal to handle reward point calculations
- Enhance shopping cart item component with reward point functionality
- Add reward point schemas and validation to checkout data access
- Update user storage provider with versioning support
- Improve logger configuration in customer guard
- Update package dependencies for reward functionality
- Fix ESLint errors for code quality compliance
Refs: #5352
Related work items: #5263, #5352, #5355
feat(remission): refactor return receipt details and extract shared actions
Refactor remission return receipt details to use return-based data flow
instead of individual receipt fetching. Extract reusable action components
for better code organization and consistency.
- Remove deprecated fetchRemissionReturnReceipt method and schema
- Add helper functions for extracting data from return objects
- Replace receipt-specific components with return-based equivalents
- Create shared return-receipt-actions library with reusable components
- Update components to use modern Angular patterns (signals, computed)
- Improve data flow consistency across remission features
- Add comprehensive test coverage for new components
- Update eager loading support in fetch return functionality
The new architecture provides better data consistency and reduces
code duplication by centralizing receipt actions and data extraction
logic into reusable components.
Refs: #5242, #5138, #5232, #5241
feat(utils-ean-validation, remission-list): add EAN validation library and implement exact search
Create new EAN validation utility library with validator function and isEan helper.
Implement exact search functionality for remission lists that bypasses filters
when scanning EAN codes or performing exact searches.
Changes:
- Add new utils/ean-validation library with EAN regex validation
- Export eanValidator for Angular reactive forms integration
- Export isEan utility function for EAN validation checks
- Configure library with Vitest for testing
- Update remission list resource to support exact search mode
- Clear filters and orderBy when performing EAN-based searches
- Add data attributes to product info component for E2E testing
Ref: #5128
chore: update dependencies to latest versions
- Upgraded @ngrx packages from 19.2.1 to ^20.0.0
- Upgraded ngx-matomo-client from ^7.0.1 to ^8.0.0
- Upgraded jest and related packages from 30.0.4 to ^29.7.0
- Created a mock for ScannerButtonComponent in test-mocks.ts to facilitate testing.
- Updated test-setup.ts to mock browser APIs for the test environment.
- Refactored SelectRemiQuantityAndReasonComponent to simplify addToRemiList logic and update feedback dialog usage.
- Modified feedback-dialog.component.html to safely access message data.
- Cleaned up package-lock.json by removing deprecated and unnecessary dependencies.
- Updated form-data from 4.0.3 to 4.0.4
- Fixes GHSA-fjxv-7rqg-78g4: unsafe random function usage for boundary selection
- Applied npm audit fix --force due to peer dependency conflicts
- Introduce `addReturnItem` and `addReturnSuggestionItem` methods to `RemissionReturnReceiptService` with full schema validation and error handling
- Add models and schemas for receipt-return tuples and add-return-item/suggestion operations
- Refactor `RemissionStore` (formerly `RemissionSelectionStore`) to support selection, quantity updates, and clearing of remission items; update all usages to new store name and API
- Update `RemissionListItemComponent` to support item selection via checkbox and quantity dialog, following workspace UX and state management guidelines
- Enhance `RemissionListComponent` to handle selected items, batch remission, and error/success feedback using new store and service APIs
- Fix and extend tests for new store and service logic, ensuring coverage for selection, quantity, and remission flows
- Update remission start dialog and assign package number components for improved validation and loading state handling
Ref: #5221
feat: add unit tests for remission return receipt functionality
- Add tests for 4 new RemissionReturnReceiptService methods:
- removeReturnItemFromReturnReceipt()
- completeReturnReceipt()
- completeReturn()
- completeReturnReceiptAndReturn()
- Update RemissionReturnReceiptDetailsCardComponent tests for itemCount -> positionCount
- Add tests for new inputs and remove functionality in RemissionReturnReceiptDetailsItemComponent
- Add tests for canRemoveItems and completeReturn in RemissionReturnReceiptDetailsComponent
- All tests focus on happy path scenarios and isolated functionality
Refs: #5138
feat(remission-list, remission-shared-product-stock-info): implement product stock info display
Add product stock information to the remission list and shared product components.
This enhances user visibility into current stock levels directly within remission-related views,
improving workflow efficiency and reducing the need for context switching.
Ref: #4769, #5194
Resolved conflicts:
- .gitignore: Added .claude to ignored files
- nx.json: Kept HEAD version with extra eslint.config.js exclusion
- package.json: Merged dependencies, updated vitest to v3.1.1 for compatibility
- eslint config files: Fixed merge conflicts and accepted conversion from .mjs to .js
- Removed deleted files from refactor branch
- Regenerated package-lock.json with --legacy-peer-deps
Build and tests pass successfully.