fix(checkout-data-access, checkout-reward-shopping-cart, checkout-reward-selection-dialog): Show Low Stock message inside Dialog, Adjusted Item Identifyer so that mergedItems inside reward-selection-dialog service works properly, Adjusted Error Message Logic and Quantity Select Logic based on purchasing Options for Abholung
Ref: #5523
fix(shared-filter, reward-catalog): Added Branch Filter Toggle to Reward HSC View, Adjusted Controls Panel Filter Styling and Layout to fix mobile issues and added spacing to order-by-toolbar
Refs: #5514, #5475
♻️ refactor(core-navigation): remove library and use TabService directly
Remove @isa/core/navigation library entirely as it was just a thin
wrapper around TabService.patchTabMetadata(). Consumers now use
TabService directly for scoped metadata operations.
Changes:
- Delete libs/core/navigation/ (~12 files, ~2900 LOC removed)
- Update 6 consumer components to use TabService directly
- Remove @isa/core/navigation path alias from tsconfig.base.json
- All operations now synchronous (removed async/await)
Migration pattern:
- preserveContext() → patchTabMetadata(tabId, { [scope]: data })
- restoreContext() → activatedTab()?.metadata?.[scope]
- restoreAndClearContext() → get + patchTabMetadata(tabId, { [scope]: null })
Refs #5502
fix(ui-layout, input-controls-dropdown, oms-return-details): prevent stale scroll events from closing dropdown on open
Delay scroll listener registration using requestAnimationFrame when
activating CloseOnScrollDirective. This prevents stale scroll events
still in the event queue from immediately triggering closeOnScroll
when opening the dropdown after scrolling.
Also adds conditional rendering for product format and publication date
in return-details-order-group-item component.
Refs: #5513
✨ feat(navigation): implement title management and enhance tab system
This commit introduces a comprehensive title management system and extends
the tab functionality with subtitle support, improving navigation clarity
and user experience across the application.
Key changes:
Title Management System:
- Add @isa/common/title-management library with dual approach:
- IsaTitleStrategy for route-based static titles
- usePageTitle() for component-based dynamic titles
- Implement TitleRegistryService for nested component hierarchies
- Automatic ISA prefix addition and TabService integration
- Comprehensive test coverage (1,158 lines of tests)
Tab System Enhancement:
- Add subtitle field to tab schema for additional context
- Update TabService API (addTab, patchTab) to support subtitles
- Extend Zod schemas with subtitle validation
- Update documentation with usage examples
Routing Modernization:
- Consolidate route guards using ActivateProcessIdWithConfigKeyGuard
- Replace 4+ specific guards with generic config-key-based approach
- Add title attributes to 100+ routes across all modules
- Remove deprecated ProcessIdGuard in favor of ActivateProcessIdGuard
Code Cleanup:
- Remove deprecated preview component and related routes
- Clean up unused imports and exports
- Update TypeScript path aliases
Dependencies:
- Update package.json and package-lock.json
- Add @isa/common/title-management to tsconfig path mappings
Refs: #5351, #5418, #5419, #5420
- Add --amend option with safety rules to commit command
- Add logging skill cross-references to angular-template and html-template
- Fix logging skill name from logging-helper to logging
- Add extended thinking triggers, context monitoring, and code investigation
rules to CLAUDE.md
feature(crm-data-access): Added check in customer resource if customerId has changed to prevent flickering in the view after Filter changes etc.
Ref: #5478
feature(checkout-reward, core-tabs): Added back button and configured it so it can accept optional route to navigate. Added orderNumber and orderDate to reward order confirmation
Ref: #5456
feature(ui-modal): add QR code display for URLs in dialog modals
Add automatic URL detection and QR code rendering in dialog modals:
- Parse dialog content to extract URLs (http/https)
- Display extracted URLs as QR codes using angularx-qrcode library
- Split content around URL to show text before and after the QR code
- Auto-detect URLs by default, with optional showUrlAsQrCode override
- Add comprehensive unit tests for URL parsing helpers
Ref: #5511
Customer Card Copy-to-Clipboard (#5508)
- Click on card number copies it to clipboard using Angular CDK Clipboard
- Shows success tooltip confirmation positioned on the right
- Tooltip auto-dismisses after 3 seconds
Card Stack Carousel Improvements (#5509)
- Fix card centering by using afterNextRender instead of AfterViewInit
- Add ResizeObserver to handle dynamic size changes
- Disable transforms until natural position is measured (prevents initial jump)
- Center single card in carousel view
Tooltip Enhancements
- Add success variant with green styling (isa-accent-green)
- Add position input (left | right | top | bottom)
- Add fade in/out CSS keyframes animations (150ms)
- Respect prefers-reduced-motion for accessibility
Related Tasks
- Closes#5508
- Refs #5509
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
fix(shared-barcode, crm-customer-card): improve barcode rendering with transparent SVG background
Enhance barcode component flexibility by separating container and SVG
background colors. The SVG barcode now defaults to transparent background
while maintaining container background control, enabling better integration
with various card designs.
Changes:
- Add separate svgBackground input for SVG element (default: transparent)
- Keep background input for container styling (default: #ffffff)
- Add containerWidth and containerHeight inputs for flexible sizing
- Update customer card to remove explicit white background on barcode
- Add opacity styling for inactive customer cards
- Enhance test coverage for new background and sizing inputs
The separation of concerns allows the barcode to adapt to parent container
backgrounds while maintaining consistent rendering across different contexts.
Ref: #5498
Add new skill for creating performant CSS animations:
- Native @keyframes animations with GPU acceleration
- Angular animate.enter/leave for modern view transitions
- Performance guidelines and best practices
- Reference guide for common animation patterns
feat(carousel): convert to transformX with touch support and card animations
- Convert carousel from scroll-based to translate3d() transform positioning
- Add touch/swipe support with direct DOM manipulation for smooth 60fps performance
- Add mouse drag support for desktop navigation
- Implement hardware-accelerated transforms with will-change optimization
- Add disabled input to prevent navigation when needed
- Fix bounds calculation to use parent viewport width
- Add card stacking animation with translateY and rotation effects
- Remove shadow for cards beyond 3rd position in stacked mode
- Update tests with 4 new disabled state test cases (17 tests total)
Refs #5499
Related work items: #5499
fix(navigation): prevent autoTriggerContinueFn from persisting across navigations
The autoTriggerContinueFn flag was remaining in navigation context after
being read, causing incorrect auto-triggering on subsequent page visits.
Changes:
- Add patchContext() method to NavigationContextService and NavigationStateService
for partial context updates without full replacement
- Update details-main-view.component to use patchContext() to clear the flag
immediately after reading, while preserving returnUrl
- Add comprehensive JSDoc and README documentation for patchContext()
- Include structured logging for patch operations
The new patchContext() method provides a cleaner API for updating specific
context properties without manually preserving all other properties.
Closes#5500
Related work items: #5500
fix(crm): prevent duplicate reload of loyalty points
Refactored reload mechanism to use parent-managed pattern:
- Child components emit events instead of reloading directly
- Parent coordinates reload of both transactions and bonus cards
- Added loading guards to prevent concurrent requests
- Added JSDoc documentation to public methods
Closes#5497
Related work items: #5497
- Add Step 4 for automatic library tagging
- Include --prefix parameter in Nx generation commands
- Document tag rules and verification steps
- Update creation report to show tags
- Add references to enforce-module-boundaries config
fix(utils-positive-integer-input, crm-customer-booking, crm-customer-card): add missing path mapping in tsconfig
Add the @isa/utils/positive-integer-input path mapping to tsconfig.base.json
to resolve module resolution issues. The library was created but the path
alias was not properly registered, causing import errors in consuming modules.
Ref: #5492
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.
✨ feat(crm): set selected customer when navigating to Prämienshop
Implements autoTriggerContinueFn pattern to properly set customer context
before navigating to reward shop from customer loyalty cards view.
Changes:
- Add output event to customer-loyalty-cards component (library layer)
- Handle navigation at app layer (kundenkarte-main-view) to respect module boundaries
- Use existing autoTriggerContinueFn pattern from details-main-view
- Inject NavigationStateService and CustomerSearchNavigation services
- Preserve context with returnUrl and autoTriggerContinueFn flag
This ensures customer selection logic (_setCustomer, _setBuyer, _setSelectedCustomerIdInTab)
executes before navigating to the reward shop, matching the behavior of the
continue() method in CustomerDetailsViewMainComponent.
Refs: #5485
Related work items: #5485
Add two new skills based on Angular Architects articles:
1. ngrx-resource-api: Guide for integrating Angular's Resource API with
NgRx Signal Store for reactive data management without RxJS
- withProps pattern for dependency injection
- Resource configuration and lifecycle
- Error handling and computed derivations
- Common patterns and best practices
2. angular-effects-alternatives: Guide for proper effect() usage and
declarative alternatives to prevent anti-patterns
- Valid use cases (logging, canvas, imperative APIs)
- Anti-patterns to avoid (state propagation, synchronization)
- Decision tree for choosing alternatives
- Refactoring patterns and code review checklist
Both skills follow modern Angular patterns and promote declarative,
maintainable code aligned with reactive principles.
- Replace manual type checking with Zod schema validation in isResponseArgs helper
- Simplify error handling logic in catchResponseArgsErrorPipe operator
- Remove redundant conditional checks by leveraging Zod's safeParse
- Remove unused ResponseArgs import from operator file
This improves type safety and validation robustness by using a declarative schema-based approach.
Add critical sections to CLAUDE.md covering:
- Context preservation rules to prevent bloat
- Agent invocation patterns (sequential/parallel/escalation)
- Result handling and synthesis guidelines
- Edge case handling (failures, timeouts, conflicts)
- Model selection criteria (Haiku vs Sonnet)
- Resume vs fresh agent decision framework
- Result validation and confidence communication
- Debug mode and special scenarios
- Performance degradation handling
- Caching strategies and priority conflict resolution
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
feature(crm, isa-app-customer-search): Adjustments to Card Transaction History, Added Scroll Top Button, Show 50 last Transactions, Wording changes
Refs: #5316
Commit 86563a73: ✨ feat(crm): add customer card transactions history feature
Implements #5316 - Service Portal History displaying last 5 loyalty card transactions
**New feature library:**
- Created @isa/crm/feature/customer-card-transactions with CDK table component
- Shows transactions for first activated customer loyalty card
- Displays: Date, Transaction type (reason), Amount (EUR), Receipt number, Points
**Data layer:**
- Added CustomerCardTransactionsResource with reactive resource pattern
- Extended CrmSearchService with fetchLoyaltyBookings() method
- Uses LoyaltyCardService.LoyaltyCardListBookings() API endpoint
**UI/UX:**
- CDK table with ISA design system colors
- Header: 48px height, rounded corners (26px), neutral-400 background
- Visual indicators: Green up arrow (EARN), Red down arrow (BURN)
- German locale formatting (dd.MM.yyyy HH:mm.ss)
- Full-width table layout with proper spacing (24px between rows)
- Empty state when no transactions available
**Icons:**
- Added isaActionPolygonUp and isaActionPolygonDown to @isa/icons
**Integration:**
- Integrated into kundenkarte-main-view component
- Automatically loads transactions for first active card
Related work items: #5316
fix(core-tabs): improve tab cleanup and naming logic
Refactor tab management to handle checkout state transitions more reliably:
- Extract helpers (formatCustomerTabNameHelper, checkCartHasItemsHelper,
getNextTabNameHelper) from checkout component to @isa/core/tabs for reuse
- Fix getNextTabNameHelper to count tabs instead of finding max ID,
preventing gaps in "Vorgang X" numbering
- Add canDeactivateTabCleanup guard to manage tab context based on cart state:
* Preserves customer context if either cart (regular or reward) has items
* Updates tab name with customer/organization name when context preserved
* Resets tab to clean "Vorgang X" state when both carts empty
* Handles navigation to global areas (without tab ID) gracefully
- Apply canDeactivateTabCleanup to checkout-summary and reward-order-confirmation routes
- Move tab cleanup logic from component ngOnDestroy to reusable guard
- Add comprehensive unit tests for getNextTabNameHelper
This ensures tabs maintain correct state after order completion, properly
display customer context when carts have items, and reset cleanly when
both carts are empty. The guard approach centralizes cleanup logic and
makes it reusable across checkout flows.
Ref: #5480
Replace window.location.href with Router.navigateByUrl() to ensure proper Angular navigation flow after authentication, maintaining state and avoiding full page reloads.
fix(core/tabs): Add logging and fix critical bugs in TabService
- Add comprehensive logging using @isa/core/logging for all TabService methods
- Fix null pointer in patchTab when tab doesn't exist
- Fix activateTab allowing non-existent tabs to be set as active
- Fix removeTab not clearing activatedTabId when removing active tab
- Replace unsafe 'as any' type casts with proper type checking
- Document side effect in getCurrentLocation method
Fixes#5474
Related work items: #5474
- Update nx-mcp command format in .mcp.json
- Add Nx configuration section to CLAUDE.md
- Create AGENTS.md with Nx guidelines
- Improve formatting in CLAUDE.md
feat(pickup-shelf): display Prämie label and Lesepunkte for reward items
- Add "Prämie" ui-label badge below product images in both list and details views
- Display Lesepunkte value instead of price for reward items
- Update getOrderItemRewardFeature helper to use structural typing for better type flexibility
- Apply to pickup-shelf-details-item and pickup-shelf-list-item components
Fixes#5467
feat(confirmation-list-item-action-card): improve action card visibility logic and add ordered state
Enhance the action card display logic to show only when both feature flag
and command/completion conditions are met. Add support for "Ordered" state
to distinguish pending items from completed ones.
Changes:
- Add hasLoyaltyCollectCommand helper to check for LOYALTY_COLLECT_COMMAND
- Update displayActionCard logic to require both Rücklage feature AND
(loyalty collect command OR completion state)
- Add ProcessingStatusState.Ordered to distinguish ordered vs completed items
- Update isComplete to exclude ordered items from completion state
- Move role-based visibility check to outer container level
- Remove unused CSS class for completed state
- Add comprehensive unit tests for new helpers
The action card now correctly appears only for items that need user action,
hiding for CallCenter role and for items without the required commands.
Ref: #5459
fix(customer-details): prioritize cart navigation over reward return URL
Fixes issue #5461 where navigating to cart after customer selection would
incorrectly route to reward shop page. Changed navigation priority to check
for regular shopping cart items before checking for reward return URL context.
This ensures that active standard checkout flows take precedence over any
lingering reward flow navigation context.
Related work items: #5461
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(crm-data-access, customer-details, reward-shopping-cart): persist selected addresses across navigation flows
Implement address selection persistence using CRM tab metadata to ensure
selected shipping addresses and payers are retained throughout the customer
selection flow, particularly when navigating from Kundenkarte to reward cart.
Changes include:
- Create PayerResource and CustomerPayerAddressResource to load selected
payer from tab metadata with fallback to customer as payer
- Create PayerService to fetch payer data from CRM API with proper error
handling and abort signal support
- Update BillingAndShippingAddressCardComponent to prefer selected addresses
from metadata over customer defaults, with computed loading state
- Refactor continue() flow in CustomerDetailsViewMainComponent to load
selected addresses from metadata before setting in checkout service
- Add adapter logic to convert CRM payer/shipping address types to checkout
types with proper type casting for incompatible enum types
- Implement fallback chain: metadata selection → component state → customer
default for both payer and shipping address
This ensures address selections made in the address selection dialogs are
properly preserved and applied when completing the customer selection flow,
fixing the issue where addresses would revert to customer defaults.
Ref: #5411
fix(open-reward-tasks): filter out pickup-only reward orders
Exclude reward orders with only pickup items (supplier_id: '16') from open tasks
as these cannot be completed in the reward shop.
Fixes BUG-5444
🐛 fix(order-destination): display 'Hugendubel Digital' for download destinations
Fixes#5453
- Add handling for Download order type in name() computed signal to return 'Hugendubel Digital'
- Add handling for Download order type in address() computed signal to return undefined
- Update template to conditionally show pipe separator and address only when address exists
- Add isaDeliveryDownload icon for download order type
- Remove unused OrderType import
Related work items: #5453
fix(purchase-options): resolve Lesepunkte delivery method change error
The commit includes:
- Restored ensureCurrencyDefaults import that was accidentally removed
- Fixed immutability violations in both getAddToShoppingCartDTOForItem and getUpdateShoppingCartItemDTOForItem methods
- Proper handling of frozen NgRx ComponentStore state objects
- Resolves bug #5452 where Lesepunkte delivery method changes failed
The pre-commit hooks ran successfully (ESLint passed with no changes needed). The fix is now ready to be pushed and tested.
Related work items: #5452
🐛 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
fix(reward-shopping-cart-item, filter-service): exclude downloads and text inputs from counts
Hide low stock warning for download items in reward shopping cart, as
downloads don't have physical inventory constraints.
Exclude text/searchbox inputs from selected filter count calculation
to prevent search queries from inflating the filter badge counter.
Remove unused isIconButtonActive computed property in filter menu button.
Ref: #5441
fix(reward-print, reward-popup, reward-destination): improve reward cart stability and UX
- fix: remove console.log statement from calculate-price-value helper
- fix: add loading/pending state to print button to prevent duplicate prints
- fix: debounce reward selection resource reloading to prevent race conditions
- fix: correct reward cart item destination-info alignment and flex behavior
- fix: support OrderType in OrderDestinationComponent alongside OrderTypeFeature
- fix: use unitPrice instead of total for price calculations in reward items
- refactor: update calculatePriceValue test descriptions for clarity
- fix: fallback to order.orderType when features don't contain orderType
The reward selection popup now properly waits for all resources to reload
before resolving, preventing timing issues with cart synchronization.
Print button shows pending state during print operations.
Destination info components now handle both legacy OrderType and new
OrderTypeFeature enums for better compatibility.
Ref: #5442, #5445
- Regenerated all Swagger API clients (availability, checkout, crm, isa, print, wws)
- Updated CRM loyalty card API endpoints (removed interests, added booking/bon management)
- Temporarily disabled interests form block functionality due to API changes
- Removed deprecated models (check-loyalty-card-result, loyalty-card-status, entity-key-value)
- Added new loyalty booking and bon management models and services
- Add junit reporter to vitest configs for CI/CD integration
- Enable cobertura coverage reports for test analytics
- Add @ts-expect-error comment for complex vitest reporter types
- Remove duplicate test target from reward-selection-dialog project.json
fix(filter-service, number-range-filter-input): resolve NumberRange state management and reference issues
**Root Cause:**
Filter service was experiencing reference sharing between current state and
committed state due to shallow copying in commit(), causing filters to
incorrectly appear as "changed" when mixing NumberRange with other filter
types like Checkbox.
**Changes Made:**
1. **State Management (filter.service.ts):**
- Use structuredClone() in commit() for deep copies to prevent reference sharing
- Update clear() to preserve structural properties (options array references)
- Refactor resetInput() to selectively copy only mutable properties while
preserving structural ones for isEqual() comparisons
- Simplify selectedFilterCount to use isDefaultFilterInput() consistently
2. **Default Values (number-range-filter-input.mapping.ts):**
- Parse minValue/maxValue from config (e.g., "1-" → 1) as defaults
- Use parsed defaults as initial min/max when no explicit value provided
**Impact:**
- NumberRange filters correctly display default values in UI
- Filters no longer incorrectly show as "changed" after multiple commits
- "Standardeinstellungen" works correctly when mixing NumberRange with other types
- selectedFilterCount accurately reflects changed filters including NumberRange
Ref: #5402
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
Remove the memory MCP server configuration and all references to the context-manager agent with persistent memory capabilities from CLAUDE.md.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🐛 fix(checkout): remove manual cart counter updates (#5412)
Remove updateProcessCount method and all manual calls to it.
The cart counter is now updated through reactive mechanisms,
ensuring it stays in sync when items are added or removed.
Fixes bug where reward cart icon counter was not updating
when items were removed from the cart.
Related work items: #5412
fix(checkout): resolve itemType validation error for download items
Updates ItemTypeSchema to accept bitwise flag combinations instead of
only individual enum values. The backend returns combined itemType
values (e.g., 20480 = ItemPrice | Download) which were causing Zod
validation errors when adding download/e-book items to cart.
Changes:
- Update ItemTypeSchema to use bitwise validation pattern
- Add comprehensive unit tests (24 tests) covering individual flags,
combinations, and edge cases
- Follow same pattern as NotificationChannelSchema and CRUDASchema
Closes#5429
Related work items: #5429
Replace the `group` property with `target` property in BaseFilterInputSchema to explicitly distinguish between 'filter' and 'input' query parameters. This improves code clarity and provides better semantic meaning.
**Changes:**
- Add `target` property to BaseFilterInputSchema with type 'filter' | 'input' and default 'input'
- Update filter.service.ts to use `target` instead of `group` for filtering inputs
- Update all filter input mappings (checkbox, date-range, number-range, text) to include `target` property
- Update all affected unit tests (9 test files) to include `target` in mock data
**Tests:** All 128 unit tests passing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
♻️ refactor(catalog): extract shared Reihe prefix pattern to constants
Ref: #5421
- Create reihe.constants.ts with REIHE_PREFIX_PATTERN constant
- Update LineTypePipe to use shared pattern and fix capture group index
- Update ReiheRoutePipe to use shared pattern
- Pattern now matches "Reihe:", "Reihe/Set:", and "Set/Reihe:"
Related work items: #5421
- Rename logging-helper to logging for consistency
- Remove git-commit-helper (superseded by /commit command)
- Add git-workflow skill for Git Flow operations
Co-Authored-By: Claude <noreply@anthropic.com>
- Rename skill directory from tailwind-isa to tailwind
- Update skill name in frontmatter metadata
- Update all references in CLAUDE.md (2 locations)
Simplifies naming while maintaining clear purpose. The skill provides
Tailwind CSS utilities and design system guidance for the ISA project.
- Create comprehensive html-template skill with 3 reference files
- E2E Testing Attributes (data-what, data-which patterns)
- ARIA Accessibility Attributes (roles, properties, states, WCAG)
- Combined Patterns (real-world examples with both)
- Move E2E attribute guidance from command to skill
- Add extensive ARIA accessibility documentation
- Update angular-template skill with cross-references
- Remove dev-add-e2e-attrs command (functionality now in skill)
The new skill provides 3,322 lines of comprehensive documentation
covering both testing and accessibility best practices for HTML
templates, with practical examples for forms, navigation, tables,
dialogs, and more.
Benefits:
- Clean separation: Angular syntax vs HTML attributes
- Reusable: html-template works with any HTML context
- Comprehensive: E2E + ARIA in one place
- Integrated: Works seamlessly with angular-template skill
feat(crm-data-access,checkout): improve primary bonus card selection logic
Enhance getPrimaryBonusCard helper to sort cards alphabetically by code
when multiple primary cards exist or when no primary card is designated.
This ensures deterministic card selection across the application.
Add comprehensive test coverage for edge cases including:
- Multiple primary cards (returns first alphabetically)
- No primary cards (returns first alphabetically)
- Empty bonus cards array (returns undefined)
Add TODO comments in ShoppingCartService for future refactoring of
cart handling logic to improve code organization and reusability.
Ref: #5407
Add changelog file following Keep a Changelog format.
Documents recent additions including checkout reward features, stock info
batching, CRM improvements, and Angular/Tailwind development skills.
Add two new Claude Code slash commands for developer workflow:
- /eod-report: Generate daily work summaries from git commits
- /generate-changelog: Create changelog entries from git tags
Both commands support flexible date ranges and output formatting.
fix(checkout): resolve currency constraint violations in price handling
- Add ensureCurrencyDefaults() helper to normalize price objects with EUR defaults
- Fix currency constraint violation in shopping cart item additions (bug #5405)
- Apply price normalization across availability, checkout, and shopping cart services
- Update 8 locations: availability.adapter, checkout.service, shopping-cart.service,
get-availability-params.adapter, availability-transformers, reward quantity control
- Refactor OrderType to @isa/common/data-access for cross-domain reusability
- Remove duplicate availability service from catalogue library
- Enhance PriceValue and VatValue schemas with proper currency defaults
- Add availability-transformers.spec.ts test coverage
- Fix QuantityControl fallback from 0 to 1 to prevent invalid state warnings
Resolves issue where POST requests to /checkout/v6/store/shoppingcart/{id}/item
were sending price objects without required currency/currencySymbol fields,
causing 400 Bad Request with 'Currency: Constraint violation: NotNull' error.
Related work items: #5405
🐛 fix(reward-order-confirmation): group items by item-level delivery type
Fix incorrect delivery type headers by grouping order items based on
item.features.orderType instead of order.features.orderType, since items
within a single order can have different delivery types.
Changes:
- Add groupDisplayOrderItemsByDeliveryType helper to group items by delivery type
- Add groupDisplayOrderItemsByBranch helper to group items by branch
- Refactor OrderConfirmationItemListComponent to use item-level grouping
- Move list rendering and grouping logic from parent to child component
- Update template to use branchGroup.items instead of branchGroup.allItems
Fixes#5403
Related work items: #5403
fix(reward-confirmation): improve action card visibility and status messages
Refactor confirmation action card to only display for items with 'Rücklage' feature.
Replace boolean completion check with state-based system using ProcessingStatusState
enum (Cancelled, NotFound, Collected). Add specific completion messages for each
state to provide clearer user feedback.
Changes:
- Add displayActionCard computed signal to check for 'Rücklage' feature
- Replace getProcessingStatusCompleted with getProcessingStatusState helper
- Add ProcessingStatusState enum with three states (Cancelled, NotFound, Collected)
- Update completion messages in template to use @switch based on processingStatus
- Wrap entire action card in @if block checking displayActionCard
- Add proper test coverage for new helper function
- Update component spec to provide required dependencies
Ref: #5391, #5404, #5406
feat(checkout-summary): add navigation to reward cart after order completion
Add conditional button to navigate to reward cart on checkout summary page.
The button appears only when the customer has a primary card and items
in their reward shopping cart.
Implementation details:
- Inject SelectedRewardShoppingCartResource and PrimaryCustomerCardResource
- Add computed signal displayRewardNavigation() to determine button visibility
- Add navigateToReward() method to handle navigation
- Provide SelectedRewardShoppingCartResource in module providers
- Update template with conditional button using new control flow syntax
Ref: #5311
fix(reward-order-confirmation): correct typo and add loading state to collect action
- Fix typo in "Rechnugsadresse" → "Rechnungsadresse"
- Add loading state signal to prevent duplicate collect operations
- Bind pending and disabled states to collect button
- Wrap collect operation in try-finally to ensure loading state cleanup
- Add comprehensive unit tests for loading state behavior
The loading state prevents users from triggering multiple concurrent
collect operations by disabling the button during API calls.
Ref: #5396
fix(customer-card): implement navigation flow from customer card to reward selection
Add navigation logic to Kundenkarte component that allows users to select
a customer and navigate to the reward shop. The flow now properly preserves
navigation context using NavigationStateService scoped to the active tab.
Changes include:
- Add customerId input to KundenkarteComponent for customer identification
- Replace placeholder onRewardShop() with navigateToReward() method
- Preserve navigation context with returnUrl and autoTriggerContinueFn flag
- Update kundenkarte-main-view to pass customerId to child component
- Modify details-main-view to auto-trigger continue() when returning from
Kundenkarte with the appropriate context flag
- Add loading state handling during navigation from customer card
- Update button disabled logic to check both card availability and loading
The navigation context is automatically scoped to the current tab and cleaned
up after use, ensuring proper isolation between tabs.
Ref: #5400
Add comprehensive skill documentation for @isa/core/logging usage:
- SKILL.md: Core principles, patterns, and best practices
- examples.md: Real-world usage scenarios across components/services
- reference.md: Quick API reference and configuration guide
- troubleshooting.md: Common issues and solutions
Provides guidance for consistent logging patterns throughout the codebase.
Update the logging library to accept context as either direct objects
or functions (MaybeLoggerContextFn), providing better ergonomics while
maintaining performance optimization through lazy evaluation.
Changes:
- Add MaybeLoggerContextFn type for flexible context handling
- Update logger() factory to accept context as object or function
- Update all LoggerApi methods to support both context formats
- Enhance README with comprehensive examples and migration guide
- Document performance benefits of function-based context
- Add backward compatibility notes for v2.1.0 enhancement
The new API is fully backward compatible - both direct objects and
function wrappers work seamlessly.
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
Add comprehensive skill for ISA-specific Tailwind CSS:
- Component-first approach (prefer @isa/ui/* libraries)
- ISA-prefixed color system (bg-isa-accent-red, etc.)
- Typography utilities (isa-text-*)
- Responsive breakpoint service integration
- Spacing patterns with rem-based utilities
- Complete design system reference documentation
- Anti-patterns and best practices guidance
Enforces design system consistency and component reuse
throughout the Angular monorepo.
Configure Figma Desktop MCP server for design-to-code workflows:
- HTTP connection on localhost:3845
- Enables design context and code generation from Figma
Add standardized branch naming pattern for features and bugfixes:
- Format: feature/{task-id}-{short-description}
- Use English kebab-case
- Start with task/issue ID
- Include example for clarity
Add .mcp.json with Context7, Nx MCP, and Angular MCP server configurations.
Remove .mcp.json and .memory.json from gitignore to allow tracking MCP configuration.
Implement comprehensive system to disable specific purchase options (e.g., B2B delivery) for reward flows while providing flexible UI control.
Key Features:
- `disabledPurchaseOptions`: Array to specify options to disable (skips API calls)
- `hideDisabledPurchaseOptions`: Toggle to hide or show disabled options
- true (default): Completely hidden from UI
- false: Shown with disabled visual state (grayed out, not clickable)
Implementation:
- Store: Added state field and isOptionDisabled() helper method
- Availability loading: Skip API calls for disabled options in _loadAvailabilities()
- UI: Base directive prevents clicks, applies .disabled CSS class
- Visual: CSS styling for disabled state (opacity, cursor, background)
- Component: Updated showOption() logic to respect hide flag
Reward Integration:
- Applied to reward-catalog: Disable B2B delivery for reward redemption
- Applied to reward-shopping-cart: Disable B2B delivery for cart items
Documentation:
- Comprehensive README.md with usage examples and architecture
- JSDoc comments on all interfaces, methods, and directives
- Migration notes for breaking change (hidePurchaseOptions renamed)
Breaking Change:
Renamed `hidePurchaseOptions` → `disabledPurchaseOptions` for clarity
Affected Files:
- Core: modal data, service, component, store, state
- Tiles: base directive, CSS styling
- Reward: catalog action, shopping cart item
Add preSelectOption configuration to purchase options modal when adding
reward items, defaulting to 'in-store' purchase option.
This improves UX by automatically selecting the most common purchase
method for reward items, reducing the number of steps required for the
user to complete their reward redemption.
Fix customer features mapping in purchase options store to use feature.key
instead of feature.value for both key and value in the customerFeatures record.
This ensures consistent feature key mapping across the purchase options flow.
Consolidate the separate continueReward() and continue() methods in the customer
details view into a single unified continue() method that handles both reward
selection and regular checkout flows.
Key changes:
- Remove separate continueReward() method
- Move hasReturnUrl() check to end of continue() method
- Share all validation and setup logic between both flows:
* Customer validation (canAddCustomer, canAddShippingAddress)
* Destination updates
* Guest with order checks
* Customer/buyer/payer/shipping setup
* Notification channel updates
- Diverge only at navigation step based on hasReturnUrl()
- Simplify template from 3 conditional buttons to 1 unified button with
conditional content
Benefits:
- Reduced code duplication (~39 lines removed)
- Consistent validation for both flows
- Enhanced reward flow with full business rule checks
- Single point of maintenance
- Cleaner template with reduced conditional complexity
Related to #5262 (Prämienshop-Modus)
feat(checkout): implement hierarchical grouping on rewards order confirmation page
Implements correct grouping by delivery option and target address on the
rewards order confirmation page (Prämien-Abschlussseite).
Changes:
- Add hierarchical grouping: primary by delivery type, secondary by branch
- Show branch name only when multiple branches exist within same delivery type
- Remove duplicate "Abholfiliale" section from addresses component
- Fix undefined shoppingCartItem error by providing fallback with DisplayOrderItem features
- Fix partial order creation error handling in checkout orchestrator
Implementation:
- New helpers: groupDisplayOrdersByDeliveryType, groupDisplayOrdersByBranch
- Updated reward-order-confirmation component with groupedOrders computed signal
- Added comprehensive unit tests (15 new tests, all passing)
- Graceful error handling for backend responses with partial order creation
Bug Fixes:
- Prevent undefined features error when shopping cart item not found
- Extract orders from HTTP error responses when backend returns warnings
- Add German documentation for error handling with TODO for user feedback
Related to: #5397
Related work items: #5397
Relocates helper functions from feature-specific reward-selection-dialog to shared data-access library, enabling cross-feature usage. Renames get-loyalty-points and get-price helpers to better reflect their calculation purpose.
Add comprehensive Claude Code tooling:
- Agents: docs-researcher, docs-researcher-advanced for documentation research
- Commands: dev:add-e2e-attrs, docs:library, docs:refresh-reference, quality:bundle-analyze, quality:coverage
- Skills: 8 specialized skills including api-change-analyzer, architecture-enforcer, library-scaffolder, and more
Update documentation:
- Comprehensive CLAUDE.md overhaul with library reference system
- Update testing guidelines in docs/guidelines/testing.md
- Update READMEs for checkout, icons, scanner, and scroll-position libraries
Remove outdated checkout-completion-flow-documentation.md
Update .gitignore for Claude Code files
- 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
- Restructure CLAUDE.md with clearer sections and updated metadata
- Add research guidelines emphasizing subagent usage and documentation-first approach
- Create library reference guide covering all 61 libraries across 12 domains
- Add automated library reference generation tool
- Complete test coverage for reward order confirmation feature (6 new spec files)
- Refine product info components and adapters with improved documentation
- Update workflows documentation for checkout service
- Fix ESLint issues: case declarations, unused imports, and unused variables
- Extract reusable ProductInfoComponent from ProductInfoRedemptionComponent
- Implement order confirmation item list with product, action card, and destination info
- Add completed shopping carts tracking to checkout metadata service
- Create Storybook stories for product info component variants
- Update checkout completion orchestrator to store shopping cart data
- Extract COMPLETED_SHOPPING_CARTS_METADATA_KEY constant for consistency
Implement the complete UI for the reward order confirmation page including address displays, order item lists, and supporting helper functions.
Features:
- Add order confirmation addresses component displaying billing, delivery, and pickup branch addresses
- Implement order confirmation item list with order type icons and item details
- Add helper functions for order type feature checking and address/branch deduplication
- Integrate store computed properties for payers, shipping addresses, and target branches
- Apply responsive layout with Tailwind CSS styling
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 ConfirmationListItemActionCardComponent for displaying action
cards in order confirmation item list. Component receives DisplayOrderItem
as input for rendering action-specific information.
Add refine validation to NotificationChannelSchema to ensure only valid
flag combinations are accepted. Computes valid flags using bitwise OR
of all enum values.
- 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
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
feature(customer-card): Deactivation of Create Customer with Card Feature
Display Error Feedback Dialog if Upgrade Customer (who has negative customer.id) is searched for
Refs: #5375
- 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.
1. Reward Shopping Cart Implementation
- New shopping cart with quantity control and availability checking
- Responsive shopping cart item component with improved CSS styling
- Shipping address integration in cart
- Customer reward card and billing/shipping address components
2. Navigation State Management Library (@isa/core/navigation)
- New library with type-safe navigation context service (373 lines)
- Navigation state service (287 lines) for temporary state between routes
- Comprehensive test coverage (668 + 227 lines of tests)
- Documentation (792 lines in README.md)
- Replaces query parameters for passing temporary navigation context
3. CRM Shipping Address Services
- New ShippingAddressService with fetching and validation
- CustomerShippingAddressResource and CustomerShippingAddressesResource
- Zod schemas for data validation
4. Additional Improvements
- Enhanced searchbox accessibility with ARIA support
- Availability data access rework for better fetching/mapping
- Storybook tooltip variant support
- Vitest JUnit and Cobertura reporting configuration
Related work items: #5382, #5383, #5384
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(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(shared-filter): add canApply input to filter input menu components
Add canApply input parameter to FilterInputMenuButtonComponent and FilterInputMenuComponent to control when filter actions can be applied. Update RemissionListDepartmentElementsComponent to use canApply flag and implement rollback functionality when filter menu is closed without applying changes.
- Add canApply input to FilterInputMenuButtonComponent with default false
- Pass canApply parameter through to FilterInputMenuComponent
- Update remission department filter to use canApply=true
- Implement rollbackFilterInput method for filter state management
- Change selectedDepartments to selectedDepartment for single selection
- Update capacity resource to work with single department selection
Ref: #5320
feat(utils): add scroll-top button component
Add a reusable ScrollTopButtonComponent that provides smooth scrolling
to the top of a page or specific element. The component automatically
shows/hides based on scroll position and respects user's reduced motion
preferences.
Key features:
- Supports both window and element-specific scrolling
- Configurable position with sensible defaults
- Accessibility compliant with proper aria-label
- Respects prefers-reduced-motion media query
- Debounced scroll event handling for performance
Integrate the component into remission list and search dialog
components to improve user navigation experience.
Ref: #5360
Removed unnecessary logging effects and improved tab navigation
service by implementing a URL blacklist to prevent cluttering
the navigation history with specific routes. Added constants
for better management of excluded URLs.
Remove the redundant SelectedCustomerFacade which was just a thin wrapper
around CrmTabMetadataService. Update all consumers to use CrmTabMetadataService
directly for better consistency and reduced indirection.
Changes:
- Remove SelectedCustomerFacade and its exports
- Update reward catalog components to use SelectedCustomerBonusCardsResource
- Replace local resource factories with global resources
- Update purchase options modal and customer details components
- Simplify reward action component logic and improve button state handling
Ref: #5202, #5263, #5358
feat(checkout-reward): implement reward catalog customer integration and purchase flow
- Add customer card resource and display in reward header with reset functionality
- Implement shopping cart creation and management for reward purchases
- Add purchase options modal integration with redemption points support
- Extract route helper for customer navigation with proper query params
- Update checkout metadata service constants with proper namespacing
- Add reward context initialization for tab metadata
- Improve component styling and layout for reward action buttons
- Fix customer facade method signature to require AbortSignal parameter
The reward catalog now supports full customer workflow from selection
through purchase options with proper state management and navigation.
Ref: #5263, #5358
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: 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
Introduce a comprehensive guide for creating and maintaining ADRs
within the ISA-Frontend project. This includes an overview, structure,
naming conventions, and process guidelines to ensure consistent
documentation of architectural decisions.
refactor(checkout): migrate purchase options to shopping cart-based architecture
Replace processId with shoppingCartId in purchase options modal and related components
Add new checkout data-access library with facades, services, and schemas
Update PurchaseOptionsService to use new checkout facade pattern
Migrate state management from process-based to shopping cart-based approach
Update selectors and store to handle shoppingCartId instead of processId
Improve type safety with Zod schemas for checkout operations
Add proper error handling and logging throughout checkout services
Update article details and checkout review components to use new patterns
BREAKING CHANGE: Purchase options modal now requires shoppingCartId instead of processId
Related work items: #5350
fix(tabs): correct singleton tabs interaction with new tab areas
- Fix tab name persistence when switching from Sortiment/Wareneingang to Retoure/Remission
- Prevent duplicate tab creation when clicking on new areas
- Ensure correct tab naming for Retoure and Remission areas
- Update side menu navigation to use consistent tab ID generation
- Add processResolverFn for backwards compatibility
- Simplify process bar navigation logic
Refs: #5345
Related work items: #5345
feat(reward-customer-card): improve styling and user experience
Replace basic HTML elements with proper UI components and apply
consistent design system styling. Update layout spacing and add
proper typography classes for better visual hierarchy.
Changes:
- Replace button with TextButtonComponent for consistent styling
- Add proper typography classes (isa-text-body-1-regular/bold)
- Improve layout spacing and alignment
- Add text color for better contrast
- Add null safety operators for card properties
Ref: #5262
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
fix(remission-list): ensure list reload after search dialog closes
Move reloadListAndReturnData() call outside the conditional block
to guarantee data refresh regardless of dialog result. Previously,
the list would only reload when items were selected, causing stale
data when the dialog was cancelled or closed without selection.
Ref: #5342
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
feat(isa-app): migrate remission navigation to tab-based routing system
Replace hardcoded /filiale/remission routes with dynamic tab-based paths
using TabService. This enables proper process isolation and multi-tab
support for remission workflows.
Changes include:
- Update notification component to use dynamic remission paths
- Migrate goods-in remission preview to tab-based navigation
- Refactor side menu to use new remission routing structure
- Remove legacy remission route from app routing module
- Add linkedSignal for reactive path generation
BREAKING CHANGE: Direct navigation to /filiale/remission is no longer supported.
Users must access remission through the new tab-based system.
Ref: #5323, #5324, #5325
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
- 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
fix(remission-error): simplify error handling in remission components
Refactor error handling to use consistent error message extraction pattern.
Remove dependency on ResponseArgsError type and streamline error processing
in both RemissionListComponent and RemissionReturnReceiptDetailsItemComponent.
Extract error handling logic into separate methods for better maintainability.
Ref: #5331
- 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
fix(remission-list): auto-select single search result when remission started
Enhance search result handling to automatically select items when only
one result is found during an active remission. This improves user
workflow by eliminating the extra click required to select obvious
single results.
- Add preselectRemissionItem method to handle automatic selection
- Update emptySearchResultEffect to handle single hit scenario
- Clear selected items at start of effect to prevent stale selections
- Only auto-select if item has available stock and can be remitted
- Improve effect documentation with detailed behavior explanation
Ref: #5338
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
feat(remission-list, search-item-to-remit-dialog): simplify dialog flow by removing conditional views
Refactor the search item to remit dialog to use a dedicated quantity and reason
dialog instead of conditional views within the main dialog. This change improves
user experience by providing clearer navigation and better separation of concerns.
Key changes:
- Remove item signal and conditional template logic from SearchItemToRemitDialogComponent
- Create new SelectRemiQuantityAndReasonDialogComponent for quantity/reason selection
- Update SearchItemToRemitComponent to open quantity dialog instead of setting item state
- Simplify dialog data interface by removing isDepartment property
- Improve stock filtering logic to show only items with available stock
- Fix import path for QuantityAndReason interface
This refactor eliminates complex state management within the dialog and provides
a more intuitive user flow with dedicated dialogs for each step.
Ref: #5326
fix(oms-data-access): adjust tolino return eligibility logic for display damage
Update tolino return eligibility to check for display damage and refine
date range conditions. Returns are now only eligible if the receipt is
between 6-24 months old, the item was received damaged, and the display
is not damaged.
Ref: #5286
feat(old-ui-tooltip): add pointer-events-auto to tooltip panel
Enable mouse interactions with tooltip content by adding pointer-events-auto
class to .ui-tooltip-panel. This allows users to interact with clickable
elements inside tooltips while maintaining proper tooltip positioning.
Ref: #5244
feat(remission-list, empty-state): add comprehensive empty state handling with new appearance types
Add dedicated empty state component for remission list with smart prioritization logic:
- Department selection required state (highest priority)
- All done state when list is processed and empty
- No search results state for filtered content
Enhance ui-empty-state component with new appearance types:
- AllDone: Trophy cup icon with animated steam effects
- SelectAction: Hand pointer with dropdown interface element
- Improved visual hierarchy and spacing for all states
Update remission list to use new empty state component with proper state detection
including search term validation, department filter checking, and reload detection.
Ref: #5317, #5290
fix(ui-input-controls-dropdown): prevent multiple dropdowns from being open simultaneously
Add DropdownService to manage global dropdown state and ensure only one
dropdown is open at any time. When a new dropdown opens, any previously
opened dropdown is automatically closed, improving user experience and
preventing UI conflicts.
Ref: #5298
fix(remission): filter search results by stock availability and display stock info
- Add stock resource integration to search item component
- Filter search results to only show items with available stock (> 0)
- Display current stock information in search result items
- Implement calculateAvailableStock utility for accurate stock calculation
- Add inStock input parameter to SearchItemToRemitComponent
- Create reusable instock.resource for stock data fetching
The search now only displays items that are actually available for remission,
improving user experience by preventing selection of out-of-stock items.
Ref: #5318
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
feature(remission-list): temporarily disable remission-processed-hint component
Comment out remi-remission-processed-hint component in remission list template
and add TODO comments referencing the need to adjust code once ticket #5215
is implemented. This temporary fix prevents issues with the hint component
until the underlying changes are completed.
Ref: #5136
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
feat(remission): ensure package assignment before completing return receipts
Add validation to check if a package is assigned to a return receipt before
allowing completion. When no package is assigned, automatically open the
package assignment dialog to let users scan/input a package number.
- Add hasAssignedPackage input to complete component and pass from parent
- Integrate RemissionStartService.assignPackage() in completion flow
- Add assignPackageOnly flag to conditionally hide step counter in dialog
- Update dialog data structure to support direct package assignment mode
- Enhance test coverage for new assignment scenarios
This ensures all completed return receipts have proper package tracking
and improves the user workflow by guiding them through required steps.
Ref: #5289
fix(remission-quantity-and-reason-item): correct quantity input binding and default value
Fix quantity input field binding to use computed quantity signal instead of
direct quantityAndReason().quantity, ensuring proper display of undefined
values as empty field. Update initial quantity default from 1 to 0 to
prevent pre-filled values when creating new quantity/reason items.
Also improves placeholder text color contrast by changing from neutral-200
to neutral-500 for better accessibility.
Ref: #5292
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-quantity-reason): correct dropdown placeholder and remove hardcoded option
Change dropdown placeholder from "Rückgabegrund" to "Remigrund" for consistency
with application terminology. Remove hardcoded test option from reason dropdown
that was polluting the dropdown list. Extract initial item object to class
property for better maintainability and reusability.
Ref: #5293, #5299
fix(remission-filter-label): improve filter button label display and default text
Add default placeholder text "Abteilung auswählen" when no departments
are selected and implement dynamic label width to prevent text truncation.
The label now expands to full width when displaying placeholder text
and constrains to 8rem when showing selected values.
Ref: #5303
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(libs-ui-dialog-feedback-dialog): add auto-close functionality with configurable delay
Implement automatic dialog closure after a configurable delay period.
The dialog now auto-closes by default after 1500ms, with options to
disable auto-close or customize the delay duration through the
FeedbackDialogData interface.
- Add autoClose and autoCloseDelay properties to FeedbackDialogData
- Implement auto-close logic using RxJS asapScheduler in constructor
- Add comprehensive test coverage for auto-close behavior
- Update JSDoc documentation for better clarity
Ref: #5297
fix(remission-shared-search-item-to-remit-dialog): display context-aware feedback message
Update feedback dialog message to reflect the current remission state.
Shows "Wurde zum Warenbegleitschein hinzugefügt" when remission is already
started, otherwise shows "Wurde zur Remi Liste hinzugefügt".
This provides users with more accurate feedback about where their items
were added based on the current workflow state.
Ref: #5300
feat(isa-app-shell): improve navigation link targeting for remission sub-routes
Replace generic routerLinkActive with specific regex patterns for remission
navigation items to ensure accurate active state highlighting. This change:
- Uses sharedRegexRouterLinkActive for "Remission" sub-item to match specific routes
- Uses sharedRegexRouterLinkActive for "Warenbegleitscheine" sub-item
- Replaces broad routerLinkActive with precise regex patterns
- Ensures navigation accurately reflects current route state for remission workflows
The regex patterns specifically target `/[tabId]/remission/(mandatory|department)`
and `/[tabId]/remission/return-receipt` routes for better user experience.
Ref: #5304
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(libs-shared-product-format): remove truncate class from format detail text
Remove the 'truncate' class from the span element containing formatDetail()
to allow full text display without text clipping. This improves readability
when product format details contain longer descriptions.
Ref: #5301
feat(remission-list-resource): remove client-side date sorting in favor of backend sorting
Remove commented-out date sorting logic from sortResponseResult function.
The sorting by creation date for Pflichtremission and by SORT number
for Abteilungsremission is now handled entirely by the backend,
eliminating the need for client-side date sorting operations.
This change improves performance by reducing client-side processing
and ensures consistent sorting behavior across the application.
Ref: #5295
feat(remission-list): add navigation to default list and clear input on reload
Add Router injection and injectTabId for navigation functionality.
Implement navigateToDefaultRemissionList method to redirect users
to the default remission list using the current activated tab ID.
Clear query input on reload trigger to prevent stale search results
from persisting across navigation.
Enhance emptySearchResultEffect to handle department list navigation
when no items are found and remission hasn't started yet.
Ref: #5273
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
feat(libs-ui-label, remission-shared-product, storybook): add UI label component for remission tags
- Create new @isa/ui/label library with primary/secondary appearances
- Integrate label component into ProductInfoComponent to display remission tags (Prio 1, Prio 2, Pflicht)
- Add conditional rendering based on RemissionItemTags enum with proper appearance mapping
- Include comprehensive unit tests using Vitest and Angular Testing Utilities
- Add Storybook stories for both label component and updated product info component
- Import label styles in main tailwind.scss
Ref: #5268
fix(remission-list-resource): only apply default sorting when no orderBy specified
Replace default sort mechanism to respect explicit orderBy from QueryToken.
Previously, the resource always applied manual sorting regardless of whether
explicit ordering was requested, causing conflicts with user-defined sorting.
Now checks if queryToken.orderBy exists and has items before applying the
default sort behavior (manually-added items first, then by created date).
Refs: #5276
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
hotfix(isa-app-ui/shared-searchbox): improve component initialization and method safety
Enhance searchbox component reliability by addressing initialization
issues and improving method safety across both shared and ui implementations.
Key changes:
- Fix potential null reference errors in cancel search functionality
- Improve method parameter typing with explicit defaults
- Add proper initialization for ControlValueAccessor callbacks
- Enhance component property initialization with explicit types
- Add hintCleared output event for better hint management
These changes resolve runtime errors and improve type safety
for the searchbox components used throughout the application.
Refs: #5245
feat(remission-list, ui-tooltip): add info tooltip with performance optimization
Add tooltip to department capacity info button with enhanced trigger management.
Optimize department list fetching to only load when search input or department
filter is active, improving initial load performance.
- Add tooltip directive to info button showing capacity details
- Implement conditional department list fetching based on input/filter presence
- Enhance tooltip directive with improved trigger management and positioning
- Update tooltip component to use modern Angular control flow syntax
- Add proper show/hide logic with trigger-specific behavior
Refs: #5255
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-shared-dialog): add dynamic dropdown label for return reason selection
Implement computed property to show selected reason value or default placeholder
text in the dropdown label. This provides better UX by displaying the current
selection instead of a static label.
- Add dropdownLabel computed property that returns selected reason or fallback
- Update template to use dynamic label binding instead of hardcoded text
- Enhances user feedback when reason is selected vs. when no selection is made
Ref: #5253
feat(remission-list-item, ui-dialog): enhance quantity dialog with original value display
Add support for displaying original remission quantity in the quantity change dialog.
This provides better context for users when modifying remission quantities by showing
both the current input and the original calculated value.
Changes:
- Add subMessage and subMessageValue inputs to NumberInputComponent and dialog interfaces
- Update RemissionListItemActionsComponent to pass original quantity context to dialog
- Modify RemissionListItemComponent to track quantity differences and pass stockToRemit value
- Add selectedQuantityDiffersFromStockToRemit computed property for UI state management
- Update component templates to display contextual information in quantity dialogs
Ref: #5204
hotfix(isa-app-store, core-storage): prevent caching of erroneous user state
Remove shareReplay(1) operator from user state observable to ensure
fresh state retrieval on each request. This prevents the system from
retaining and reusing failed or invalid state data across multiple
operations.
The current implementation now makes two API calls (GET + POST) per
set operation to guarantee the latest state is always used, trading
performance for reliability in error scenarios.
Refs: #5270, #5249
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
fix(remission-list, product-info, search-item-to-remit): improve responsive layout and fix orientation logic
- Fix grid layout responsiveness in remission-list-item component by updating breakpoint conditions from mobileBreakpoint to desktopBreakpoint
- Correct product-info orientation logic to properly apply horizontal/vertical layouts based on breakpoint state
- Add consistent orientation handling to search-item-to-remit component with proper breakpoint detection
- Update CSS classes to use desktop-large breakpoint for better grid column management
- Add bottom margin to remission list container to prevent overlap with fixed action button
- Enhance test coverage for new computed properties and breakpoint-dependent behavior
Ref: #5239
feat(shared-filter-inputs-checkbox-input): add bulk toggle functionality for checkbox options
Replace individual option iteration with new toggleAllCheckboxOptions method
in FilterService. This improves performance and provides cleaner API for
selecting/deselecting all checkbox options at once. Updates component logic
to use the new bulk operation and fixes test expectations accordingly.
Ref: #5231
hotfix(return-summary): disable navigation during return processing
Replace Router navigation with Location.back() for better UX and add
disabled states to prevent user actions during pending operations.
Changes:
- Replace navigateBack() method with direct Location.back() calls
- Add returnItemsAndPrintReciptPending input to ReturnSummaryItemComponent
- Disable edit and back buttons when return operation is pending
- Update parent component to pass pending state to child components
- Fix template binding to use computed pending status signal
This prevents users from navigating away during critical return
operations and provides consistent disabled states across the UI.
Ref: #5257
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
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
Refactor quantity input to use a direct input field instead of a toggle button.
Add validation to ensure quantity does not exceed 999 and display relevant error messages.
Improve overall user experience in the remission process.
Refs: #5253
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(filter): enhance search trigger handling and event emissions
Refactor search components to emit specific search trigger types,
improving tracking of user interactions. Update relevant components
to handle 'input', 'filter', 'scan', and 'order-by' triggers,
ensuring consistent behavior across the filter system.
Refs: #5234
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
refactor(return-receipt-list-item): restructure styles and remove unused imports
Updated the SCSS to separate background styles for different states and removed the unused Receipt import from the component.
Refs: #5225
feat: implement multi-level checkbox filter with hierarchical selection
- Add support for hierarchical checkbox options with parent-child relationships
- Implement automatic child selection/deselection when parent is toggled
- Add checkbox-input-control component for individual option management
- Add isCheckboxSelected helper for determining selection states
- Extend FilterService with setInputCheckboxOptionSelected method
- Update checkbox schemas to support nested option structures
- Add comprehensive test coverage for new multi-level functionality
Ref: #5231
- 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
- Replace Spectator with Angular's official TestBed and ComponentFixture
- Implement isolated test approach with proper AAA pattern
- Fix TypeScript errors related to Return interface type mismatches
- Add comprehensive edge case testing and error handling
- Create proper mock components for child dependencies
- Ensure all 47 tests pass with improved maintainability
- 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(navigation): add collapsible submenu for remission navigation #5223
- Convert remission navigation to expandable submenu with arrow toggle
- Add 'list' route for remission with redirect from empty path
- Separate navigation items for Remission and Warenbegleitscheine
- Refactor side-menu component to use inject() pattern
- Add remissionExpanded signal to track submenu state
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
hotfix(oms-data-access): initial implementation of OMS data access layer
Introduce the foundational OMS data access module, including service scaffolding and integration points for future API communication. This establishes a clear separation of concerns for order management system data retrieval and manipulation, following project architecture guidelines.
Ref: #5210
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.
- Replace deprecated @import with modern @use in _components.scss
- Replace deprecated @import with modern @use in tailwind.scss
- Move @use statements before @tailwind directives per Sass requirements
- Eliminates all 5 Sass deprecation warnings from build
- Future-proofs codebase for Dart Sass 3.0.0
- Convert eslint.config.mjs files to eslint.config.js format across workspace
- Remove build targets from remission libraries (data-access, feature/remission-list, helpers, shared)
- Remove build target from icons library
- Delete ng-package.json and tsconfig.lib.prod.json files from buildable libraries
- Update tsconfig.lib.json configurations to remove bundler moduleResolution
- Clean up build artifacts and simplify library configurations
- Libraries now compile on-demand during application build instead of pre-compilation
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
fix(isa-app-moment-locale): correct locale initialization for date formatting
Ensures proper setup of moment.js locale in the ISA app to provide accurate date and time formatting for users. Addresses issues with incorrect or inconsistent locale application.
Ref: #5188
fix(oms-return-search): fix display and logic issues in return search results
Resolve display inconsistencies and correct logic in the return search result component to improve user experience and maintain alignment with design and business requirements.
Ref: #5009
fix(ui-dropdown): improve dropdown usability and conditional rendering
Refines the logic for displaying quantity and product category dropdowns in the return details order group item controls. Ensures dropdowns are only shown when appropriate and maintains accessibility and user experience.
Ref: #5189
fix(oms-task-list-item): address styling and layout issues in return task list item
Improves SCSS for the return task list item component to ensure consistent appearance and resolve layout inconsistencies. Enhances maintainability and visual alignment with design standards.
Ref: #5191
fix(oms-return-search): resolve issues in return search result item rendering
Corrects rendering logic and improves template structure for the return search result item component. Ensures compliance with Angular control flow best practices and enhances maintainability.
Ref: #5190
feat(oms-data-access, oms-return-review, oms-return-summary): fix return receipt mapping and ensure process completion
Corrects the mapping of return receipts in the return process flow to ensure that the correct receipt IDs are used when printing and finalizing returns. Updates the `finishProcess` method to associate return receipts with the correct entities and ensures the store is updated after process completion. This resolves issues where printed receipts or review steps could reference incorrect or missing data.
Ref: #5120
- Upgraded @nx packages to version 21.2.0
- Updated Storybook packages to version 9.0.5 and core-server to 8.6.11
- Upgraded eslint-config-prettier to version 10.1.5
- Updated jest-preset-angular to version 14.6.0
- Upgraded nx to version 21.2.0
- Updated storybook test-runner to version 0.22.0
feat(oms-return-review): implement return review feature
Introduce the initial implementation of the return review feature in the OMS module. This includes core logic, UI components, and integration with existing state management. The feature enables users to review return processes, view item details, and confirm actions as part of the return workflow.
Ref: #5120
feat(scanner): add full-screen scanner styles and components
Implemented full-screen scanner styles in styles.scss.
Added ScannerButtonComponent to trigger barcode scanning.
Created ScannerComponent for rendering camera view and processing scans.
Updated ScannerService to handle scanning operations and configuration.
Enhanced README.md with detailed library features and usage examples.
Refactored return process components to utilize new scanner button.
Updated search bar input to integrate scanner functionality.
Added tests for new components and services, ensuring proper functionality.
Improved UI button styles for better integration with scanner features.
Ref:
#5123
DS // Scanner Overlay
QA
#5056
Retoure // Scan-Button lösen Suche aus
QA
#5147
Related work items: #5147
feat(libs-ui-item-rows): improve data value wrapping and label sizing
- Add `break-all` to `.ui-item-row-data-value` for better handling of long or unbroken content, ensuring values do not overflow their containers
- Use Tailwind's `min-w-[6.5rem]` utility for `.ui-item-row-data-label` and `.ui-item-row-data-label` in both `item-row-data` and `client-row` components, standardizing minimum label width and improving layout consistency
Ref: #5074
feat(libs-shared-filter): improve date range equality for default filter input detection
Enhance the isDefaultFilterInput method to compare DateRangeFilterInput values by parsing ISO date strings to Date objects before comparison. This ensures that date ranges are considered equal even if their string representations differ in precision (e.g., "2023-06-05T22:00:00Z" vs. "2023-06-05T22:00:00.000Z"). This change improves filter reset and default state detection reliability for date range filters.
Ref: #5142
feat(shared-filter,search-bar,search-main): add E2E data attributes for filter and search UI
Add standardized `data-which` and `data-what` attributes to filter input buttons, search bar input, search bar button, and clear search icon components. This improves end-to-end testability and aligns with project conventions for robust, maintainable UI automation. Updates affect filter menu, input menu button, search bar input, and search bar clear components, as well as the return search main feature.
Ref: #5060
feat(tooltip): add tooltip component and directive with customizable triggers
Introduce a new tooltip library for Angular applications, featuring a
flexible tooltip component that supports various trigger events
(click, hover, focus) and customizable content. Includes necessary
styles, tests, and documentation for usage and configuration.
Ref: #4992
fix(shared-filter): add mapFilterInputToRecord util and refactor query mapping
Introduce mapFilterInputToRecord utility for consistent mapping of filter inputs to query parameter records. Refactor FilterService.query to use this utility for both filter and input groups, ensuring DRY code and improved maintainability.
Add unit tests for the new mapping function and update the mappings index export.
Ref: #5105, #5106, #5143
feat(ui-input-controls, oms-return-process): introduce text field container, clear, and errors components
- Add `ui-text-field-container`, `ui-text-field-clear`, and `ui-text-field-errors` as standalone components for improved text field composition and error handling.
- Update SCSS to include new styles for container, clear, and errors components, ensuring visual consistency and error highlighting.
- Refactor `ReturnProcessProductQuestionComponent` to use the new containerized text field structure, improving template clarity and error display.
- Update Storybook story for `TextField` to demonstrate new composition and error handling.
- Export new components from the input-controls public API for external usage.
Ref: #4989, #5058
feat(shared-product-info): add shared product info module and initial implementation
Introduce a new shared module for product information, providing reusable components and services for displaying product details across the application. This module is designed for consistency and maintainability, following project guidelines for modularization and type safety.
Ref: #5065
feat(oms-data-access, oms-shared-task-list): add Tolino return receipt print support and improve task action typing
- Add `PrintTolinoReturnReceiptService` to `oms-data-access` for printing Tolino return receipts via office printers, including direct integration with the OMS print API.
- Extend `TaskActionType` to include `receiptItemId` for more precise task identification and action handling.
- Update `return-task-list-item` and `return-task-list` components in `oms-shared-task-list` to support the new Tolino print action, including UI and logic for triggering the print dialog.
- Refactor print-related service and test code to use the new print API signature and improve type safety.
- Add and update unit tests to cover new print flows and ensure correct integration.
Ref: #5121
feat(libs-shared-filter): show selected filter count on filter button
- Display the number of selected filters as a badge on the filter menu button when filters are active.
- Add `.has-selected-filter` styling for visual emphasis when filters are selected.
- Update FilterService to provide a computed `selectedFilterCount` property, counting non-default filter inputs.
- Remove direct icon rendering from the button; icon is now handled by the button component.
- Update tests to mock and assert the new selected filter count logic.
Ref: #5070
feat(oms-return-search): add unit tests for ReturnSearchResultItemComponent and fix address fallback
- Add comprehensive Spectator-based unit tests for ReturnSearchResultItemComponent, covering all computed properties and edge cases.
- Fix address computed property to correctly fall back to shipping address when billing address is missing, ensuring robust display logic.
Ref: #5113
feat(oms-return-process): apply flex layout to select question description
Update the return-process-select-question component to use the 'flex-1' Tailwind utility class on the description container. This ensures proper flexbox alignment and consistent layout within the parent flex context.
Ref: #5057
Fix failing test in FilterMenuButtonComponent that checks if rollback is called
when the menu is closed with rollbackOnClose=true. The test was failing because
the component uses setTimeout to schedule the rollback call, but the test was
asserting immediately without waiting for the timeout to complete.
Changes made:
- Modified the test to use jest.useFakeTimers() to control JavaScript timers
- Added jest.runAllTimers() to ensure the setTimeout callback executes
- Added cleanup with jest.useRealTimers() to prevent test pollution
- Made the test function async to properly handle asynchronous behavior
This change ensures that the test properly validates the component's
asynchronous behavior and makes the test suite more reliable.
refactor: improve code formatting and readability in provide-filter.ts and filter-menu components
fix: delay filter rollback on close in FilterMenuButtonComponent
fix: update filter clear button text and method calls in filter-menu.component.html
chore: update package-lock.json to remove unnecessary dev flags and add new dependencies
Ref: #5125, #5076
Commit 8949c691: feat(oms-data-access, oms-return-summary): unify return details mapping and serialization
- Refactor `returnReceiptValuesMapping` to use `serializeReturnDetails` instead of `returnDetailsMapping` for the `returnDetails` field, ensuring consistent serialization of return details across the OMS data access layer.
- Move the string mapping logic for return details into a dedicated helper (`serializeReturnDetails`), and update all usages and tests accordingly.
- Update `ReturnSummaryItemComponent` to use the new `returnDetailsMapping` helper for rendering human-readable return details in the summary UI.
- Add and update comprehensive unit tests for both helpers and the mapping logic to ensure correct handling of edge cases and maintainability.
Ref: #5124
fix(oms-return-details): use 24-hour format for receipt and order dates
Update date formatting in return-details-order-group-data.component.html to use
'HH:mm' (24-hour format) instead of 'hh:mm' (12-hour format) for both receipt
and order dates. This ensures consistency with German locale expectations and
improves clarity for users.
Ref: #5040
fix(oms-data-access, oms-return-details): remove obsolete 'Software' product category and related logic
- Removed the 'Software' entry from the ProductCategory constant and its type in `constants.ts`.
- Removed all references to ProductCategory.Software in the category-question registry and eligibility logic.
- Updated the return-details-order-group-item-controls component template to ensure the product category dropdown and checkbox are only rendered when the item is returnable, improving UI consistency and preventing controls from appearing for non-returnable items.
- Added/extended unit tests to verify correct rendering and logic for canReturnReceiptItem and selectability.
This change ensures that only supported product categories are handled in the return process and that UI controls are displayed appropriately based on item eligibility.
Ref: #5100
fix(oms-return-search): add missing name attribute to mobile sort button
Adds the `name="isaActionSort"` attribute to the mobile sort button in the return search result component template. This ensures consistent accessibility and testability across platforms, aligning with project standards for semantic markup and E2E test selectors.
Ref: #5110
test(print): add unit tests for PrintService and PrintReceiptsService
feat(print): modify PrintService methods to return promises instead of observables
refactor(oms): rename return-print-receipts.service to print-receipts.service and update references
chore(ui): remove deprecated ui-list library and integrate listbox components
style(ui): add styles for listbox and listbox items
test(ui): implement unit tests for listbox directives
docs(ui): update README and remove unused files related to ui-list
Refactor the order group item controls into a separate component for improved maintainability and reusability. The new ReturnDetailsOrderGroupItemControlsComponent encapsulates dropdown and checkbox functionality that was previously embedded within the parent component.
This change improves code organization by applying the Single Responsibility Principle, making each component more focused and easier to test. Updated tests ensure proper functionality is maintained after extraction.
Ref: #5116
Add conditional question flow logic for Tolino device returns based on previous answers.
The implementation creates a dedicated helper for Tolino questions that dynamically
determines the next question based on device power status and defect status.
This allows for a more tailored return process experience where:
- If device powers on and has no defects, show return reason
- If device doesn't power on and has no defects, ask about damage
- Otherwise check if case is damaged
Ref: #4944
- Deleted uncompleted tasks dialog component files (HTML, SCSS, TS).
- Updated UncompletedTasksGuard to use new ConfirmationDialogComponent.
- Added ConfirmationDialogComponent for user confirmation with customizable messages.
- Updated dialog component templates to include data attributes for easier testing.
- Removed obsolete unit tests for ReturnReviewComponent and ReturnTaskListComponent.
- Updated unit tests for ReturnSummaryComponent to reflect changes in return process handling.
- Updated @nx/js from 20.4.6 to 20.8.1
- Updated angular-eslint from 19.1.0 to 19.2.0
- Added path mapping for @isa/common/print in tsconfig.base.json
- Added path mapping for @isa/ui/dialog in tsconfig.base.json
- Added path mapping for @isa/ui/list in tsconfig.base.json
This commit makes several important changes to the return process functionality:
- Updates ItemConditionAnswer values from English codes to German user-facing text
(e.g., 'ovp' → 'Originalverpackt', 'damaged' → 'Geöffnet/Defekt')
- Updates ReturnReasonAnswer values to use German labels
(e.g., 'dislike' → 'Gefällt nicht/Widerruf', 'wrong_item' → 'Fehllieferung')
- Updates YesNoAnswer values to use German text ('yes'/'no' → 'Ja'/'Nein')
- Updates PackageIncompleteAnswer values to use descriptive German text
- Corrects an expected depth value in unit test to match the current behavior
- Adds comments in test files that need to be re-enabled after the printReceiptsService
is updated to not use the old ISA app through the legacy ModalService
These changes improve readability and make the return processing system
more consistent with the German UI labels.
Ref: #4944
This commit improves the handling of return details by:
- Changing returnDetails from string to a typed record object for better type safety
- Adding support for checklist question types in getReturnInfo
- Adding explicit mapping function (returnDetailsMapping) to format details for API
- Updating the return summary component to properly display structured return details
- Making internalActiveReturnProcessQuestions public to support nested questions
- Ensuring eligibility check functions receive proper question objects for validation
- Improving returnProcessQuestionKey naming to use more descriptive German names
Ref: #4944
This update introduces quantity selection and change handling for return items in the return details feature. The following enhancements were made:
- Added a quantity dropdown to each return item, allowing users to select the quantity to return (when more than one is available).
- Implemented the `changeQuantity` output in `ReturnDetailsOrderGroup
- Refactored `ReturnCanReturnService` to use a type guard for input discrimination and improved error handling, removing logger side effects for stricter error propagation.
- Updated `ReturnDetailsService` to delegate canReturn checks to `ReturnCanReturnService` for category-based eligibility, ensuring type safety and code reuse.
- Enhanced `ReturnDetailsOrderGroupItemComponent`:
- Added spinner feedback when canReturn is loading.
- Used endpoint result for eligibility and message display, falling back to item actions if necessary.
- Improved state management for dropdowns and selection, with robust error logging.
- Updated `ReturnDetailsOrderGroupComponent` to only allow selection of items with known categories and eligible for return.
- Improved `ReturnProcessItemComponent`:
- Added loading spinner for canReturn backend checks.
- Used endpoint result for eligibility and messaging.
- Added robust error logging and effect-based async state management.
- Updated `ReturnProcessComponent` to check canReturn for all processes asynchronously, with error handling and correct signal updates.
- Improved templates to show loading indicators and correct eligibility messages based on backend and frontend checks.
Ref: #5088
- Move canReturn logic from ReturnProcessService and ReturnProcessItemComponent into a new ReturnCanReturnService for improved separation of concerns and testability.
- Add getReturnProcessQuestions and returnReceiptValuesMapping helpers to centralize question and payload mapping logic.
- Refactor ReturnProcessService to use new helpers and remove obsolete methods.
- Update ReturnProcessItemComponent and ReturnProcessComponent to use ReturnCanReturnService for backend eligibility checks.
- Ensure summary navigation is only enabled when all items are eligible for return both frontend and backend.
- Update public API exports for new helpers and service.
Ref: #5089, #5088
Add dropdown component for selecting product categories in the return details UI.
Move product category selection from return process to return details screen,
allowing users to set categories before starting the return process.
This change:
- Moves availableCategories method from ReturnProcessService to ReturnDetailsService
- Adds new updateProductCategoryForItem method to ReturnDetailsStore
- Updates the OrderGroupItem component with dropdown for category selection
- Removes the category dropdown from ReturnProcessQuestions component
Ref: #5089
Add new components and services to support the end-to-end return process
workflow. This includes return creation, validation, item selection, and
submission features across the specified modules.
Ref: #4978
Update ReturnReceiptValuesSchema to accept category as a direct property
instead of nested in receiptItem.data.features. Simplifies the schema by
removing the unnecessary ReceiptItemDataSchema and modifying how the
category is accessed in completeReturnProcess.
Ref: #5083
Harmonize electronic device and nonbook item condition labels to consistently
use "Geöffnet/Defekt" instead of "Geöffnet/Beschädigt" or "Beschädigt/Fehldruck".
Also remove redundant defect verification question for electronic devices since
the condition label already indicates this state.
Additionally, add product features to receipt item data in return receipts to
ensure proper product information is available for returns processing.
Ref: #5083
Replace separate type extension with direct schema definition by adding
otherProduct field to the ReturnReceiptValuesSchema. This eliminates
redundant type definition and improves type safety by ensuring all
fields are properly validated through the Zod schema.
Ref: #5082
Simplify the task list filter logic by using a cleaner object literal approach
instead of nested properties. This improves readability and maintainability of
the filtering conditions.
Ref: #5072
This commit makes several important changes to ensure only eligible items
are processed during return submission:
1. ReturnProcessService now filters out ineligible items before submission
2. Fixed canContinueToSummary logic to check if ANY item is eligible (not ALL)
3. Added conditional rendering to return-summary-item to display error state
for ineligible items
These changes prevent system errors when attempting to process returns
that don't meet eligibility criteria while still allowing partial returns
when at least one item is eligible.
Ref: #5084
Enhance the ReturnProcessProductQuestion component with better error handling:
- Add proper display of "no product found" message when search returns no results
- Add validation feedback for invalid EAN inputs
- Refactor status handling from a simple boolean to a more descriptive object
- Remove unnecessary complete handler in favor of explicit state management
Ref: #4979
Add new helper function isElektronischeGeraeteEligibleForReturn to determine
if electronic devices are eligible for returns based on item condition and
receipt date. Update ReturnProcessService to use this helper for electronic
device category.
This implementation checks if devices in original packaging with receipts
older than 100 days are not eligible for return.
Ref: #4978
Replace direct Boolean() casting with Angular's coerceBooleanProperty to ensure consistent
boolean type coercion when determining if items can be returned. This improves type safety
and provides more predictable behavior for string-based boolean values in item actions.
Ref: #5067
Add support for filter parameters when querying receipt item tasks, allowing
for more refined control over which tasks are displayed. Update the service,
store, and component to use this filtering capability.
- Modify ReturnTaskListService to accept queryToken parameter
- Update ReturnTaskListStore to pass the queryToken to the service
- Enhance ReturnTaskListComponent to construct appropriate filter based on appearance
- Fix spelling of "Non-Book" in ProductCategory constant
Ref: #5072
Add helper functions to determine product return eligibility based on item condition
and defect status. Specifically implemented return logic for TonDatentraeger products
where damaged but non-defective items aren't eligible for return. Also added export
for the eligibility helper in the index file.
Update the ReturnProcessComponent to check eligibility status before allowing
continuation to summary, ensuring only eligible items proceed in the return workflow.
Ref: #5075
Add support for 'unknown' product category state in ReturnProcessService
and ReturnProcessQuestionsComponent to ensure proper handling of return
processes without a defined product category. This correctly returns
EligibleForReturnState.Unknown and displays the product category dropdown
when needed.
Ref: #5073#4943
Update ReturnProcessQuestionSchema for DeliveredItem to make contributors,
format, formatDetail, volume, and manufacturer fields optional instead of
required. This ensures compatibility with the actual data structure received
from the API and prevents validation errors for incomplete product data.
Ref: #5068
- Filter completed tasks to show only those completed today in review view
- Sort task list to show open tasks before completed tasks
- Add date-fns functions (isSameDay, parseISO) to handle date comparison
- Refactor filtering logic for better readability and maintainability
Ref: #4942
Extracted common name formatting code into a reusable utility function to ensure
consistent display of customer/organization names across return feature components.
This improves maintainability and ensures consistent presentation throughout the
application.
Ref: #5066
Make the catalogProductNumber field optional in the ReturnProcessQuestionSchema for DeliveredItem
to match actual API response data structure and prevent validation errors when processing items
without this field.
Ref: #5068
Rename and refactor return review components to task list throughout the codebase:
- Rename ReturnReviewService to ReturnTaskListService with improved error handling
- Rename ReturnReviewStore to ReturnTaskListStore and add logging
- Update TaskActionType interface with new updateTo and actions properties
- Enhance ReturnTaskListItemComponent to support dynamic task actions
- Update templates to use new action structure and naming
The refactoring improves code organization and readability while enhancing the
task list functionality with better action handling and error management.
Ref: #4942#4973
Add dialog component to warn users when they attempt to leave the return review
process with uncompleted tasks. This includes:
- Creating UncompletedTasksDialogComponent with confirmation/cancellation options
- Implementing CanDeactivate guard to check for uncompleted tasks
- Adding guard to return review routes configuration
The dialog gives users the choice to either go back and complete tasks or
leave despite having uncompleted tasks.
Ref: #4976
Enhance the ReturnTaskListComponent and ReturnTaskListItemComponent to:
- Use properly typed TaskActionTypes enum (OK, NOK, PRINT, UNKNOWN) instead of string literals
- Add specialized UI components for different action types
- Implement conditional rendering for task actions based on type
- Improve styling for different task types
- Filter out completed tasks in main view
feat(oms-data-access): add Zod schema validation for return receipts
- Add ReturnReceiptValuesSchema for validation of API payloads
- Implement proper type safety for task action types
- Use schema validation in ReturnProcessService before API calls
Ref: #4942
Implement new shared task list component to replace duplicate task list functionality across the application.
Update return review and search views to use the new shared component.
- Create new @isa/oms/shared/task-list library
- Extract task list functionality from return review component
- Add task list to return search main view
- Handle task completion actions through the shared component
- Fix typo in return review success message
Ref: #4942, #4972, #4974
Added updateTaskListItem method to ReturnReviewStore to handle updating
individual task list items. Implemented the UI logic to show/hide the
"Mark as done" button based on completion status and connected the
completeTask method to update the store with the returned result.
Ref: #4942
Add new ReturnReview library with core components and service structure:
- Create ReturnReviewService and ReturnReviewStore for task management
- Extract PrintReceipts functionality into dedicated service
- Implement review page components with task listing and completion
- Add support for receipt item tasks data model
- Update error handling with consistent error types
- Add comprehensive JSDoc documentation throughout
The implementation provides the foundation for the return review workflow,
including task listing and completion functionality.
Ref: #4942
Add receipt item task-related models and interfaces to support return review
functionality. Add new fields to ReceiptDTO and update ReturnProcessService
Includes:
- New task list models for receipt items
- Receipt service endpoint updates
- Field additions to ReceiptDTO model
Ref: #4942
Initialize the return-review feature library with basic component structure
and connect it to the existing routing system in both return-process and
return-summary features. Update navigation in ReturnSummaryComponent to
redirect to the review page after successful return completion.
Ref: #4942
- Added a pretest script to clean up test results using trash-cli.
- Updated @angular-devkit/build-angular from 19.2.6 to ^19.2.9.
- Updated @nx/angular from 20.4.6 to ^20.8.1.
Replace function declarations with arrow function expressions assigned to constants
for better testability when mocking functions during unit tests.
This makes the codebase more consistent and addresses issues with function mocking.
- 🛠️ **Refactor**: Changed npm install command in Dockerfile for better script handling
- 🗑️ **Chore**: Removed junit.xml from repository
- 🎨 **Style**: Added junit.xml to .gitignore for cleaner project structure
- 🎨 **Style**: Ensured newline at end of file in .gitignore
- ⚙️ **Config**: Modified CI command to include coverage in package.json
- ⚙️ **Config**: Updated summary file location in azure-pipelines.yml
- ⚙️ **Config**: Enhanced Jest preset to configure coverage reporters
Add data-what and data-which attributes to key UI elements:
- Add back button attributes to return details and process components
- Add filter button attributes to the filter menu component
- Add sort button attributes for both desktop and mobile views
- Add result count element attributes for better selection
- Add attributes to search result items for identification
- Add attributes to loading spinners for state verification
These attributes improve E2E test stability by providing reliable selectors
that are not tied to styling or DOM structure changes.
Ref: #5052
- ✨ **Feature**: Added support for hierarchical logger context
- 🛠️ **Refactor**: Updated logging methods to use LoggerContext
- 📚 **Docs**: Improved documentation for logger methods and context
- Deleted validation functions for electronic devices, nonbook items, and ton/datentraeger.
- Removed associated test files for these validations.
- Updated question definitions to use new constants for item conditions and return reasons.
- Refactored return process service to utilize schema validation instead of custom validators.
- Adjusted HTML templates to reflect changes in eligibility state handling.
- ✨ **Feature**: Added customizable appearance options for CheckboxComponent
- ✨ **Feature**: Implemented ChecklistComponent for managing groups of checkboxes
- 📚 **Docs**: Added comprehensive documentation for Checkbox and Checklist components
- 🧪 **Test**: Created unit tests for ChecklistValueDirective and ChecklistComponent
- ✨ **Feature**: Introduced ReturnReceiptValuesDTO for return receipt data
- ✨ **Feature**: Added ReceiptCreateReturnReceipt method in ReceiptService
- ✨ **Feature**: Updated ReceiptItemDTO with new fields for handling details
- ✨ **Feature**: Added checklist question type for return process
- ✨ **Feature**: Implemented checklist question component
- 🛠️ **Refactor**: Updated return process service to handle checklist answers
- 📚 **Docs**: Added schemas for checklist answers and return details
- 🧪 **Test**: Updated tests for new checklist functionality
- 🛠️ **Refactor**: Updated component selectors from 'lib-' to 'oms-feature-' for consistency
- 🎨 **Style**: Enhanced formatting and readability in HTML and TypeScript files
- 📚 **Docs**: Added detailed comments for return process questions and validation logic
- 📚 **Docs**: Improved documentation for return process service methods
- 📚 **Docs**: Updated schemas with descriptions for clarity
- Added questions and validation logic for the Tolino return process.
- Introduced Ton-/Datenträger return process questions and validation.
- Created a registry to map product categories to their respective questions and validators.
- Developed unit tests for the new return process questions and validators.
- Removed deprecated return process questions and validators to streamline the codebase.
- ✨ **Feature**: Added mapping for min and max values in date range input
- 🛠️ **Refactor**: Updated handling of optional min/max properties in mapping function
- 🧪 **Test**: Added unit test for min and max value mapping
- Added comprehensive JSDoc comments to mapping functions for checkbox and text filter inputs, improving code readability and maintainability.
- Refactored checkboxFilterInputMapping and checkboxOptionMapping functions to enhance clarity and structure.
- Removed unused data-range-filter-input mapping files and tests to streamline the codebase.
- Introduced a new dateRangeFilterInputMapping function with detailed mapping logic for date range inputs.
- Updated filter input schemas to include descriptive comments for better understanding of properties.
- Implemented unit tests for date range filter input mapping to ensure correct functionality.
- Enhanced existing filter mapping functions with improved error handling and validation.
- Updated index exports to reflect the removal and addition of mapping files.
- 🛠️ **Refactor**: Updated return search result component for mobile responsiveness
- 🗑️ **Chore**: Removed unused order-by dropdown component and related files
- 📚 **Docs**: Enhanced component documentation for clarity
- Added Core Logging library providing centralized logging functionality.
- Implemented LoggingService with multiple log levels and configurable sinks.
- Created ConsoleLogSink for logging to the browser console.
- Introduced LoggerApi for context-aware logging.
- Added support for custom sinks and logging configuration during app initialization.
- Enhanced FilterService and FilterMenuButtonComponent with logging capabilities.
- Updated ESLint and Jest configurations for the new logging library.
- Documented the logging library API and usage in README.
fix(customer): Updated Validations for B2B Customer
Conditional Validator - If Organisation Name is set First and Lastname is not required, If no first and last name organisation name is required
Ref: #4996
- Added filter input mapping functionality to handle different input types (Text, Checkbox, DateRange).
- Created schemas for various filter inputs including BaseFilterInput, CheckboxFilterInput, DateRangeFilterInput, and TextFilterInput.
- Developed filter mapping logic to aggregate filter groups, inputs, and order by options.
- Implemented unit tests for filter mapping, input mapping, and order by option mapping to ensure correctness.
- Introduced a dropdown component for selecting order by options with appropriate styling and functionality.
Hotfix 5022 - AHF Buchungh von Bezalten und nicht Bezahlten artikeln auf unterschiedliche Abholfächer 5022-Bezahlte-undunbezahlte-Ware-auf-der-seben-AHF-nummer
bugfix: Show error when control has error
Rename validator requiredIfControlIsSet to requireGenderWhenNameIsSet
Update logic for requireGenderWhenNameIsSet
Added JSDoc for Documentation
UiFormControlComponent Subscribing to ngControl.statusChanges and ngControl.valueChanges independendly and call cdr.markForCheck when emitted
Related work items: #4996
- ✨ **Feature**: Added InViewport directive for element visibility detection
- ✨ **Feature**: Introduced new button for navigation in return details
- 🛠️ **Refactor**: Improved scroll position restoration logic and removed deprecated files
- 📚 **Docs**: Updated README with usage instructions for new directives
Ref: #5034
- ✨ **Feature**: Added method to remove entities by process ID
- ✨ **Feature**: Implemented onInit hook to clear entities based on process IDs
- 🛠️ **Refactor**: Updated imports for clarity and organization
- 🛠️ **Refactor**: Improved entity management logic in return search store
- ✨ **Feature**: Added 'clear' parameter to search method in store
- 🛠️ **Refactor**: Updated search calls in ReturnSearchMain and Result components
- 🎨 **Style**: Improved conditional rendering for apply button in filter actions
feat: enhance return search component to handle search callbacks and update query parameters
fix: update return search result component template to use new search method and improve loading states
refactor: streamline return search result component logic and improve state management
feat: implement scroll position restoration in return search feature
feat: introduce filter service enhancements for query settings and synchronization with URL parameters
chore: create utils for scroll position management and viewport detection
fix: update filter service to use new input and query settings types
chore: add tests and configurations for new utils library
ref: #5033
- ✨ **Feature**: Added breakpoint utility for responsive design
- ✨ **Feature**: Implemented BreakpointDirective for conditional rendering
- 🛠️ **Refactor**: Updated styles for filter and order-by components
- 📚 **Docs**: Created README and documentation for ui-layout library
- ⚙️ **Config**: Added TypeScript and ESLint configurations for the new library
- 🛠️ **Refactor**: Changed filter service method calls to use new query methods
- 🎨 **Style**: Updated button components for consistency
- 🧪 **Test**: Adjusted tests to reflect changes in query parameters
- ⚙️ **Config**: Modified pre-commit hook to run CI checks
- ✨ **Feature**: Implemented return search main and result components
- 📚 **Docs**: Created README for return search library
- ⚙️ **Config**: Added TypeScript and Jest configuration for return search
- 🛠️ **Refactor**: Updated filter menu components with scroll strategy
- ✨ **Feature**: Introduced Gender, AddressType, and ShippingType enums
- 🗑️ **Chore**: Removed obsolete schemas and service files from return feature
- 🛠️ **Refactor**: Updated index files to export new models
- ✨ **Feature**: Added InputControlDirective for better input handling
- 🎨 **Style**: Updated button and text-field styles for loading states
- 🛠️ **Refactor**: Improved button component structure and disabled state handling
- 📚 **Docs**: Updated code style guidelines with new control flow syntax
- 🗑️ **Chore**: Updated Angular dependencies to version 19.2.x
- 🗑️ **Chore**: Updated Nx dependencies to version 20.7.0
- 🗑️ **Chore**: Updated devDependencies including Jest and ESLint
- ⚙️ **Config**: Added Jest configuration files for testing
- 🗑️ **Chore**: Removed unused Karma configuration and assets
- 🛠️ **Refactor**: Updated return details store methods for better clarity
- 📚 **Docs**: Enhanced comments and documentation in return details store
Improved the searchbox components to utilize environment service for mobile detection.
- ✨ **Feature**: Integrated EnvironmentService for mobile device detection
- 🛠️ **Refactor**: Cleaned up provider definitions for better readability
- 🎨 **Style**: Reformatted code for consistency in style
#5001
Refactored routing structure and improved side menu functionality.
- 🛠️ **Refactor**: Simplified route definitions for process handling
- 🎨 **Style**: Cleaned up side menu HTML for better readability
- 🛠️ **Refactor**: Enhanced side menu item click handling
#5021
Introduced a new model for return process answers and corresponding validation tests.
- ✨ **Feature**: Created ReturnProcessAnswers type for handling answers
- ✨ **Feature**: Added validation functions for various return scenarios
- 🧪 **Test**: Implemented comprehensive tests for return process validations
Clarified guidelines for highlighting positive aspects of code reviews.
- 📚 **Docs**: Specify using different funny emojis for good practices
- 🛠️ **Refactor**: Removed redundant good practice example
Enhanced the code review guidelines to improve clarity and effectiveness.
- 📚 **Docs**: Expanded review process steps with detailed explanations
- 📚 **Docs**: Added a review template for structured feedback
- 📚 **Docs**: Clarified the use of emojis for categorizing feedback
Introduced a new dropdown component with associated styles and fixed a typo.
- ✨ **Feature**: Added dropdown component and its styles
- 🎨 **Style**: Updated styles for dropdown button and options
- 🐛 **Fix**: Corrected typo in dropdown options class name
Updated the chip option component and its styles for improved functionality and organization.
- ✨ **Feature**: Introduced new chip option styles and layout
- 🛠️ **Refactor**: Removed outdated styles and organized SCSS files
- 🧪 **Test**: Added unit tests for chip option component functionality
Introduced new documentation files for state management and testing guidelines to enhance developer understanding and best practices.
- 📚 **Docs**: Added state management guidelines with local and global state recommendations
- 📚 **Docs**: Created testing guidelines including unit testing requirements and best practices
- 📚 **Docs**: Updated project structure documentation for clarity
Es wird zusätzlich zu den bisherigen Docker-Tags, ein Docker-Tag vergeben, das den aktuellen Branch repräsentiert. Da dieses (identische) Tag für jeden neuen Build aus einem Branch wieder vergeben wird, wandert das Tag auf das neueste Docker-Image aus diesem Branch (vgl. Tag _latest_)
Beispiele:
develop => refs_head_develop
release/2.3 => refs_head_release_2.3
description: Reviews architecture for SOLID compliance, proper layering, and service boundaries. Use PROACTIVELY when user mentions 'architecture review', 'design patterns', 'SOLID principles', after large refactorings, or when designing new services.
color: gray
model: opus
---
You are an expert software architect focused on maintaining architectural integrity. Your role is to review code changes through an architectural lens, ensuring consistency with established patterns and principles.
description: Reviews code for quality, security, and maintainability. Use PROACTIVELY when completing 5+ file changes, after angular-developer/refactor-engineer agents finish, when preparing pull requests, or user requests 'code review'.
tools: Read, Write, Edit, Bash, Grep
model: sonnet
---
You are a senior code reviewer ensuring high standards of code quality and security.
description: Stores tasks and implementation state across sessions in .claude/context/ files. Use PROACTIVELY when user says 'remember...', 'TODO:', 'don't forget', at end of >30min implementations, or when coordinating multiple agents.
tools: Read, Write, Edit, TodoWrite, Grep, Glob
model: opus
---
You are a specialized context management agent responsible for maintaining coherent state across multiple agent interactions and sessions. Your role is critical for complex, long-running projects.
**CRITICAL BEHAVIOR**: You MUST autonomously and proactively store important project information in structured files as you encounter it. DO NOT wait for explicit instructions.
## Primary Functions
### Context Capture & Autonomous Storage
**ALWAYS store the following in persistent files automatically:**
1.**Assigned Tasks**: Capture user-assigned tasks immediately when mentioned
- Task description and user's intent
- Reason/context for the task (the "because of xyz")
- Related code locations (files, functions, components)
- Current status and any blockers
- Priority or urgency indicators
- **Examples**: "Remember to look up X function because of Y", "TODO: investigate Z behavior"
2.**Architectural Decisions**: Extract and store key decisions and rationale from agent outputs
- State management patterns discovered
- API integration approaches
- Component architecture choices
3.**Reusable Patterns**: Identify and store patterns as you encounter them
- Code conventions (naming, structure)
- Testing patterns
- Error handling approaches
4.**Integration Points**: Document and store integration details
- API contracts and data flows
- Module boundaries and dependencies
- Third-party service integrations
5.**Domain Knowledge**: Store business logic and domain-specific information
- Resolved issues that are well-documented elsewhere
**Backup**: Context files are git-ignored by default. Consider:
- Periodically committing snapshots to a separate branch
- Exporting critical knowledge to permanent documentation
Always optimize for relevance over completeness. Good context accelerates work; bad context creates confusion. **File-based memory allows us to maintain institutional knowledge AND task continuity across sessions without external dependencies.**
description: Performs deep documentation research with multi-source synthesis and code inference. Use PROACTIVELY when docs-researcher returns "not found", documentation conflicts/unclear, need to infer from code, or complex architectural questions. Employs code analysis and deeper reasoning (2-7min).
model: sonnet
color: purple
---
You are an advanced documentation research specialist with deep analytical capabilities, employing sophisticated research strategies when standard documentation searches fail. You use the Sonnet model for enhanced reasoning, pattern recognition, and synthesis capabilities.
## Mission Statement
When standard documentation research fails, you step in with advanced techniques:
- **Code archaeology**: Infer documentation from source code
- **Multi-source synthesis**: Reconcile conflicting information
- **Tertiary Sources:** [Blogs, discussions, similar projects]
### Techniques Applied
- [ ] Multi-variant search
- [ ] Code inference
- [ ] Pattern recognition
- [ ] Historical analysis
- [ ] Cross-reference validation
## 🎯 Primary Findings
### Authoritative Answer
[Main answer with high confidence]
### Supporting Evidence
```[language]
// Concrete code example from analysis
// Include source reference
```
### Confidence Analysis
- **What we know for certain:** [Verified facts]
- **What we inferred:** [Logical deductions]
- **What remains unclear:** [Gaps or ambiguities]
## 🔍 Deep Dive Analysis
### Pattern Recognition Results
- **Common Patterns Found:**
- Pattern 1: [Description with example]
- Pattern 2: [Description with example]
### Code-Based Discoveries
```typescript
// Inferred API structure from code analysis
interfaceDiscoveredAPI{
// Document what was found
}
```
### Version & Compatibility Matrix
| Version | Status | Notes |
|---------|--------|-------|
| Current (20.1.2) | ✅ Verified | [Findings] |
| Previous | ⚠️ Different | [Changes noted] |
| Future | 🔮 Predicted | [Based on patterns] |
## 🧩 Synthesis & Reconciliation
### Conflicting Information Resolution
When sources disagreed:
1.**Conflict:** [Description]
- Source A says: [...]
- Source B says: [...]
- **Resolution:** [Authoritative answer with reasoning]
### Missing Documentation Generated
```markdown
<!-- Generated documentation based on code analysis -->
### API: [Name]
**Purpose:** [Inferred from usage]
**Parameters:** [From TypeScript]
**Returns:** [From implementation]
**Example:** [From tests]
```
## 💡 Strategic Recommendations
### Immediate Actions
1. [Specific implementation approach]
2. [Risk mitigation strategies]
3. [Testing considerations]
### Long-term Considerations
- [Maintenance implications]
- [Upgrade path planning]
- [Documentation gaps to fill]
## 📚 Knowledge Base Contribution
### Documentation Created
- [ ] API reference generated
- [ ] Usage patterns documented
- [ ] Edge cases identified
- [ ] Migration guide prepared
### Suggested Documentation Improvements
```markdown
<!-- Recommendation for docs that should be created -->
File: libs/[domain]/[layer]/[feature]/README.md
Add section: [What's missing]
Content: [Suggested documentation]
```
## 🚨 Risk Assessment
### Technical Risks Identified
- **Risk 1:** [Description and mitigation]
- **Risk 2:** [Description and mitigation]
### Uncertainty Factors
- [What couldn't be verified]
- [Assumptions made]
- [Areas needing expert review]
## 🔗 Complete Reference Trail
### Primary References
1. [Source with specific line numbers]
2. [Commit hash with context]
3. [Issue/PR with discussion]
### Code Locations Analyzed
-`path/to/file.ts:L123-L456` - [What was found]
-`path/to/test.spec.ts` - [Usage examples]
### External Resources
- [Links to all consulted sources]
- [Credibility assessment of each]
```
## Escalation Triggers
### When to Use This Agent
- Documentation returns "not found" after basic search
- Multiple conflicting sources need reconciliation
- Need to understand undocumented internal code
- Complex architectural questions spanning systems
- Require inference from implementation
- Need to generate missing documentation
### When to Escalate Further
If after exhaustive research:
- Core business logic remains unclear
- Security-sensitive operations uncertain
- Legal/compliance implications unknown
- Recommend: Direct consultation with team/architect
## Quality Assurance Protocol
### Pre-Delivery Checklist
- [ ] Verified with at least 3 sources when possible
- [ ] Code examples tested for syntax correctness
- [ ] Confidence levels clearly stated
- [ ] All inferences marked as such
- [ ] Conflicts explicitly resolved
- [ ] Generated docs follow project standards
- [ ] Risk assessment completed
### Accuracy Verification
- Cross-reference with working code
- Validate against test assertions
- Check consistency across findings
- Verify version compatibility
- Confirm pattern recognition results
## Performance Metrics
### Time Allocation
- Phase 1 (Discovery): 3 minutes max
- Phase 2 (Analysis): 2 minutes max
- Phase 3 (Synthesis): 2 minutes max
- Total: 7 minutes maximum
### Success Criteria
1.**Excellent**: Found authoritative answer with code examples
2.**Good**: Synthesized working solution from multiple sources
3.**Acceptable**: Provided inferred documentation with caveats
4.**Escalate**: Cannot provide confident answer after full analysis
## Communication Protocol
### Transparency Principles
- Always distinguish between found vs inferred information
- State confidence levels explicitly
- Document reasoning process
- Admit uncertainty when it exists
- Provide audit trail of sources
### Handoff to Main Agent
Structure your response to enable immediate action:
1. Start with most confident answer
2. Provide working code example
3. List caveats and risks
4. Include verification steps
5. Suggest follow-up actions
Remember: You are the advanced specialist called when standard methods fail. Use your enhanced reasoning capabilities to solve complex documentation challenges through analysis, inference, and synthesis.
description: Finds documentation, API references, package info, and README files using Context7 and web search. Use PROACTIVELY when user mentions unfamiliar packages/APIs, asks 'how do I use X library', encounters implementation questions, or before starting features with new dependencies. Fast targeted research (30-120s).
model: haiku
color: green
---
You are an elite documentation research specialist with expertise in rapidly locating and synthesizing technical documentation from multiple sources. Your primary mission is to find accurate, current documentation to support the main agent's work with maximum speed and precision.
## Primary Tool Priority Matrix
### Tier 1: MCP Servers (Use First - Fastest & Most Authoritative)
1.**Context7** (`mcp__context7__*`)
- Use `resolve-library-id` first to get the correct library ID
- Then use `get-library-docs` with appropriate token limits (default: 5000, max: 10000 for complex topics)
- Best for: NPM packages, external libraries, frameworks
2.**Angular MCP** (`mcp__angular-mcp__*`)
- Use `search_documentation` for Angular-specific queries
- Use `get_best_practices` for Angular conventions
- Best for: Angular APIs, components, directives, services
3.**Nx MCP** (`mcp__nx-mcp__*`)
- Use `nx_docs` for Nx-specific documentation
- Use `nx_workspace` for monorepo structure understanding
- Best for: Nx commands, configuration, generators, executors
### Tier 2: Local Documentation (Use for ISA-specific)
- **Read tool**: For internal library READMEs (`libs/[domain]/[layer]/[feature]/README.md`)
- **Grep tool**: For searching code patterns and examples within the project
- **Glob tool**: For finding relevant files by pattern
### Tier 3: Web Resources (Use as Fallback)
- **WebSearch**: Official docs, GitHub repos, technical articles
- **WebFetch**: Direct documentation pages when URL is known
## Research Workflows by Query Type
### Package/Library Documentation
```
1. Identify package name from query
2. IF external package:
- Use mcp__context7__resolve-library-id
- Use mcp__context7__get-library-docs with focused topic
3. IF internal ISA library:
- Read libs/[domain]/[layer]/[feature]/README.md
- Check library-reference.md for overview
4. Extract: API surface, usage patterns, examples, version info
```
### Angular-Specific Queries
```
1. Use mcp__angular-mcp__search_documentation with concise query
2. IF best practices needed:
- Use mcp__angular-mcp__get_best_practices
3. Extract: Modern patterns (signals, standalone), migration notes
4. Verify against project's Angular 20.1.2 version
```
### Nx/Monorepo Queries
```
1. Use mcp__nx-mcp__nx_docs with user query
2. IF workspace-specific:
- Use mcp__nx-mcp__nx_workspace for structure
- Use mcp__nx-mcp__nx_project_details for specific projects
3. Extract: Commands, configuration, best practices
- NgRx Signals with signalStore() (not legacy NgRx)
- Standalone components (no NgModules)
- Zod validation schemas
- Tailwind with ISA-specific utilities
- Jest → Vitest migration in progress
## Error Handling & Fallback Strategies
### When MCP Servers Fail
1. Try alternative MCP server if available
2. Fall back to WebSearch with site-specific operators
3. Check GitHub repository directly
4. Report: "MCP unavailable, using web sources"
### When Documentation Not Found
```markdown
## ⚠️ Limited Documentation Available
**Searched:** [List all sources checked]
**Result:** Documentation not found or incomplete
**Possible Reasons:**
- Package may be internal/private
- Documentation may be outdated
- Feature might be experimental
**Recommended Actions:**
1. [Check source code directly]
2. [Look for similar implementations]
3. [Ask for clarification on specific aspect]
## 🔄 Escalation to docs-researcher-advanced
**When to escalate:**
- Documentation not found after exhaustive search
- Conflicting information from multiple sources
- Need to infer API from code
- Complex multi-system analysis required
**Recommendation:** Use `docs-researcher-advanced` agent for deeper analysis with:
- Code archaeology and inference
- Multi-source synthesis
- Pattern recognition
- Documentation generation from implementation
```
### Version Mismatch Handling
- Always note version differences
- Highlight breaking changes prominently
- Suggest migration paths when applicable
- Warn about compatibility issues
## Quality Checklist
Before returning results, verify:
- [ ] Used fastest appropriate tool (MCP > Local > Web)
- [ ] Included concrete code examples
- [ ] Verified version compatibility
- [ ] Extracted actionable information
- [ ] Cited all sources with links/paths
- [ ] Formatted for easy scanning
- [ ] Provided clear next steps
## Communication Principles
### Do's
- ✅ Prioritize speed without sacrificing accuracy
- ✅ Provide concrete, runnable examples
- ✅ Highlight critical warnings prominently
- ✅ Format code with proper syntax highlighting
- ✅ Include installation/setup commands
- ✅ Note ISA-specific patterns when relevant
### Don'ts
- ❌ Don't include irrelevant documentation sections
- ❌ Don't guess if unsure - state uncertainty clearly
- ❌ Don't exceed 2-minute research time
- ❌ Don't provide outdated information without warnings
- ❌ Don't forget to check project-specific versions
## Success Metrics
Your research is successful when:
1. Main agent can immediately proceed with implementation
2. All necessary API details are provided
3. Potential pitfalls are highlighted
4. Sources are authoritative and current
5. Response time is under 2 minutes
Remember: You are the speed-optimized research specialist using Haiku model. Prioritize fast, focused, accurate results that enable the main agent to work confidently.
description: Executes large-scale refactoring and migrations across 5+ files. Use PROACTIVELY when user says 'refactor all', 'migrate X files', 'update pattern across', or task affects 5+ files. Auto-loads architecture-enforcer, circular-dependency-resolver. Safe incremental approach with validation.
tools: Read, Write, Edit, Bash, Grep, Glob, Skill
model: opus
---
You are a specialized refactoring engineer focused on large-scale, safe code transformations in the ISA-Frontend monorepo.
## Automatic Skill Loading
**IMMEDIATELY load these skills at start:**
```
/skill architecture-enforcer
/skill circular-dependency-resolver
```
**Load additional skills as needed:**
```
/skill type-safety-engineer (if fixing any types or adding Zod)
/skill standalone-component-migrator (if migrating to standalone)
description: Generates comprehensive test suites with Vitest + Angular Testing Library. Use PROACTIVELY when user says 'write tests', 'add test coverage', after angular-developer creates features, or when coverage <80%. Handles unit, integration tests and mocking.
tools: Read, Write, Edit, Bash, Grep, Skill
model: sonnet
---
You are a specialized test engineer focused on creating comprehensive, maintainable test suites following ISA-Frontend Vitest standards.
## Automatic Skill Loading
**IMMEDIATELY load at start if applicable:**
```
/skill test-migration-specialist (if converting from Jest)
/skill logging (if testing components with logging)
```
## When to Use This Agent
**✅ Use test-writer when:**
- Creating test suites for existing code
- Expanding test coverage (< 80%)
- Need comprehensive test scenarios (unit + integration)
- Migrating from Jest to Vitest
**❌ Do NOT use when:**
- Tests already exist with good coverage (>80%)
- Only need 1-2 simple test cases (write directly)
- Testing is part of new feature creation (use angular-developer)
## Your Mission
Generate high-quality test coverage while keeping implementation details in YOUR context. Return summaries based on response_format parameter.
## Workflow
### 1. Intake & Analysis
**Parse the briefing:**
- Target file(s) to test
- Coverage type: unit / integration / e2e
- Specific scenarios to cover
- Dependencies to mock
- **response_format**: "concise" (default) or "detailed"
description: Writes advanced TypeScript with generic constraints, conditional/mapped types, and custom type guards. Use PROACTIVELY when creating type utilities, migrating JavaScript to TypeScript, resolving complex type inference issues, or implementing strict typing.
tools: Read, Write, Edit, Bash
model: sonnet
---
You are a TypeScript expert specializing in advanced type system features and type-safe application development.
## Focus Areas
- Advanced type system (conditional types, mapped types, template literal types)
- Generic constraints and type inference optimization
- Utility types and custom type helpers
- Strict TypeScript configuration and migration strategies
- Declaration files and module augmentation
- Performance optimization and compilation speed
## Approach
1. Leverage TypeScript's type system for compile-time safety
2. Use strict configuration for maximum type safety
3. Prefer type inference over explicit typing when clear
4. Design APIs with generic constraints for flexibility
5. Optimize build performance with project references
6. Create reusable type utilities for common patterns
## Output
- Strongly typed TypeScript with comprehensive type coverage
- Advanced generic types with proper constraints
- Custom utility types and type helpers
- Strict tsconfig.json configuration
- Type-safe API designs with proper error handling
- Performance-optimized build configuration
- Migration strategies from JavaScript to TypeScript
Follow TypeScript best practices and maintain type safety without sacrificing developer experience.
description: This skill should be used when writing Angular code with signals and effects. Use when deciding whether to use effect(), computed(), or reactive patterns for state management. Applies to all Angular components and services using signals, especially when considering effect() for state propagation, data synchronization, or reactive flows. Essential for code review of effect usage and refactoring imperative patterns to declarative alternatives.
---
# Angular Effects Alternatives
## Overview
This skill guides proper usage of Angular's `effect()` and provides declarative alternatives for common patterns. Effects are frequently misused for state propagation, leading to circular updates, maintenance issues, and violations of reactive principles. This skill prevents anti-patterns and promotes maintainable, declarative code.
## When to Use Effects (Valid Use Cases)
Effects are **primarily for rendering content that cannot be rendered through data binding**. Valid use cases are limited to:
### 1. Logging
Recording application events or debugging:
```typescript
effect(()=>{
consterror=this.error();
if(error){
console.error('Error occurred:',error);
}
});
```
### 2. Canvas Painting
Custom graphics rendering (e.g., Angular Three library, Chart.js integration):
```typescript
effect(()=>{
constdata=this.chartData();
this.renderCanvas(data);
});
```
### 3. Custom DOM Behavior
Imperative APIs that require direct DOM manipulation:
```typescript
effect(()=>{
constmessage=this.notificationMessage();
if(message){
this.snackBar.open(message,'Close');
}
});
```
**Key principle:** Data binding is the preferred way to display data. Effects should only be used when data binding is insufficient.
## Understanding Auto-Tracking
Angular automatically tracks signals accessed during effect execution, **even within called methods**:
```typescript
effect(()=>{
this.logError();// Signal tracking happens inside this method
});
logError():void{
consterror=this.error();// This signal is automatically tracked
if(error){
console.error(error);
}
}
```
**Implication:** Auto-tracking makes effect dependencies non-obvious and hard to maintain. This is a primary reason to avoid effects for state management.
## When NOT to Use Effects (Anti-Patterns)
### ❌ Anti-Pattern 1: State Propagation
**NEVER use effects to propagate state changes to other state:**
```typescript
// ❌ WRONG - Anti-pattern
effect(()=>{
constvalue=this.source();
this.derived.set(value*2);
});
```
**Problems:**
- Risk of circular updates and infinite loops
- Hard to maintain due to implicit tracking
- Violates declarative reactive principles
- Inappropriate glitch-free semantics
### ❌ Anti-Pattern 2: Synchronizing Signals
```typescript
// ❌ WRONG - Anti-pattern
effect(()=>{
constfilter=this.filter();
this.loadData(filter);
});
```
### ❌ Anti-Pattern 3: Event Emulation
```typescript
// ❌ WRONG - Anti-pattern
effect(()=>{
constcount=this.itemCount();
this.countChanged.emit(count);
});
```
**Why signals ≠ events:** Signals are designed to be glitch-free, collapsing multiple updates. This makes them inappropriate for representing discrete events.
## Decision Tree: Effect vs Alternative
```
Need to react to signal changes?
│
├─ Synchronous derivation?
│ └─ ✅ Use computed()
│
├─ Asynchronous derivation?
│ └─ ✅ Use Resource API
│
├─ Complex reactive flow with race conditions?
│ └─ ✅ Use RxJS (toObservable + operators + toSignal)
│
├─ Event-based trigger (not state change)?
│ └─ ✅ React to event directly, not signal
│
├─ Need RxJS operators with signals?
│ └─ ✅ Use reactive helpers (rxMethod, deriveAsync)
description: This skill should be used when writing or reviewing Angular component templates. It provides guidance on modern Angular 20+ template syntax including control flow (@if, @for, @switch, @defer), content projection (ng-content), template references (ng-template, ng-container), variable declarations (@let), and expression binding. Use when creating components, refactoring to modern syntax, implementing lazy loading, or reviewing template best practices.
---
# Angular Template
Guide for modern Angular 20+ template patterns: control flow, lazy loading, projection, and binding.
## When to Use
- Creating/reviewing component templates
- Refactoring legacy `*ngIf/*ngFor/*ngSwitch` to modern syntax
- Implementing `@defer` lazy loading
- Designing reusable components with `ng-content`
- Template performance optimization
**Related Skills:** These skills work together when writing Angular templates:
description: This skill should be used when checking for breaking changes before API regeneration, assessing backend API update impact, or user mentions "check breaking changes", "API diff", "impact assessment". Analyzes Swagger/OpenAPI spec changes, categorizes as breaking/compatible/warnings, and provides migration strategies.
---
# API Change Analyzer
## Overview
Analyze Swagger/OpenAPI specification changes to detect breaking changes before regeneration. Provides detailed comparison, impact analysis, and migration recommendations.
description: This skill should be used when checking architecture compliance, validating layer boundaries (Feature→Feature violations), detecting circular dependencies, or user mentions "check architecture", "validate boundaries", "check imports". Validates import boundaries and architectural rules in ISA-Frontend monorepo.
---
# Architecture Enforcer
## Overview
Validate and enforce architectural boundaries in the monorepo. Checks import rules, detects violations, generates dependency graphs, and suggests refactoring.
## When to Use This Skill
Invoke when user wants to:
- Validate import boundaries
- Check architectural rules
- Find dependency violations
- Mentioned "check architecture" or "validate imports"
description: This skill should be used when build fails with circular import warnings, user mentions "circular dependencies" or "dependency cycles", or fixing A→B→C→A import cycles. Detects and resolves circular dependencies using graph algorithms with DI, interface extraction, and shared code fix strategies.
---
# Circular Dependency Resolver
## Overview
Detect and resolve circular dependencies using graph analysis, multiple fix strategies, and automated validation. Prevents runtime and build issues caused by dependency cycles.
description: This skill should be used when writing or reviewing CSS animations in Angular components. Use when creating entrance/exit animations, implementing @keyframes instead of @angular/animations, applying timing functions and fill modes, creating staggered animations, or ensuring GPU-accelerated performance. Essential for modern Angular 20+ components using animate.enter/animate.leave directives and converting legacy Angular animations to native CSS.
---
# CSS @keyframes Animations
## Overview
Implement native CSS @keyframes animations for Angular applications, replacing @angular/animations with GPU-accelerated, zero-bundle-size alternatives. This skill provides comprehensive guidance on creating performant entrance/exit animations, staggered effects, and proper timing configurations.
## When to Use This Skill
Apply this skill when:
- **Writing Angular components** with entrance/exit animations
- **Converting @angular/animations** to native CSS @keyframes
- **Implementing animate.enter/animate.leave** in Angular 20+ templates
- **Creating staggered animations** for lists or collections
The `@keyframes` at-rule controls the intermediate steps in a CSS animation sequence by defining styles for keyframes (waypoints) along the animation. Unlike transitions (which only animate between two states), keyframes let you define multiple intermediate steps.
description: This skill should be used when creating branches, writing commits, or creating pull requests. Enforces ISA-Frontend Git conventions including feature/task-id-name branch format, conventional commits without co-author tags, and PRs targeting develop branch.
---
# Git Workflow Skill
Enforces Git workflow conventions specific to the ISA-Frontend project.
## When to Use
- Creating new branches for features or bugfixes
- Writing commit messages
- Creating pull requests
- Any Git operations requiring adherence to project conventions
description: This skill should be used when writing or reviewing HTML templates to ensure proper E2E testing attributes (data-what, data-which) and ARIA accessibility attributes are included. Use when creating interactive elements like buttons, inputs, links, forms, dialogs, or any HTML markup requiring testing and accessibility compliance. Works seamlessly with the angular-template skill.
---
# HTML Template - Testing & Accessibility Attributes
This skill should be used when writing or reviewing HTML templates to ensure proper testing and accessibility attributes are included.
## When to Use This Skill
Use this skill when:
- Writing or modifying Angular component templates
- Creating any HTML templates or markup
- Reviewing code for testing and accessibility compliance
- Adding interactive elements (buttons, inputs, links, etc.)
- Implementing forms, lists, navigation, or dialogs
**Works seamlessly with:**
- **[angular-template](../angular-template/SKILL.md)** - Angular template syntax, control flow, and modern patterns
- **[tailwind](../tailwind/SKILL.md)** - ISA design system styling for visual design
- **[logging](../logging/SKILL.md)** - MANDATORY logging in all Angular components using `@isa/core/logging`
## Overview
This skill provides comprehensive guidance for two critical HTML attribute categories:
### 1. E2E Testing Attributes
Enable automated end-to-end testing by providing stable selectors for QA automation:
- **`data-what`**: Semantic description of element's purpose
- **`data-which`**: Unique identifier for specific instances
- **`data-*`**: Additional contextual information
### 2. ARIA Accessibility Attributes
Ensure web applications are accessible to all users, including those using assistive technologies:
- **Roles**: Define element purpose (button, navigation, dialog, etc.)
- **Properties**: Provide additional context (aria-label, aria-describedby)
- **States**: Indicate dynamic states (aria-expanded, aria-disabled)
This reference provides comprehensive guidance for adding E2E (End-to-End) testing attributes to HTML templates for reliable automated testing.
## Table of Contents
- [Overview](#overview)
- [Core Attribute Types](#core-attribute-types)
- [Why E2E Attributes?](#why-e2e-attributes)
- [Naming Conventions](#naming-conventions)
- [Patterns by Element Type](#patterns-by-element-type)
- [Patterns by Component Type](#patterns-by-component-type)
- [Dynamic Attributes](#dynamic-attributes)
- [Best Practices](#best-practices)
- [Validation](#validation)
- [Testing Integration](#testing-integration)
## Overview
E2E testing attributes provide stable, semantic selectors for automated testing. They enable QA automation without relying on brittle CSS classes, IDs, or XPath selectors that frequently break when styling changes.
## Core Attribute Types
### 1. `data-what` (Required)
**Purpose**: Semantic description of the element's purpose or type
**Format**: kebab-case string
**Examples**:
-`data-what="submit-button"`
-`data-what="search-input"`
-`data-what="product-link"`
-`data-what="list-item"`
**Guidelines**:
- Describes WHAT the element is or does
- Should be consistent across similar elements
- Use descriptive, semantic names
- Keep it concise but clear
### 2. `data-which` (Required)
**Purpose**: Unique identifier for the specific instance of this element type
**Format**: kebab-case string or dynamic binding
**Examples**:
-`data-which="primary"` (static)
-`data-which="customer-form"` (static)
-`[attr.data-which]="item.id"` (dynamic)
-`[attr.data-which]="'customer-' + customerId"` (dynamic with context)
**Guidelines**:
- Identifies WHICH specific instance of this element type
- Must be unique within the same view/component
- Use dynamic binding for list items: `[attr.data-which]="item.id"`
- Can combine multiple identifiers: `data-which="customer-123-edit"`
### 3. `data-*` (Contextual)
**Purpose**: Additional contextual information about state, status, or data
**Format**: Custom attributes with kebab-case names
**Examples**:
-`data-status="active"`
-`data-index="0"`
-`data-role="admin"`
-`[attr.data-count]="items.length"`
**Guidelines**:
- Use for additional context that helps testing
- Avoid sensitive data (passwords, tokens, PII)
- Use Angular binding for dynamic values: `[attr.data-*]`
description: This skill should be used when creating feature/data-access/ui/util libraries or user says "create library", "new library", "scaffold library". Creates new Angular libraries in ISA-Frontend monorepo with proper Nx configuration, Vitest setup, architectural tags, and path aliases.
---
# Library Scaffolder
## Overview
Automate the creation of new Angular libraries following ISA-Frontend conventions. This skill handles the complete scaffolding workflow including Nx generation, Vitest configuration with CI/CD integration, path alias verification, and initial validation.
## When to Use This Skill
Invoke this skill when:
- User requests creating a new library
- User mentions "new library", "scaffold library", or "create feature"
- User wants to add a new domain/layer/feature to the monorepo
description: This skill should be used when working with Angular components, directives, services, pipes, guards, or TypeScript classes. Logging is MANDATORY in all Angular files. Implements @isa/core/logging with logger() factory pattern, appropriate log levels, lazy evaluation for performance, error handling, and avoids console.log and common mistakes.
---
# Logging Helper Skill
Ensures consistent and efficient logging using `@isa/core/logging` library.
description: This skill should be used when implementing Angular's Resource API with NgRx Signal Store for reactive data management. Use when creating signal stores that load data reactively, need automatic race condition prevention, or require declarative resource management without RxJS. Applies to data-access libraries, feature stores with API integration, and components needing reactive filtering or pagination.
---
# NgRx Resource API
## Overview
This skill enables integration of Angular's Resource API with NgRx Signal Store to create reactive data flows without RxJS while automatically preventing race conditions. The Resource API handles concurrent request management declaratively, eliminating manual `switchMap` or `takeUntilDestroyed` patterns.
## Core Architectural Concepts
### Reactive Flow Graph
Establish three clear interaction points in the store:
- Resources automatically reload when `params` signal changes
-`abortSignal` enables automatic cancellation of in-flight requests
- Loader must return a Promise (use `.findPromise()` if service returns Observable)
### Step 4: Expose Read-Only Resources (Optional)
If the resource should be accessible to consumers, expose it as read-only:
```typescript
withProps((store)=>({
itemsResource: store._itemsResource.asReadonly(),
}))
```
**Pattern:** Internal resources use underscore prefix, public versions are read-only without prefix.
### Step 5: Create Signal Methods for Updates
Use `signalMethod` for actions that update state and trigger resource reloads:
```typescript
withMethods((store)=>({
updateFilter: signalMethod<MyFilter>((filter)=>{
patchState(store,{filter});
}),
refresh:()=>{
store._itemsResource.reload();
}
}))
```
**Important:**`signalMethod` implementations are **untracked by convention** - they don't re-execute when signals change. This provides explicit control flow.
description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
license: Complete terms in LICENSE.txt
---
# Skill Creator
This skill provides guidance for creating effective skills.
## About Skills
Skills are modular, self-contained packages that extend Claude's capabilities by providing
specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific
domains or tasks—they transform Claude from a general-purpose agent into a specialized agent
equipped with procedural knowledge that no model can fully possess.
### What Skills Provide
1. Specialized workflows - Multi-step procedures for specific domains
2. Tool integrations - Instructions for working with specific file formats or APIs
3. Domain expertise - Company-specific knowledge, schemas, business logic
4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
### Anatomy of a Skill
Every skill consists of a required SKILL.md file and optional bundled resources:
```
skill-name/
├── SKILL.md (required)
│ ├── YAML frontmatter metadata (required)
│ │ ├── name: (required)
│ │ └── description: (required)
│ └── Markdown instructions (required)
└── Bundled Resources (optional)
├── scripts/ - Executable code (Python/Bash/etc.)
├── references/ - Documentation intended to be loaded into context as needed
└── assets/ - Files used in output (templates, icons, fonts, etc.)
```
#### SKILL.md (required)
**Metadata Quality:** The `name` and `description` in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third-person (e.g. "This skill should be used when..." instead of "Use this skill when...").
#### Bundled Resources (optional)
##### Scripts (`scripts/`)
Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
- **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed
- **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks
- **Benefits**: Token efficient, deterministic, may be executed without loading into context
- **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments
##### References (`references/`)
Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
- **When to include**: For documentation that Claude should reference while working
- **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications
- **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
- **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed
- **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
- **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
##### Assets (`assets/`)
Files not intended to be loaded into context, but rather used within the output Claude produces.
- **When to include**: When the skill needs files that will be used in the final output
- **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography
- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
- **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context
### Progressive Disclosure Design Principle
Skills use a three-level loading system to manage context efficiently:
1.**Metadata (name + description)** - Always in context (~100 words)
2.**SKILL.md body** - When skill triggers (<5k words)
3.**Bundled resources** - As needed by Claude (Unlimited*)
*Unlimited because scripts can be executed without reading into context window.
## Skill Creation Process
To create a skill, follow the "Skill Creation Process" in order, skipping steps only if there is a clear reason why they are not applicable.
### Step 1: Understanding the Skill with Concrete Examples
Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
For example, when building an image-editor skill, relevant questions include:
- "What functionality should the image-editor skill support? Editing, rotating, anything else?"
- "Can you give some examples of how this skill would be used?"
- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
- "What would a user say that should trigger this skill?"
To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
Conclude this step when there is a clear sense of the functionality the skill should support.
### Step 2: Planning the Reusable Skill Contents
To turn concrete examples into an effective skill, analyze each example by:
1. Considering how to execute on the example from scratch
2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows:
1. Rotating a PDF requires re-writing the same code each time
2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill
Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
1. Writing a frontend webapp requires the same boilerplate HTML/React each time
2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill
Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows:
1. Querying BigQuery requires re-discovering the table schemas and relationships each time
2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill
To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
### Step 3: Initializing the Skill
At this point, it is time to actually create the skill.
Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.
When creating a new skill from scratch, always run the `init_skill.py` script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.
- Creates the skill directory at the specified path
- Generates a SKILL.md template with proper frontmatter and TODO placeholders
- Creates example resource directories: `scripts/`, `references/`, and `assets/`
- Adds example files in each directory that can be customized or deleted
After initialization, customize or remove the generated SKILL.md and example files as needed.
### Step 4: Edit the Skill
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Focus on including information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
#### Start with Reusable Skill Contents
To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.
Also, delete any example files and directories not needed for the skill. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.
#### Update SKILL.md
**Writing Style:** Write the entire skill using **imperative/infinitive form** (verb-first instructions), not second person. Use objective, instructional language (e.g., "To accomplish X, do Y" rather than "You should do X" or "If you need to do X"). This maintains consistency and clarity for AI consumption.
To complete SKILL.md, answer the following questions:
1. What is the purpose of the skill, in a few sentences?
2. When should the skill be used?
3. In practice, how should Claude use the skill? All reusable skill contents developed above should be referenced so that Claude knows how to use them.
### Step 5: Packaging a Skill
Once the skill is ready, it should be packaged into a distributable zip file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:
- Skill naming conventions and directory structure
- Description completeness and quality
- File organization and resource references
2.**Package** the skill if validation passes, creating a zip file named after the skill (e.g., `my-skill.zip`) that includes all files and maintains the proper directory structure for distribution.
If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.
### Step 6: Iterate
After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
**Iteration workflow:**
1. Use the skill on real tasks
2. Notice struggles or inefficiencies
3. Identify how SKILL.md or bundled resources should be updated
description: [TODO: Complete and informative explanation of what the skill does and when to use it. Include WHEN to use this skill - specific scenarios, file types, or tasks that trigger it.]
---
# {skill_title}
## Overview
[TODO: 1-2 sentences explaining what this skill enables]
## Structuring This Skill
[TODO: Choose the structure that best fits this skill's purpose. Common patterns:
**1. Workflow-Based** (best for sequential processes)
- Works well when there are clear step-by-step procedures
- BigQuery: API reference documentation and query examples
- Finance: Schema documentation, company policies
**Appropriate for:** In-depth documentation, API references, database schemas, comprehensive guides, or any detailed information that Claude should reference while working.
### assets/
Files not intended to be loaded into context, but rather used within the output Claude produces.
**Examples from other skills:**
- Brand styling: PowerPoint template files (.pptx), logo files
**Appropriate for:** Templates, boilerplate code, document templates, images, icons, fonts, or any files meant to be copied or used in the final output.
---
**Any unneeded directories can be deleted.** Not every skill requires all three types of resources.
"""
EXAMPLE_SCRIPT='''#!/usr/bin/env python3
"""
Example helper script for {skill_name}
This is a placeholder script that can be executed directly.
Replace with actual implementation or delete if not needed.
Example real scripts from other skills:
- pdf/scripts/fill_fillable_fields.py - Fills PDF form fields
- pdf/scripts/convert_pdf_to_images.py - Converts PDF pages to images
"""
def main():
print("This is an example script for {skill_name}")
# TODO: Add actual script logic here
# This could be data processing, file conversion, API calls, etc.
if __name__ == "__main__":
main()
'''
EXAMPLE_REFERENCE="""# Reference Documentation for {skill_title}
This is a placeholder for detailed reference documentation.
Replace with actual reference content or delete if not needed.
Example real reference docs from other skills:
- product-management/references/communication.md - Comprehensive guide for status updates
- product-management/references/context_building.md - Deep-dive on gathering context
- bigquery/references/ - API references and query examples
## When Reference Docs Are Useful
Reference docs are ideal for:
- Comprehensive API documentation
- Detailed workflow guides
- Complex multi-step processes
- Information too lengthy for main SKILL.md
- Content that's only needed for specific use cases
## Structure Suggestions
### API Reference Example
- Overview
- Authentication
- Endpoints with examples
- Error codes
- Rate limits
### Workflow Guide Example
- Prerequisites
- Step-by-step instructions
- Common patterns
- Troubleshooting
- Best practices
"""
EXAMPLE_ASSET="""# Example Asset File
This placeholder represents where asset files would be stored.
Replace with actual asset files (templates, images, fonts, etc.) or delete if not needed.
Asset files are NOT intended to be loaded into context, but rather used within
description: This skill should be used when converting Angular NgModule-based components to standalone architecture. It handles dependency analysis, template scanning, route refactoring, and test updates. Use this skill when the user requests component migration to standalone, mentions "convert to standalone", or wants to modernize Angular components to the latest patterns.
---
# Standalone Component Migrator
## Overview
Automate the conversion of Angular components from NgModule-based architecture to standalone components with explicit imports. This skill analyzes component dependencies, updates routing configurations, migrates tests, and optionally converts to modern Angular control flow syntax (@if, @for, @switch).
## When to Use This Skill
Invoke this skill when:
- User requests component conversion to standalone
- User mentions "migrate to standalone" or "modernize component"
- User wants to remove NgModule declarations
- User references Angular's standalone component architecture
## Migration Workflow
### Step 1: Analyze Component Dependencies
1.**Read Component File**
- Identify component decorator configuration
- Note selector, template path, style paths
- Check if already standalone
2.**Analyze Template**
- Read template file (HTML)
- Scan for directives: `*ngIf`, `*ngFor`, `*ngSwitch` → requires CommonModule
- Scan for forms: `ngModel`, `formControl` → requires FormsModule or ReactiveFormsModule
- Scan for built-in pipes: `async`, `date`, `json` → CommonModule
- Scan for custom components: identify all component selectors
- Scan for router directives: `routerLink`, `router-outlet` → RouterModule
3.**Find Parent NgModule**
- Search for NgModule that declares this component
- Read NgModule file to understand current imports
### Step 2: Convert Component to Standalone
Add `standalone: true` and explicit imports array:
```typescript
// BEFORE
import{Component}from'@angular/core';
@Component({
selector:'app-my-component',
templateUrl:'./my-component.component.html'
})
exportclassMyComponent{}
// AFTER
import{Component}from'@angular/core';
import{CommonModule}from'@angular/common';
import{FormsModule}from'@angular/forms';
import{RouterModule}from'@angular/router';
import{ChildComponent}from'./child.component';
import{CustomPipe}from'@isa/utils/pipes';
@Component({
selector:'app-my-component',
standalone: true,
imports:[
CommonModule,
FormsModule,
RouterModule,
ChildComponent,
CustomPipe
],
templateUrl:'./my-component.component.html'
})
exportclassMyComponent{}
```
### Step 3: Update Parent NgModule
Remove component from declarations, add to imports if exported:
description: This skill should be used when regenerating Swagger/OpenAPI TypeScript API clients in the ISA-Frontend monorepo. It handles generation of all 10 API clients (or specific ones), Unicode cleanup, breaking change detection, TypeScript validation, and affected test execution. Use this skill when the user requests API sync, mentions "regenerate swagger", or indicates backend API changes.
---
# Swagger Sync Manager
## Overview
Automate the regeneration of TypeScript API clients from Swagger/OpenAPI specifications. Handles 10 API clients with automatic post-processing, breaking change detection, impact analysis, and validation.
description: This skill should be used when working with Tailwind CSS styling in the ISA-Frontend project. Use it when writing component styles, choosing color values, applying typography, creating buttons, or determining appropriate spacing and layout utilities. Essential for maintaining design system consistency.
---
# ISA Tailwind Design System
## Overview
Assist with applying the ISA-specific Tailwind CSS design system throughout the ISA-Frontend Angular monorepo. This skill provides comprehensive knowledge of custom utilities, color palettes, typography classes, button variants, and layout patterns specific to this project.
## When to Use This Skill
Invoke this skill when:
- **After** checking `libs/ui/**` for existing components (always check first!)
- Styling layout and spacing for components
- Choosing appropriate color values for custom elements
- Applying typography classes to text content
- Determining spacing, layout, or responsive breakpoints
- Customizing or extending existing UI components
- Ensuring design system consistency
- Questions about which Tailwind utility classes are available
**Important**: This skill provides Tailwind utilities. Always prefer using components from `@isa/ui/*` libraries before applying custom Tailwind styles.
**Works together with:**
- **[angular-template](../angular-template/SKILL.md)** - Angular template syntax, control flow (@if, @for, @defer), and binding patterns
Only use Tailwind breakpoint utilities (`isa-desktop:`, `isa-desktop-l:`, `isa-desktop-xl:`) when the breakpoint service is not appropriate (e.g., pure CSS solutions).
## Quick Reference
### Typography Selection Guide
**Headings**:
- Large hero text: `.isa-text-heading-1-bold` (60px)
- Medium spacing: `gap-4` (1rem), `gap-6` (1.5rem)
- Wide spacing: `gap-8` (2rem), `gap-10` (2.5rem)
- Split screen: `gap-split-screen`
**Note**: Prefer Tailwind's standard rem-based spacing (e.g., `p-4`, `gap-6`) over pixel-based utilities (`px-*`) for better scalability and accessibility.
**Layout Heights**:
- Split screen tablet: `h-split-screen-tablet`
- Split screen desktop: `h-split-screen-desktop`
### Z-Index Layering
Apply semantic z-index values for proper layering:
- Dropdowns: `z-dropdown` (50)
- Sticky elements: `z-sticky` (100)
- Fixed elements: `z-fixed` (150)
- Modal backdrops: `z-modalBackdrop` (200)
- Modals: `z-modal` (250)
- Popovers: `z-popover` (300)
- Tooltips: `z-tooltip` (350)
## Common Styling Patterns
**Important**: These are examples for when UI components don't exist. Always check `@isa/ui/*` libraries first!
description: This skill should be used when migrating Angular libraries from Jest + Spectator to Vitest + Angular Testing Utilities. It handles test configuration updates, test file refactoring, mock pattern conversion, and validation. Use this skill when the user requests test framework migration, specifically for the 40 remaining Jest-based libraries in the ISA-Frontend monorepo.
---
# Test Migration Specialist
## Overview
Automate the migration of Angular library tests from Jest + Spectator to Vitest + Angular Testing Utilities. This skill handles the complete migration workflow including configuration updates, test file refactoring, dependency management, and validation.
**Current Migration Status**: 40 libraries use Jest (65.6%), 21 libraries use Vitest (34.4%)
## When to Use This Skill
Invoke this skill when:
- User requests test migration for a specific library
- User mentions "migrate tests" or "Jest to Vitest"
- User wants to update test framework for a library
- User references the 40 remaining libraries to migrate
## Migration Workflow
### Step 1: Pre-Migration Analysis
Before making any changes, analyze the current state:
1.**Read Testing Guidelines**
- Use `docs-researcher` agent to read `docs/guidelines/testing.md`
- Understand migration patterns and best practices
- Note JUnit and Cobertura configuration requirements
2.**Analyze Library Structure**
- Read `libs/[path]/project.json` to identify current test executor
- Count test files using Glob: `**/*.spec.ts`
- Scan for Spectator usage patterns using Grep: `createComponentFactory|createServiceFactory|Spectator`
description: This skill should be used when improving TypeScript type safety by removing `any` types, adding Zod schemas for runtime validation, creating type guards, and strengthening strictness. Use this skill when the user wants to enhance type safety, mentions "fix any types", "add Zod validation", or requests type improvements for better code quality.
---
# Type Safety Engineer
## Overview
Enhance TypeScript type safety by eliminating `any` types, adding Zod schemas for runtime validation, creating type guards, and strengthening compiler strictness.
Commit messages should follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). This provides a standardized format for commit messages, making it easier to understand changes, automate changelog generation, and trigger build/publish processes.
## Format
The commit message structure is as follows:
```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
---
### Components
1.**Type**: Indicates the kind of change introduced by the commit. Must be one of the allowed types (see below).
2.**Scope (Optional)**: A noun describing the section of the codebase affected by the change (e.g., `auth`, `ui`, `build`). Enclosed in parentheses.
3.**Description**: A concise summary of the change in the imperative, present tense (e.g., "add login feature", not "added login feature" or "adds login feature"). Starts with a lowercase letter and should not end with a period. Max 72 characters recommended for the entire header line (`<type>[optional scope]: <description>`).
4.**Body (Optional)**: A more detailed explanation of the changes. Use the imperative, present tense. Explain the _what_ and _why_ vs. _how_. Separate from the description by a blank line. Wrap lines at 72 characters.
5.**Footer(s) (Optional)**: Contains additional metadata. Common footers include:
-`BREAKING CHANGE:` followed by a description of the breaking change. A `!` can also be appended to the type/scope (`feat!:`) to indicate a breaking change.
- Issue references (e.g., `Refs: #123`, `Closes: #456`). Separate from the body by a blank line.
---
### Allowed Types
- **feat**: A new feature for the user.
- **fix**: A bug fix for the user.
- **build**: Changes that affect the build system or external dependencies (e.g., gulp, broccoli, npm).
- **chore**: Other changes that don't modify src or test files (e.g., updating dependencies, build tasks).
- **ci**: Changes to CI configuration files and scripts (e.g., Travis, Circle, BrowserStack, SauceLabs).
- **docs**: Documentation only changes.
- **perf**: A code change that improves performance.
- **refactor**: A code change that neither fixes a bug nor adds a feature.
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
- **test**: Adding missing tests or correcting existing tests.
---
### Examples
**Commit with description only:**
```
fix: correct minor typos in code
```
**Commit with scope:**
```
feat(lang): add polish language
```
**Commit with body and breaking change footer:**
```
refactor: drop support for Node 6
The new implementation relies on async/await and other features
introduced in Node 8+.
BREAKING CHANGE: refactor to use JavaScript features not available in Node 6.
```
**Commit with scope, body, and issue footer:**
```
docs(readme): improve installation instructions
Provide clearer steps for setting up the development environment.
Add links to prerequisite tools.
Closes: #12
```
**Commit with `!` for breaking change:**
```
feat(api)!: send an email to the customer when a product is shipped
Guidelines: create new code in the closest domain folder; expose public API via each lib `src/index.ts`; follow existing naming (`feature-name.type.ts`). Keep generated swagger untouched—extend via wrapper libs if needed.
### 1.b Import Path Aliases
Use existing TS path aliases (see `tsconfig.base.json`) instead of long relative paths:
- UI components: `@isa/ui/buttons`, `@isa/ui/dialog`, `@isa/ui/input-controls`, `@isa/ui/layout`, `@isa/ui/menu`, `@isa/ui/toolbar`, etc. (one alias per folder under `libs/ui/*`)
-`@generated/swagger/isa-api`, `@generated/swagger/oms-api`, `@generated/swagger/inventory-api`, etc. (one per subfolder). Never edit generated sources—wrap in a domain lib if extension needed.
- Always add new reusable code as a library then expose via an `@isa/...` alias; do not add new generic code under app-local aliases if it may be reused later.
- When introducing a new library ensure its `src/index.ts` re-exports only stable public surface; internal helpers stay un-exported.
- For new generated API groups, extend via thin wrappers in a domain `data-access` lib rather than patching generated code.
### 2. Testing Strategy
- Legacy tests: Jest (`@nx/jest:jest`). New feature libs (e.g. remission feature) use Vitest + Vite plugin (`vite.config.mts`).
- When adding a new library today prefer Vitest unless consistency with existing Jest-only area is required.
- Do NOT mix frameworks inside one lib. Check presence of `vite.config.*` to know it is Vitest-enabled.
- Feature domains grouped (e.g. `libs/remission/**`, `libs/shared/**`, `libs/common/**`). Keep domain-specific code there; UI-only pieces in `ui/` or `shared/`.
- Prefer standalone components but some legacy components set `standalone: false` (see `MainComponent`). Maintain existing pattern unless doing a focused migration.
### 4. Logging (Critical Pattern)
- Central logging via `@isa/core/logging` (files: `logging.service.ts`, `logging.providers.ts`).
- Configure once in app config using provider builders: `provideLogging(withLogLevel(...), withSink(ConsoleLogSink), withContext({...}))`.
- Use factory `logger(() => ({ dynamicContext }))` (see README) rather than injecting `LoggingService` directly unless extending framework code.
- Context hierarchy: global -> component (`provideLoggerContext`) -> instance (factory param) -> message (callback arg). Always pass context as lazy function `() => ({ ... })` for perf.
- Respect log level threshold; do not perform expensive serialization before calling (let sinks handle it or gate behind dev checks).
### 5. Configuration Access
- Use `Config` service (`@isa/core/config/src/lib/config.ts`). Fetch values with Zod schema: `config.get('licence.scandit', z.string())` (see `SCANDIT_LICENSE` token). Avoid deprecated untyped access.
### 6. Storage & State Persistence
- Storage abstraction: `injectStorage(SomeProvider)` wraps a `StorageProvider` (local/session/indexedDB/custom user storage) and prefixes keys with current authenticated user `sub` (OAuth `sub` fallback 'anonymous').
- When adding persisted signal stores, use `withStorage(storageKey, ProviderType)` feature (`signal-store-feature.ts`) to auto debounce-save (1s) + restore on init. Only pass plain serializable state.
### 7. Signals & State
- Internal state often via Angular signals & NgRx Signals (`@ngrx/signals`). Avoid manual subscriptions—prefer computed/signals and `rxMethod` for side effects.
- When persisting, ensure objects are JSON-safe; validation via Zod if deserializing external data.
1. Store Shape: Keep initial state small & serializable (no class instances, functions, DOM nodes). Derive heavy or view-specific projections with `withComputed`.
2. Side Effects: Wrap fetch/update flows inside `rxMethod` pipes; ensure cancellation semantics (`switchMap`) to drop stale requests.
3. Persistence: Apply `withStorage(key, Provider)` last so hooks run after other features; persisted state must be plain JSON (no Dates—convert to ISO strings). Debounce already handled (1s) in `withStorage`—do NOT add another debounce upstream unless burst traffic is extreme.
4. Error Handling: Keep an `error` field in state for presentation; log via `logger()` at Warn/Error levels but do not store full Error object (serialize minimal fields: `message`, maybe `code`).
5. Loading Flags: Prefer a boolean `loading` OR a discriminated union `status: 'idle'|'loading'|'success'|'error'` for richer UI; avoid multiple booleans that can drift.
6. Computed Selectors: Name as `XComputed` or just semantic (e.g. `filteredItems`) using `computed(() => ...)` inside `withComputed`; never cause side-effects in a computed.
7. Resource Factory Pattern: For remote data needed in multiple components, create a factory function returning an object with `value`, `isLoading`, `error` signals plus a `reload()` method; see remission `resources/` directory.
Store Lifecycle Hooks:
- Use `withHooks({ onInit() { ... }, onDestroy() { ... } })` for restoration, websockets, or timers. Pair cleanups explicitly.
Persistence Feature (`withStorage`):
- Implementation: Debounced `storeState` rxMethod listens to any state change, saves hashed user‑scoped key (see `hash.utils.ts`). On init it calls `restoreState()`.
- Extending: If you need to blacklist transient fields from persistence, add a method wrapping `getState` and remove keys before `storage.set` (extend feature locally rather than editing shared code unless broadly needed).
- Use `runInInjectionContext(TestBed.inject(Injector), () => FeatureXStore)` or instantiate via exported factory if provided.
- For async rxMethod flows, flush microtasks (`await vi.runAllTimersAsync()` if timers used) or rely on returned observable completion when you subscribe inside the test harness.
- Snapshot only primitive slices (avoid full object snapshots with volatile ordering).
Migration Tips:
- Converting legacy NgRx reducers: Start by lifting static initial state + selectors into `withState` + `withComputed`; replace effects with `rxMethod` maintaining cancellation semantics (`switchMap` mirrors effect flattening strategy).
- Keep action names only if externally observed (analytics, logging). Otherwise remove ceremony—call store methods directly.
Anti-Patterns to Avoid:
- Writing to signals inside a computed or inside another signal setter (causes cascading updates).
- Storing large unnormalized arrays and then repeatedly filtering/sorting in multiple components—centralize that in computed selectors.
- Persisting secrets or PII directly; hash keys already user-scoped but content still plain—sanitize if needed.
- Returning raw subscriptions from store methods; expose signals or idempotent methods only.
#### 7.b Prefer Signals over Observables (Practical Rules)
Default to signals for all in-memory UI & derived state; keep Observables only at I/O edges.
Use Observables for:
- HTTP / WebSocket / SignalR streams at the boundary.
- Timer / interval / external event sources.
- Interop with legacy NgRx store pieces not yet migrated.
Immediately convert inbound Observables to signals:
Avoid converting a signal back to an Observable just to use a single RxJS operator; prefer inline signal `computed` or small helper.
Migration heuristic:
1. Identify component `foo$` fields used only in template -> convert to signal via `toSignal`.
2. Collapse chains of `combineLatest` + `map` into `computed`.
3. Replace imperative `subscribe` side-effects with `rxMethod` + `patchState`.
4. Add persistence last via `withStorage` if state must survive reload.
Performance tip: heavy derived computations (sorting large arrays) belong in a memoized `computed`; if expensive & infrequently needed, gate behind another signal flag.
### 8. Scanner Integration (Scandit)
- Barcode scanning encapsulated in `@isa/shared/scanner` (`scanner.service.ts`). Use provided injection tokens for license & defaults (override via DI if needed). Service auto-configures once; `ready` signal triggers `configure()` lazily.
- Always catch and log errors with proper context; platform gating throws `PlatformNotSupportedError` which is downgraded to warn.
### 9. Styling
- Tailwind with custom semantic tokens (`tailwind.config.js`). Prefer design tokens like `text-isa-neutral-700`, spacing utilities with custom `px-*` scales rather than ad‑hoc raw values.
- Global overlays rely on CDK classes; retain `@angular/cdk/overlay-prebuilt.css` in style arrays when creating new entrypoints or Storybook stories.
### 10. Library Conventions
- File naming: kebab-case; feature first then type (e.g. `return-receipt-list.component.ts`).
- Provide public API via each lib `src/index.ts`. Export only stable symbols; keep internal utilities in subfolders not re-exported.
- Add `project.json` with `test` & `lint` targets; for new Vitest libs include `vite.config.mts` and adjust `tsconfig.spec.json` references to vitest types.
### 11. Adding / Modifying Tests
- For Jest libs: standard `*.spec.ts` with `TestBed`. Spectator may appear in legacy code—do not introduce Spectator in new tests; use Angular Testing Utilities.
- For Vitest libs: ensure `vite.config.mts` includes `setupFiles`. Use `describe/it` from `vitest` and Angular TestBed (see remission resource spec for pattern of using `runInInjectionContext`).
- Prefer resource-style factories returning signals for async state (pattern in `createSupplierResource`).
### 12. Performance & Safety
- Logging: rely on lazy context function; avoid `JSON.stringify()` unless behind a dev guard.
- Storage: hashing keys (see `hash.utils.ts`) ensures stable key space; do not bypass if you need consistent per-user scoping.
- Scanner overlay: always clean up overlay + event listeners (follow existing `open` implementation for pattern).
### 13. CI / Coverage / Artifacts
- JUnit XML placed in `testresults/` (Jest configured with `jest-junit`). Keep filename stability for pipeline consumption; do not rename those outputs.
- Coverage output under `coverage/libs/...`; respect Nx caching—avoid side effects outside project roots.
### 14. When Unsure
- Search existing domain folder for analogous implementation (e.g. new feature under remission: inspect sibling feature libs for structure).
- Preserve existing DI token patterns instead of introducing new global singletons.
description: Plan Mode - Research and create a detailed implementation plan before making any changes.
model: Gemini 2.5 Pro (copilot)
---
# 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]
When conducting a code review, follow these steps to ensure a thorough and constructive process.
**Ensure that all review guidelines are followed. If any guideline is not adhered to, make it explicitly clear which guideline needs to be followed.**
## Review Process
1. 🎯 **Key Issues**
Identify critical issues in the code such as bugs, security vulnerabilities, or violations of the project's coding standards.
_Include specific links to files and line numbers (e.g., file.js#L10) where applicable._
2. 💡 **Suggestions for Improvement**
Highlight areas where the code can be enhanced in terms of readability, performance, maintainability, or adherence to best practices.
_Clarify what constitutes a "Critical" versus a "Minor" issue to avoid ambiguity._
3. ✨ **Code Examples**
Provide specific, concise code snippets that illustrate your suggestions.
_Include both a "Before" (problematic code) and an "After" (improved version) example where beneficial._
4. 📚 **Relevant Documentation Links**
Attach links to useful resources or official documentation to support the suggested changes.
_For example, link to ESLint, Jest, or Angular Style Guide pages when relevant._
## Tone and Feedback
- Be constructive and supportive.
Frame suggestions as opportunities for growth rather than criticism.
- Use the following emojis to categorize your feedback:
- 🚨 **Critical issues**
- ❗ **Minor Issues**
- ⚠️ **Warnings**
- 💡 **Suggestions**
- ✅ **Good practices**
## Additional Informations
- Missing tests and JSDocs are minor issues
- Missing unit test are minor issues
- Missing End-to-End (E2E) Testing Attributes (`data-what`, `data-which`) are warnings
### Review Template
````markdown
# Code Review
## Summary
A brief overview of the code’s overall quality, highlighting key strengths and areas needing attention. This sets the stage for the detailed feedback below.
---
## 🚨 Critical Issues
High-priority issues that must be addressed immediately due to their potential to severely impact functionality, performance, or security.
### 1. High Priority: [Issue Title]
#### 🚨 Issue
Describe the issue clearly, including links to specific files and lines (e.g., file.js#L10). Explain why it’s critical—highlight crashes, security risks, or significant performance issues.
#### 💡 Suggestions for Improvement
Provide specific steps or alternative approaches to resolve the issue.
#### ✨ Code Example
**Current**: [file](file.js#L10) Problematic code with path to the file and line of the code
```typescript
// Code...
```
**Improvement**: Improved version
```typescript
// Code...
```
#### 📚 Relevant Documentation
Include URLs for further research (e.g., [Jest Documentation](https://jestjs.io/docs/getting-started)).
---
## ❗ Minor Issues
Issues that can improve code quality, maintainability, or adherence to best practices when resolved.
### 1. Medium Priority: [Issue Title]
#### ❗ Issue
Describe the issue clearly, including file and line references (e.g., file.js#L10). Explain the impact on the project.
#### 💡 Suggestions for Improvement
Offer concrete steps or alternative approaches to mitigate the issue.
#### ✨ Code Example
**Current**: [file](file.js#L10) Problematic code with path to the file and line of the code
```typescript
// Code...
```
**Improvement**: Improved version
```typescript
// Code...
```
#### 📚 Relevant Documentation
Provide links to further resources.
---
## ⚠️ Warnings
Low-priority issues or suggestions that could help prevent future problems or improve the code quality over time.
### 1. Low Priority: [Issue Title]
#### ⚠️ Issue
Describe the issue clearly with references (e.g., file.js#L10). Explain the potential impact if left unaddressed.
#### 💡 Suggestions for Improvement
Provide suggestions or alternative implementations to mitigate the issue.
#### ✨ Code Example
**Current**: [file](file.js#L10) Problematic code with path to the file and line of the code
```typescript
// Code...
```
**Improvement**: Improved version
```typescript
// Code...
```
#### 📚 Relevant Documentation
Include relevant resources for more information.
---
## 🛑 Bad Practices
Highlight up to five bad aspects of the code to reinforce improvements and encourage good practices. Use different funny emoji at the beginning of each bad practice.
- Emoji **Bad Practice 1**:
Describe a specific weakness (e.g., clear code structure) with an example reference (e.g., file.js#L20). Explain why it’s bad.
- Emoji **Bad Practice 2**:
Outline another negative feature (e.g., effective error handling) with a snippet reference.
---
## ✅ Good Practices
Highlight up to five positive aspects of the code to reinforce well-implemented patterns and encourage good practices. Use different funny emoji at the beginning of each good practice.
- Emoji **Good Practice 1**:
Describe a specific strength (e.g., clear code structure) with an example reference (e.g., file.js#L20). Explain why it’s commendable.
- Emoji **Good Practice 2**:
Outline another positive feature (e.g., effective error handling) with a snippet reference.
---
## 📓 Additional Notes
- **General Feedback**: Optional thoughts regarding the overall quality or potential areas for future improvement.
- **Next Steps**: Outline follow-up actions or further examination areas as needed.
<!-- Leave the start & end comments to automatically receive updates. -->
# General Guidelines for working with Nx
- When running tasks (for example build, lint, test, e2e, etc.), always prefer running the task through `nx` (i.e. `nx run`, `nx run-many`, `nx affected`) instead of using the underlying tooling directly
- You have access to the Nx MCP server and its tools, use them to help the user
- When answering questions about the repository, use the `nx_workspace` tool first to gain an understanding of the workspace architecture where applicable.
- When working in individual projects, use the `nx_project_details` mcp tool to analyze and understand the specific project structure and dependencies
- For questions around nx configuration, best practices or if you're unsure, use the `nx_docs` tool to get relevant, up-to-date docs. Always use this instead of assuming things about nx configuration
- If the user needs help with an Nx configuration or project graph error, use the `nx_workspace` tool to get any errors
| **Single Specific File** | Read tool directly | No agent needed |
**Note:** The `docs-researcher` agent uses `docs/library-reference.md` as a primary index for discovering monorepo libraries. This file contains descriptions and locations for all libraries, enabling quick library discovery without reading individual READMEs.
### Documentation Research System (Two-Tier)
1.**ALWAYS start with `docs-researcher`** (Haiku, 30-120s) for any documentation need
2.**Auto-escalate to `docs-researcher-advanced`** (Sonnet, 2-7min) when:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.0.
## Code scaffolding
Run `ng generate component component-name --project scan` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project scan`.
> Note: Don't forget to add `--project scan` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build scan` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build scan`, go to the dist folder `cd dist/scan` and run `npm publish`.
## Running unit tests
Run `ng test scan` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.2.
## Code scaffolding
Run `ng generate component component-name --project product-image` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project product-image`.
> Note: Don't forget to add `--project product-image` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build product-image` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build product-image`, go to the dist folder `cd dist/product-image` and run `npm publish`.
## Running unit tests
Run `ng test product-image` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.