feat(checkout): add branch selection to reward catalog
- Add new select-branch-dropdown library with BranchDropdownComponent
and SelectedBranchDropdownComponent for branch selection
- Extend DropdownButtonComponent with filter and option subcomponents
- Integrate branch selection into reward catalog page
- Add BranchesResource for fetching available branches
- Update CheckoutMetadataService with branch selection persistence
- Add comprehensive tests for dropdown components
Related work items: #5464
Added "skip:ci" tag to multiple project configurations to prevent CI runs
for certain libraries. This change affects the following libraries:
crm-feature-customer-card-transactions, crm-feature-customer-loyalty-cards,
oms-data-access, oms-feature-return-details, oms-feature-return-process,
oms-feature-return-summary, remission-data-access, remission-feature-remission-list,
remission-feature-remission-return-receipt-details, remission-feature-remission-return-receipt-list,
remission-shared-remission-start-dialog, remission-shared-return-receipt-actions,
shared-address, shared-delivery, ui-carousel, and ui-dialog.
Also updated CI command in package.json to exclude tests with the "skip:ci" tag.
- 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): prioritize reload trigger over exact search
Fix navigation issue where reload searches were incorrectly applying
exact search logic, causing filters to be cleared when they should
be preserved during navigation.
Changes:
- Update remission-list.resource.ts to check reload trigger before
exact search conditions
- Ensure reload trigger always clears input but preserves other query
parameters
- Prevent exact search from overriding reload behavior
- Add explanatory comment for reload priority logic
This ensures proper filter state management when users navigate
between remission lists, maintaining expected behavior for both
reload and exact search scenarios.
Ref: #5387
feat(remission-list): improve item update handling and UI feedback
Enhance the remission list item management by introducing a more robust
update mechanism that tracks both item removal and impediment updates.
Previously, the component only tracked deletion progress, but now it
handles both deletion and update scenarios, allowing for better state
management and user feedback.
Key changes:
- Replace simple inProgress boolean with UpdateItem interface containing
inProgress state, itemId, and optional impediment
- Update local items signal directly when items are removed or updated,
eliminating unnecessary API calls and improving performance
- Add visual highlight to "Remi Menge ändern" button when dialog is open
using a border style for better accessibility
- Improve error handling by tracking specific item operations
- Ensure selected items are properly removed from store when deleted
or updated
The new approach optimizes list reloads by only fetching data when
necessary and provides clearer visual feedback during item operations.
Unit Tests updated also
Ref: #5361
feat: enhance error handling and validation infrastructure
- Add comprehensive Zod error helper with German localization
- Migrate from deprecated .toPromise() to firstValueFrom()
- Enhance global error handler with ZodError support
- Implement storage features for signal stores with auto-save
- Add comprehensive test coverage for validation scenarios
- Update multiple stores with improved storage integration
- Extend tab management with enhanced navigation patterns
- Add checkout data-access barrel exports
- Update core-storage documentation with usage examples
Major improvements:
- Complete German error message translations for all Zod validation types
- Auto-save with configurable debouncing for signal stores
- Type-safe storage integration with schema validation
- Enhanced entity management with orphan cleanup
- Robust fallback strategies for validation failures
Breaking: Requires Zod validation errors to use new helper
Refs: #5345#5353
Related work items: #5345, #5353
fix(remission-list, remission-return-receipt-details, libs-dialog): improve error handling with dedicated error dialog
- Add RemissionResponseArgsErrorMessage constants for standardized error messages
- Create FeedbackErrorDialogComponent for consistent error display across the app
- Implement enhanced error handling in RemissionListComponent.handleRemitItemsError()
- Update RemissionReturnReceiptDetailsItemComponent to use new error dialog pattern
- Add injectFeedbackErrorDialog convenience function for easy error dialog injection
- Include comprehensive unit tests for new dialog component
- Replace generic error handling with specific ResponseArgsError handling
- Clear remission state when "AlreadyCompleted" error occurs
The new error dialog provides a standardized way to display backend error
messages to users with consistent styling and behavior. Error handling now
properly differentiates between different error types and takes appropriate
actions like clearing state for completed remissions.
Ref: #5331
fix(remission-list, remission-data-access): add impediment comment and remaining quantity handling for return suggestions
Add support for impedimentComment and remainingQuantity fields when adding return suggestion items. When quantity is less than available stock, automatically set impedimentComment to 'Restmenge' and calculate remainingQuantity as the difference between available stock and remitted quantity.
Changes:
- Add impedimentComment and remainingQuantity to AddReturnSuggestionItemSchema
- Update RemissionReturnReceiptService to handle new fields in addReturnSuggestionItem method
- Enhance RemissionListComponent to calculate and pass impediment data when remitting items
- Fix quantity calculation logic to properly handle partial remissions
Ref: #5322
fix(remission-data-access): replace hardcoded values with dynamic helper functions
Replace hardcoded assortment and retail price values in RemissionSearchService
with proper helper functions. Add getAssortmentFromItem and getRetailPriceFromItem
helpers to dynamically extract values from Item objects instead of using
static fallbacks.
Also fix potential undefined reference errors in remission list resource
by adding proper null checks for response merging operations.
Ref: #5321
Remove addToDepartmentList method and ensure items added via search dialog
are always processed as mandatory remission items (ReturnItem) instead of
department suggestions (ReturnSuggestion). This prevents items from being
incorrectly added to department overflow lists when remission is already
started, maintaining data consistency in the WBS system.
Changes:
- Remove addToDepartmentList method from RemissionSearchService
- Update remitItems to use mandatory list type for add-item flow
- Simplify addToRemiList to only use mandatory remission endpoint
- Add addItemFlow parameter to control remission list type behavior
Refs: #4768, #5273, #5280
fix(remission-data-access): remove automatic date defaulting in fetchRemissionReturnReceipts
Remove the automatic default of 7 days ago when no start date is provided
to the fetchRemissionReturnReceipts method. The service now passes the
start parameter directly to the API without modification, allowing the
API or schema to handle date defaults as intended.
This change improves the separation of concerns by moving date handling
logic out of the service layer and updates the corresponding test to
handle both defined and undefined start date scenarios.
Ref: #5256
feat(remission): remove Koerperlos remission list type
Remove the 'Körperlose Remi' option from remission list types as it's no longer needed. This simplifies the remission type selection by:
- Removing Koerperlos from RemissionListType constant
- Eliminating disabled state logic in dropdown component
- Removing special handling in changeRemissionType method
- Fixing label text from 'Abteilungen' to 'Abteilung' for consistency
The dropdown now only shows the two active remission types: Pflichtremission and Abteilungsremission.
Ref: #5303
feat(remission): add impediment management and UI enhancements for remission list
Implement comprehensive impediment handling for return items and suggestions
with enhanced user interface components and improved data access layer.
Key additions:
- Add impediment update schema and validation for return items
- Implement RemissionReturnReceiptService with full CRUD operations
- Create RemissionListItemComponent with actions and selection capabilities
- Add ProductInfoComponent with responsive layout and labeling
- Enhance UI Dialog system with improved injection patterns and testing
- Add comprehensive test coverage for all new components and services
- Implement proper data attributes for E2E testing support
Technical improvements:
- Follow SOLID principles with clear separation of concerns
- Use OnPush change detection strategy for optimal performance
- Implement proper TypeScript typing with Zod schema validation
- Add comprehensive JSDoc documentation for all public APIs
- Use modern Angular signals and computed properties for state management
Refs: #5275, #5038
feat(remission-data-access): enhance stock calculation to handle zero predefined quantities
Improve calculateStockToRemit and getStockToRemit functions to properly distinguish
between undefined and zero predefined return quantities. When predefinedReturnQuantity
is undefined, the system now falls back to approximation calculation (availableStock
minus remainingQuantityInStock). When predefinedReturnQuantity is explicitly set to 0,
the system respects this backend-calculated value.
Add comprehensive test coverage for edge cases including:
- Zero predefined return quantities for both Pflicht and Abteilung types
- Negative approximation calculations (clamped to 0)
- Null/undefined remainingQuantityInStock handling
- Missing returnItem scenarios for Abteilung type
Ref: #5280
fix(remission-helpers, remission-list-item): fix predefinedReturnQuantity handling and enhance stock validation
Fix issue where predefinedReturnQuantity value of 0 was being treated differently
from undefined in mandatory remission (Pflichtremission). Now both 0 and undefined
are handled consistently by changing the initial value to undefined and using
truthy check instead of strict undefined comparison.
Additionally enhance hasStockToRemit validation by requiring both availableStock
and stockToRemit to be greater than 0, preventing invalid remission states when
no stock is available.
Changes:
- Change predefinedReturnQuantity initial value from 0 to undefined in getStockToRemit
- Remove nullish coalescing operator that forced 0 default for predefinedReturnQuantity
- Update calculateStockToRemit to use truthy check (!predefinedReturnQuantity)
instead of strict undefined comparison
- Enhance hasStockToRemit computed property to validate both availableStock > 0
and stockToRemit > 0
- Add comprehensive test coverage for all hasStockToRemit edge cases including
negative values and zero combinations
Ref: #5269
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
fix(remission-data-access, remission-product-stock-info): improve stock information display and data handling
Enhance product stock info component with proper loading states.
- Add stockFetching input to ProductStockInfoComponent for loading states
- Update remission list components to properly handle stock fetching state
- Enhance type safety and documentation for better maintainability
The RemissionSearchService now provides clear documentation for all
methods including fetchList, fetchQuerySettings, and capacity fetching
operations. The ProductStockInfoComponent now properly displays loading
states during stock data retrieval.
Ref: #5243
feat(remission-data-access, remission-start-dialog): refactor remission workflow to use createRemission API
Replace the startRemission method with separate createRemission and assignPackage operations.
The new implementation improves error handling and provides better separation of concerns
between return creation and package assignment steps.
Key changes:
- Add CreateRemission interface to models with support for validation error properties
- Replace startRemission with createRemission method that handles return and receipt creation
- Update service methods to return ResponseArgs objects with proper error handling
- Enhance dialog components with reactive error handling using Angular effects
- Add comprehensive server-side validation error display in form controls
- Separate package assignment into dedicated step with individual loading states
- Improve test coverage with proper mocking of new service methods
The refactored workflow provides better user feedback for validation errors and maintains
the existing two-step process while improving maintainability and error handling.
Ref: #5251
feat(remission-data-access, remission-list-item): add remission item source tracking and delete functionality
Add comprehensive remission item source management with the ability to delete
manually added items from return receipts. Introduces new RemissionItemSource
model to track item origins and refactors remission list item components for
better action management.
Key changes:
- Add RemissionItemSource model with 'manually-added' and 'DisposalListModule' types
- Extend ReturnItem and ReturnSuggestion interfaces with source property
- Implement deleteReturnItem service method with comprehensive error handling
- Create RemissionListItemActionsComponent for managing item-specific actions
- Add conditional display logic for delete buttons based on item source
- Refactor RemissionListItemSelectComponent with hasStockToRemit input validation
- Add deleteRemissionListItemInProgress state management across components
- Include comprehensive test coverage for new delete functionality
This enhancement enables users to remove manually added items from remission
lists while preserving system-generated entries, improving workflow flexibility
and data integrity.
Ref: 5259
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
feat(remission): add getStockToRemit helper and improve stock calculation logic
Add new getStockToRemit helper function that handles different remission list types
(Pflicht and Abteilung) for calculating stock to remit. Refactor existing logic
to use the centralized helper instead of duplicated calculation code.
Changes:
- Add getStockToRemit function to handle RemissionListType-specific logic
- Update calculateStockToRemit to use strict undefined check for predefinedReturnQuantity
- Refactor RemissionListItemComponent to use getStockToRemit helper
- Update RemissionListComponent to use getStockToRemit for consistent calculations
- Add comprehensive test coverage for both helper functions
This centralizes stock calculation logic and ensures consistent behavior
across all remission components.
Ref: #5252
feat(filter): add maximum selection limits for checkbox filters
Implement a maxOptions property to limit the number of selections in checkbox filters.
This feature includes FIFO behavior for managing selections and hides the "Select All"
control when limits are set to prevent user confusion. Update related documentation
and components to reflect these changes.
Refs: #5250
feat(remission): add remission processed hint component and update schemas
- Introduced RemissionProcessedHintComponent to display hints based on remission processing status.
- Updated fetch-remission-return-receipts schema to include parameters for completed returns.
- Refactored remission return receipt service to handle completed and incomplete returns separately.
- Adjusted remission list component to utilize the new hint component and updated data fetching logic.
Refs: #5240#5136
- 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
fix: improve sorting of remission return receipts
- Refactor data fetching to use a single API call for all returns
- Apply sorting separately to completed and incomplete returns
- Fix template tracking to use index instead of potentially undefined ID
- Remove redundant API calls for incomplete returns
This ensures proper sorting of remission return receipts while maintaining
the separation between completed and incomplete items in the display order.
Ref: #5224
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
Enhance the fetchAssignedStock method to utilize memory storage for caching
assigned stock data. Update the resource loader to handle cached values and
set new stock data accordingly. Adjust the HTML button for better readability.
- Added @analogjs/vite-plugin-angular and @analogjs/vitest-angular to devDependencies.
- Updated @nx/vite to version 20.1.4.
- Added @vitest/coverage-v8 and @vitest/ui to devDependencies.
- Added jsdom to devDependencies.
- Added vite and vitest to devDependencies.
- Updated tsconfig.base.json to include new paths for shared libraries.
- Created vitest.workspace.ts for vitest configuration.
Refs: #5135