Problem
The loans.store.ts (38 lines total) has NO persistence middleware. The simulatedAmount and simulatedTerm fields (lines 14-16) are in-memory only. All simulation results and loan data are lost when the app restarts.
User impact: Every time a user restarts the app, their loan simulation results are gone. Active loans fetched from API are also not cached offline.
Root Cause
Persistence was not added to the loans store during implementation.
What To Build
- Add Zustand persist middleware to loans.store.ts
- Use AsyncStorage as the storage engine (consistent with other stores)
- Whitelist
simulatedAmount and simulatedTerm for persistence
- Add
setLoans persistence (cache active loans)
- Add loading state while persisted data hydrates
Files To Touch
stores/loans.store.ts — add persist middleware
Acceptance Criteria
Mandatory Checks
Problem
The
loans.store.ts(38 lines total) has NO persistence middleware. ThesimulatedAmountandsimulatedTermfields (lines 14-16) are in-memory only. All simulation results and loan data are lost when the app restarts.User impact: Every time a user restarts the app, their loan simulation results are gone. Active loans fetched from API are also not cached offline.
Root Cause
Persistence was not added to the loans store during implementation.
What To Build
simulatedAmountandsimulatedTermfor persistencesetLoanspersistence (cache active loans)Files To Touch
stores/loans.store.ts— add persist middlewareAcceptance Criteria
Mandatory Checks