feat(crm-customer-booking): add loyalty card booking component
Implement new component for customer loyalty card credit/debit bookings with booking type selection and real-time transaction updates. Includes automatic reload of transaction history after successful bookings.
Key changes:
- Add CrmFeatureCustomerBookingComponent with booking form UI
- Create CustomerCardBookingFacade for booking API calls
- Add CustomerBookingReasonsResource for loading booking types
- Extend CrmSearchService with booking methods (addBooking, fetchBookingReasons, fetchCurrentBookingPartnerStore)
- Add AddBookingSchema with Zod validation
- Integrate component into KundenkarteMainViewComponent
- Update CustomerCardTransactionsResource to providedIn: 'root' for shared access
- Improve transaction list UX (hide header/center empty state when no data)
Technical details:
- New library: @isa/crm/feature/customer-booking (Vitest-based)
- Signals-based state management with computed properties
- Automatic points calculation based on booking type multiplier
- Error handling with feedback dialogs
- 500ms delay before transaction reload to ensure API consistency
- Data attributes for E2E testing (data-what, data-which)
Ref: #5315
feat(core/auth): add type-safe role-based authorization library
Created @isa/core/auth library with comprehensive role checking:
- RoleService for programmatic hasRole() checks
- IfRoleDirective for declarative *ifRole/*ifNotRole templates
- Type-safe Role enum (CallCenter, Store)
- TokenProvider abstraction with OAuth2 integration
- Signal-based reactive rendering with Angular effects
- Zero-configuration setup via InjectionToken factory
Fixed Bug #5451:
- Hide action buttons for HSC (CallCenter) users on reward order confirmation
- Applied *ifNotRole="Role.CallCenter" to actions container
- Actions now hidden while maintaining card visibility
Testing:
- 18/18 unit tests passing with Vitest
- JUnit and Cobertura reporting configured
- Complete test coverage for role checking logic
Documentation:
- Comprehensive README (817 lines) with API reference
- Usage examples and architecture diagrams
- Updated library-reference.md (62→63 libraries)
Technical:
- Handles both string and array JWT role formats
- Integrated with @isa/core/logging
- Standalone directive (no module imports)
- Full TypeScript type safety
Closes#5451
Related work items: #5451
🐛 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
fix(auth): prevent duplicate login popup on slow networks during QR code login
This commit fixes issue #5367 where the login popup appeared twice on iPad
(and other devices) during QR code authentication when using slow network
connections (e.g., Fast 4G).
Root Cause:
During the QR code login flow on slow networks, there was a race condition:
1. User scans QR code and login flow initiates
2. Before SSO redirect completes, HTTP requests (e.g., user storage) fail with 401
3. HTTP error interceptor caught these 401s and triggered another login popup
Changes:
1. HTTP Error Interceptor (http-error.interceptor.ts):
- Now checks if auth is initialized before handling 401 errors
- Only triggers login flow after authentication initialization completes
- Prevents duplicate login popups during initial authentication
2. User Storage Provider (user.storage-provider.ts):
- Waits for authentication to complete before loading user state
- Uses authenticated$ observable to ensure user is logged in
- Prevents unnecessary 401 errors during login flow
- Added structured logging for better debugging
3. Auth Service (auth.service.ts):
- Added authenticated$ observable to track authentication state
- Enhanced logging throughout authentication lifecycle
- Better state management for authentication status
4. App Module (app.module.ts):
- Added comprehensive logging for initialization steps
- Store subscription now waits for auth to be initialized
- Better error handling and status reporting
5. Storage Tokens (tokens.ts):
- USER_SUB token now properly reacts to authentication changes
- Uses authenticated$ observable for reactive updates
Result:
- No more duplicate login popups on slow networks
- User storage only loads when user is authenticated
- Better logging and debugging capabilities
- Cleaner, more reactive authentication flow
Related work items: #5367
- 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