fix(crm-customer-card): Refresh after Lock, Unlock or Add Cards correctly, Adjusted Placeholder Text, Show Transactions based on first Card instead of first active card

Ref: #5503
This commit is contained in:
Nino
2025-11-21 17:10:12 +01:00
parent df1fe540d0
commit 4c306a213d
11 changed files with 81 additions and 48 deletions

View File

@@ -9,28 +9,30 @@
[customerId]="customerId$ | async"
[tabId]="processId$ | async"
(navigateToPraemienshop)="onNavigateToPraemienshop()"
(cardUpdated)="reloadCardTransactionsAndCards()"
class="mt-4"
/>
@let cardCode = firstActiveCardCode();
@let activeCardCode = firstActiveCardCode();
@if (cardCode) {
@if (activeCardCode) {
<crm-customer-bon-redemption
[cardCode]="cardCode"
[cardCode]="activeCardCode"
class="mt-4"
(redeemed)="reloadCardTransactionsAndCards()"
/>
<crm-customer-booking
[cardCode]="cardCode"
[cardCode]="activeCardCode"
class="mt-4"
(booked)="reloadCardTransactionsAndCards()"
/>
<crm-customer-card-transactions
[cardCode]="cardCode"
class="mt-8"
(reload)="reloadCardTransactionsAndCards()"
/>
}
<crm-customer-card-transactions
[cardCode]="firstCardCode()"
class="mt-8"
(reload)="reloadCardTransactionsAndCards()"
/>
<utils-scroll-top-button
[target]="hostElement"
class="flex flex-col justify-self-end fixed bottom-6 right-6"

View File

@@ -72,6 +72,15 @@ export class KundenkarteMainViewComponent implements OnDestroy {
*/
readonly customerId = toSignal(this.customerId$);
/**
* Get the first card code
*/
readonly firstCardCode = computed(() => {
const cards = this.#bonusCardsResource.resource.value();
const firstCard = cards?.[0];
return firstCard?.code;
});
/**
* Get the first active card code
*/