Skip to content

feat: typed mock service layer and global async state system (#38, #48)#107

Merged
Abidoyesimze merged 1 commit intoNeurowealth:mainfrom
temiport25:feat/mock-service-layer-and-async-states
Mar 30, 2026
Merged

feat: typed mock service layer and global async state system (#38, #48)#107
Abidoyesimze merged 1 commit intoNeurowealth:mainfrom
temiport25:feat/mock-service-layer-and-async-states

Conversation

@temiport25
Copy link
Copy Markdown
Contributor

Issue #38 - Mock data layer and service adapters:

  • Add src/lib/mock-services.ts with typed AuthService, PortfolioService, StrategyService, and TransactionService interfaces
  • Shared ServiceError model with code, message, and retryable flag
  • SimulationOptions for forcing success/failure or auto (15% fail rate)
  • Each mock service implements its interface — swap for real adapters without touching call-sites

Issue #48 - Global loading, empty, and error state system:

  • Add src/components/ui/ErrorBlock.tsx: inline error block with title, description, and retry action button (spec: title + explanation + CTA)
  • Add src/hooks/useAsyncState.ts: generic hook managing idle/loading/ success/error with ServiceError-aware retry flag
  • Export ErrorBlock from src/components/ui/index.ts barrel
  • Add src/app/dashboard/async-states/page.tsx: demo page covering loading skeletons, empty states with CTAs, and error blocks with retry for portfolio, strategy, transaction, history, and audit pages

closes #38
closes #48

…alth#38, Neurowealth#48)

Issue Neurowealth#38 - Mock data layer and service adapters:
- Add src/lib/mock-services.ts with typed AuthService, PortfolioService,
  StrategyService, and TransactionService interfaces
- Shared ServiceError model with code, message, and retryable flag
- SimulationOptions for forcing success/failure or auto (15% fail rate)
- Each mock service implements its interface — swap for real adapters
  without touching call-sites

Issue Neurowealth#48 - Global loading, empty, and error state system:
- Add src/components/ui/ErrorBlock.tsx: inline error block with title,
  description, and retry action button (spec: title + explanation + CTA)
- Add src/hooks/useAsyncState.ts: generic hook managing idle/loading/
  success/error with ServiceError-aware retry flag
- Export ErrorBlock from src/components/ui/index.ts barrel
- Add src/app/dashboard/async-states/page.tsx: demo page covering
  loading skeletons, empty states with CTAs, and error blocks with
  retry for portfolio, strategy, transaction, history, and audit pages

All checks pass: lint ✓  tsc --noEmit ✓  next build ✓
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@temiport25 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Abidoyesimze Abidoyesimze merged commit 8984987 into Neurowealth:main Mar 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement global loading, empty, and error state system Implement frontend mock data layer and service adapters

2 participants