12 KiB
Tasks for mnemo_cards_web_v2
Status: API v2 Implementation Phase
Last Updated: January 2025 Current Phase: Phase 1.6 Complete - API v2 Backend Implementation
🎯 Phase 1: Backend API v2 Implementation
Task 1.7: Implement Subscriptions API v2 ⬜ PENDING
Priority: HIGH
Estimated Time: 4-6 hours
Status: 0% complete
Description
Complete subscription management endpoints with purchase, status checking, and cancellation functionality.
Implementation Steps
- ⬜ Create SubscriptionsApiV2 with endpoints:
- GET
/api/v2/subscriptions/plans- Get available subscription plans - POST
/api/v2/subscriptions/purchase- Purchase subscription - GET
/api/v2/subscriptions/status- Check subscription status - POST
/api/v2/subscriptions/cancel- Cancel subscription
- GET
- ⬜ Implement subscription plan models and DTOs
- ⬜ Add subscription validation and business logic
- ⬜ Write comprehensive unit tests (15+ tests)
- ⬜ Write integration tests for subscription flow
Acceptance Criteria
- All subscription endpoints implemented and tested
- Subscription plans can be fetched
- Subscription purchase flow works
- Subscription status checking works
- Subscription cancellation works
- Comprehensive test coverage (15+ tests)
Task 1.8: Implement Promocodes API v2 ⬜ PENDING
Priority: MEDIUM
Estimated Time: 3-4 hours
Status: 0% complete
Description
Complete promocode validation, application, and listing endpoints.
Implementation Steps
- ⬜ Create PromocodesApiV2 with endpoints:
- GET
/api/v2/promocodes- List available promocodes - POST
/api/v2/promocodes/apply- Apply promocode - GET
/api/v2/promocodes/{code}/validate- Validate promocode
- GET
- ⬜ Implement promocode models and validation logic
- ⬜ Add promocode application and discount calculation
- ⬜ Write comprehensive unit tests (10+ tests)
- ⬜ Write integration tests for promocode flow
Acceptance Criteria
- All promocode endpoints implemented and tested
- Promocode validation works correctly
- Promocode application works correctly
- Discount calculation is accurate
- Comprehensive test coverage (10+ tests)
🎯 Phase 2: Web App Migration to API v2
Task 2.1: Complete Web App Migration ⬜ PENDING
Priority: HIGH
Estimated Time: 8-10 hours
Status: 60% complete
Description
Migrate all remaining services from v1 to v2 API (GamesManager, TestManager, PurchaseService, etc.).
Implementation Steps
- Migrate GamesManager to use HttpRepositoryV2
- Migrate TestManager to use HttpRepositoryV2
- ⬜ Migrate PurchaseService to use HttpRepositoryV2
- Migrate SubscriptionService to use HttpRepositoryV2
- Migrate PromocodeService to use HttpRepositoryV2
- ⬜ Update all API calls to use v2 endpoints
- Remove deprecated v1 dependencies
- Update all tests to use v2 API
- ⬜ Verify all functionality works with v2
Acceptance Criteria
- All services migrated to API v2
- All API calls use v2 endpoints
- No v1 dependencies remain
- All tests pass with v2 API
- All functionality verified working
🎯 Phase 3: Feature Implementation
Task 3.1: Implement Pack Purchase Flow ⬜ PENDING
Priority: HIGH
Estimated Time: 6-8 hours
Status: 0% complete
Description
Create purchase UI, payment integration with YooMoney, and purchase confirmation flow.
Implementation Steps
- ⬜ Create PurchaseService with v2 API integration
- ⬜ Create PurchaseModule in UserScope
- ⬜ Create PurchasePage UI with:
- Pack details and pricing
- Payment method selection
- Payment form (YooMoney integration)
- Purchase confirmation
- ⬜ Add "Buy Pack" button to PackDetailsPage
- ⬜ Implement payment status checking
- ⬜ Add purchase success/failure handling
- ⬜ Write comprehensive unit tests (15+ tests)
- ⬜ Write integration tests for purchase flow
Acceptance Criteria
- Purchase UI is complete and functional
- YooMoney payment integration works
- Purchase confirmation flow works
- Payment status checking works
- Purchase success/failure handling works
- Comprehensive test coverage (15+ tests)
Task 3.2: Complete Subscription Management UI ⬜ PENDING
Priority: MEDIUM
Estimated Time: 4-6 hours
Status: 0% complete
Description
Create subscription page with plans, purchase flow, and status management.
Implementation Steps
- ⬜ Create SubscriptionPage UI with:
- Available subscription plans display
- Plan comparison and features
- Purchase flow for subscriptions
- Current subscription status
- Subscription management (cancel/renew)
- ⬜ Add subscription status to ProfilePage
- ⬜ Implement subscription purchase flow
- ⬜ Add subscription cancellation flow
- ⬜ Write comprehensive unit tests (10+ tests)
- ⬜ Write integration tests for subscription flow
Acceptance Criteria
- Subscription page UI is complete
- Subscription plans display correctly
- Subscription purchase flow works
- Subscription status management works
- Comprehensive test coverage (10+ tests)
Task 3.3: Implement Promocode UI ⬜ PENDING
Priority: MEDIUM
Estimated Time: 3-4 hours
Status: 0% complete
Description
Add promocode input field, validation, and application functionality.
Implementation Steps
- ⬜ Create PromocodeInput widget
- ⬜ Add promocode input to PurchasePage and SubscriptionPage
- ⬜ Implement promocode validation UI
- ⬜ Add promocode application and discount display
- ⬜ Create promocode success/failure feedback
- ⬜ Write comprehensive unit tests (8+ tests)
- ⬜ Write integration tests for promocode flow
Acceptance Criteria
- Promocode input widget is complete
- Promocode validation works
- Promocode application works
- Discount display works correctly
- Comprehensive test coverage (8+ tests)
Task 3.4: Create Vocabulary/Review Page ⬜ PENDING
Priority: LOW
Estimated Time: 6-8 hours
Status: 0% complete
Description
Display all learned words across packs with filtering and search functionality.
Implementation Steps
- ⬜ Create VocabularyService for fetching learned words
- ⬜ Create VocabularyStateManager for state management
- ⬜ Create VocabularyModule in UserScope
- ⬜ Create VocabularyPage UI with:
- List of all learned words
- Filter by pack, language
- Search functionality
- Word review interface
- Export vocabulary option
- ⬜ Add VocabularyPage to bottom navigation
- ⬜ Write comprehensive unit tests (12+ tests)
- ⬜ Write integration tests for vocabulary flow
Acceptance Criteria
- Vocabulary page UI is complete
- Word filtering works correctly
- Search functionality works
- Word review interface works
- Export functionality works
- Comprehensive test coverage (12+ tests)
Task 3.5: Implement Ads Reward Flow 🟡 IN PROGRESS
Priority: HIGH
Estimated Time: 6-8 hours
Status: 40% complete (service layer, scope integration, and unit tests ready)
Description
Bring the mobile "watch ad to unlock pack/product" flow to the web client using Adsgram rewarded ads and the existing /ads backend endpoints.
Implementation Steps
- Expose ads reward endpoints in
HttpRepositoryV2(acquire product, optional reward ping) - Create
AdsRewardServicecoordinating ad session, backend calls, and user state updates - Add
AdsRewardModuletoUserScopewith yx_state manager for ad CTA/status - ⬜ Integrate web Adsgram SDK and wrap in Flutter widget/service with proper lifecycle
- ⬜ Update pack purchase UI to show "Unlock by watching ad" CTA when
adsKeypresent - ⬜ Refresh packs/user purchases after reward success and handle errors gracefully
- Write unit tests for service/state manager and widget logic (reward success, failure, retries)
Acceptance Criteria
- Ads CTA appears for eligible packs/products with valid
adsKey - Rewarded ad plays to completion using web SDK with proper loading state
- Successful reward calls
/ads/product/acquire/<key>and unlocks the product - Error states show helpful messages and allow retry
- Comprehensive unit tests (10+ tests) cover service, state, and widget logic
- Analytics events emitted for ad impressions, completions, failures
Task 3.6: Create Dedicated Settings Page ⬜ PENDING
Priority: LOW
Estimated Time: 2-3 hours
Status: 0% complete
Description
Separate settings from profile with theme, language, and notification options.
Implementation Steps
- ⬜ Create SettingsPage UI with:
- Theme toggle (light/dark)
- Language selection
- Sound effects toggle
- Notifications settings
- Account settings
- ⬜ Create SettingsStateManager for settings state
- ⬜ Add SettingsPage to navigation
- ⬜ Move settings from ProfilePage to SettingsPage
- ⬜ Write comprehensive unit tests (6+ tests)
Acceptance Criteria
- Settings page UI is complete
- All settings options work correctly
- Settings are persisted properly
- Comprehensive test coverage (6+ tests)
🎯 Phase 4: Quality & Testing
Task 4.1: Fix Test Failures ⬜ PENDING
Priority: MEDIUM
Estimated Time: 2-3 hours
Status: 0% complete
Description
Resolve 24 failing tests (mostly empty test files) to ensure all tests pass.
Implementation Steps
- ⬜ Fix test_page_test.dart empty file
- ⬜ Investigate and fix other test failures
- ⬜ Ensure all tests compile and run
- ⬜ Verify all tests pass
Acceptance Criteria
- All 24 failing tests are fixed
- All tests pass successfully
- No compilation errors in tests
Task 4.2: Increase Test Coverage ⬜ PENDING
Priority: MEDIUM
Estimated Time: 4-6 hours
Status: 0% complete
Description
Add comprehensive tests for all new services and UI components.
Implementation Steps
- ⬜ Add tests for all new API v2 services
- ⬜ Add tests for all new UI components
- ⬜ Add tests for all new state managers
- ⬜ Add tests for all new modules
- ⬜ Ensure test coverage is above 90%
Acceptance Criteria
- Test coverage above 90%
- All new services have comprehensive tests
- All new UI components have tests
- All new state managers have tests
Task 4.3: Fix Linter Issues ⬜ PENDING
Priority: LOW
Estimated Time: 1-2 hours
Status: 0% complete
Description
Run flutter analyze and resolve all warnings and code quality issues.
Implementation Steps
- ⬜ Run
flutter analyzeto identify issues - ⬜ Fix all linter warnings
- ⬜ Fix all code quality issues
- ⬜ Ensure clean analysis report
Acceptance Criteria
- No linter warnings
- No code quality issues
- Clean analysis report
Task 4.4: Write Integration Tests ⬜ PENDING
Priority: LOW
Estimated Time: 6-8 hours
Status: 0% complete
Description
Create end-to-end tests for auth flow, pack browsing, test taking, and card learning.
Implementation Steps
- ⬜ Create integration test for auth flow
- ⬜ Create integration test for pack browsing
- ⬜ Create integration test for test taking
- ⬜ Create integration test for card learning
- ⬜ Create integration test for purchase flow
- ⬜ Create integration test for subscription flow
Acceptance Criteria
- All major user flows have integration tests
- Integration tests cover critical paths
- Integration tests are reliable and maintainable
📊 Summary
Total Tasks: 13
Completed: 0
In Progress: 0
Pending: 13
Priority Breakdown:
- 🔴 HIGH: 5 tasks (API v2 completion, web migration, pack purchase, ads reward)
- 🟡 MEDIUM: 5 tasks (subscription UI, promocode UI, test fixes, coverage)
- 🟢 LOW: 3 tasks (vocabulary page, settings page, linter fixes)
Current Focus: Phase 1.7 - Implement Subscriptions API v2
Next Task: Phase 1.8 - Implement Promocodes API v2
Note: Tasks are marked as complete only when fully implemented, tested, and production-ready (no stubs or TODOs).