# π΅ Finance Module β Mock Data & Back Button Blueprint **Date:** 2026-07-26 **Author:** Architect Mode **Status:** Pending Code Mode Execution **Priority:** MEDIUM β UI polish, no app-breaking bugs --- ## STEP 1: MOCK DATA ANALYSIS ### 1.1 Dashboard Financial Card (ProfileTrustCard.vue) **File:** [`frontend_app/src/components/dashboard/ProfileTrustCard.vue`](frontend_app/src/components/dashboard/ProfileTrustCard.vue) | Field | Current Value | Source | Is Mock? | |-------|--------------|--------|----------| | `financeStore.totalCredits` (line 40) | Live API data | `financeStore.fetchWalletBalance()` β `GET /billing/wallet/balance` | **β LIVE** β already fetches real data | | `financeStore.serviceCoins` (line 43) | Live API data | Same store | **β LIVE** | | `financeStore.totalCredits` stat tile (line 51) | Live API data | Same store | **β LIVE** | | Transaction count (line 57) | `β` hardcoded | Static placeholder | **β MOCK** | | Package info (line 63) | `β’` hardcoded | Static placeholder | **β MOCK** | | `financeStore.voucherBalance` (line 69) | Live API data | Same store | **β LIVE** | **Conclusion:** The wallet balance numbers (`totalCredits`, `serviceCoins`, `voucherBalance`) ARE live and fetched from the API. However, two stat tiles show static placeholders that render identically for all users. ### 1.2 Gamification Card (GamificationCard.vue) **File:** [`frontend_app/src/components/dashboard/GamificationCard.vue`](frontend_app/src/components/dashboard/GamificationCard.vue) | Field | Current Value | Source | Is Mock? | |-------|--------------|--------|----------| | Score (line 18) | `2,450` hardcoded | Literal number in template | **β MOCK** β same for all users | | Badges (lines 56-61) | 4 hardcoded entries | Static array in script | **β MOCK** β same for all users | **Evidence:** - [`GamificationCard.vue`](frontend_app/src/components/dashboard/GamificationCard.vue:18): `
2,450
` β literal HTML - [`GamificationCard.vue`](frontend_app/src/components/dashboard/GamificationCard.vue:56-61): `const badges = ref([{ icon: 'π±', label: 'Eco Driver' }, ...])` β never updated from API **Fix plan:** - Import a gamification/PinΓa store (check if one exists) to fetch real user score - If no gamification store exists yet, create a computed that reads from `authStore` or call an API endpoint - Replace hardcoded badges with data fetched from a gamification endpoint ### 1.3 FinanceMainView Cards **File:** [`frontend_app/src/components/../views/FinanceMainView.vue`](frontend_app/src/views/FinanceMainView.vue) **Card 1 (Wallet):** Uses `financeStore.totalCredits`, `financeStore.purchasedCredits`, `financeStore.serviceCoins`, `financeStore.earnedCredits`, `financeStore.voucherBalance` β all live data from `financeStore.fetchWalletBalance()` β **Card 2 (Packages):** Uses `authStore.user?.subscription_plan` β live data β **Card 3 (Transactions):** Static placeholder with emoji β by design (placeholder page) β **Card 4 (Invoices):** Static placeholder with π§ β by design ("Hamarosan") β --- ## STEP 2: BACK BUTTON LAYOUT ANALYSIS ### 2.1 The Gold Standard: FleetView.vue Header **File:** [`frontend_app/src/views/vehicles/FleetView.vue`](frontend_app/src/views/vehicles/FleetView.vue:13-57) The FleetView header pattern: ```html{{ t('garage.subtitle', { count: ... }) }}
` subtitle 3. Right side: `
2,450
` - To: `{{ userScore }}
` - Add script logic: `const userScore = computed(...)` linked to real data source 3. **Replace hardcoded badges (lines 56-61):** - Change the static `badges` array to a computed or ref that fetches from API - Keep the same HTML template rendering β just change data source ### Task B: Fix Mock Data in ProfileTrustCard.vue **File:** [`frontend_app/src/components/dashboard/ProfileTrustCard.vue`](frontend_app/src/components/dashboard/ProfileTrustCard.vue) 1. **Fix transaction count (line 57):** - Change `β
` - To: `{{ transactionCount }}
` - Add: `const transactionCount = computed(() => 0)` β placeholder for now, will wire to real API later 2. **Fix package info (line 63):** - Change `β’
` - To: `{{ authStore.user?.subscription_plan || 'β' }}
` - Add: `import { useAuthStore } from '../../stores/auth'` and `const authStore = useAuthStore()` ### Task C: Remove Teleport & Add Local Header β FinanceMainView.vue **File:** [`frontend_app/src/views/FinanceMainView.vue`](frontend_app/src/views/FinanceMainView.vue) 1. **DELETE lines 38-40** β the entire Teleport block: ```html