mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1990: feat(crm-data-access,checkout): improve primary bonus card selection logic
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
This commit is contained in:
committed by
Lorenz Hilpert
parent
6db5f2afda
commit
f87d3a35d9
@@ -173,6 +173,7 @@ export class ShoppingCartService {
|
||||
return res.result as ShoppingCart;
|
||||
}
|
||||
|
||||
// TODO: Code Kommentieren + Beschreiben
|
||||
async completeRewardSelection({
|
||||
tabId,
|
||||
rewardSelectionItems,
|
||||
@@ -222,6 +223,7 @@ export class ShoppingCartService {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: If Logik in eigene Funktionen auslagern - Für Remove die Update Funktion mit Quantity 0 nutzen, Code Kommentieren
|
||||
async #handleCart({
|
||||
shoppingCartId,
|
||||
itemId,
|
||||
@@ -295,6 +297,7 @@ export class ShoppingCartService {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: If Logik in eigene Funktionen auslagern - Für Remove die Update Funktion mit Quantity 0 nutzen, Code Kommentieren
|
||||
async #handleRewardCart({
|
||||
rewardShoppingCartId,
|
||||
itemId,
|
||||
|
||||
Reference in New Issue
Block a user