Phase 2 vs Phase 3 - Feature Comparison & Changes
This document provides a comprehensive comparison between Phase 2 (deployed on develop branch) and Phase 3 (deployed on v3 branch), highlighting all features, changes, and improvements.
📋 Overview
- Phase 2 Branch:
develop - Phase 3 Branch:
v3
🔄 Major Architectural Changes
1. Subscription Model Restructuring
Phase 2 (develop)
- Child-based subscriptions: Each child had their own subscription
- Subscription linked directly to
child_id - Multiple active subscriptions per parent possible
Phase 3 (v3)
- Parent-based subscriptions: Subscriptions are now parent-level
- Subscription linked to
parent_idinstead ofchild_id - Only one active subscription per parent (enforced by unique constraint)
child_subscriptiontable restructured:- Removed
child_idcolumn - Added
parent_idcolumn - Added unique index:
ux_child_subscription_one_in_useonparent_idwherein_use = true
- Removed
Impact:
- Simplified subscription management
- Better alignment with business logic (subscription is for the parent, not individual children)
- Improved child count management per subscription plan
2. Subscription Provider System
Phase 2 (develop)
- Subscription products linked to platform (
IOS,ANDROID,NONE) - Direct platform-based product management
Phase 3 (v3)
- New
subscription_providertable introduced:APP_STORE(iOS subscriptions)PLAY_STORE(Android subscriptions)NONE(Free plan)
subscription_productstable now includesprovidercolumn
Impact:
- Clearer separation between platform and payment provider
3. Payment Gateway Integration
Phase 2 (develop)
- Single payment gateway: Razorpay only
- All appointments and payments processed through Razorpay
Phase 3 (v3)
- New-gateway support:
- Cashfree (new)
- New
payment_gatewaytable with values:CASHFREE
appointmenttable now includespayment_gatewaycolumn- New
cashfree_customer_idcolumn inuserstable - New
CashfreePgProviderservice for Cashfree payment processing
Impact:
- Payment gateway flexibility
- Better payment processing options
- Improved payment success rates with multiple gateways
🆕 New Features in Phase 3
1. Enhanced Play Store Integration
Phase 2 (develop)
- Basic Play Store purchase confirmation
- Limited purchase verification
Phase 3 (v3)
- Enhanced Play Store provider (
playstore.provider.ts):- Improved purchase verification
- Better error handling
- Enhanced subscription status management
- New DTO:
confirm-playstore-purchase.dto.ts
Impact:
- More reliable Android subscription management
- Better user experience for Android users
- Improved subscription renewal handling
3. Child Count Management
Phase 2 (develop)
- Fixed child limits per subscription plan
- No dynamic child count tracking
Phase 3 (v3)
- New
child_countcolumn insubscription_planstable:FREEplan: 3 childrenOTHERplans: 1 child (default)
- New trigger:
restrict_child_deactivation_if_has_active_subscription()- Prevents activating children beyond subscription limit
- Validates child count against current and pending subscription plans
- Enhanced
add_child()function:- Validates child count limits
- Checks both current and pending subscription plans
- Provides clear error messages
Impact:
- Better subscription plan enforcement
- Prevents over-subscription
- Clearer user experience with subscription limits
4. Subscription Change Management
Phase 2 (develop)
- Basic subscription change tracking
- Limited change status options
Phase 3 (v3)
- New status:
CANCELLEDadded tosubscription_change_status - Enhanced tracking:
old_transaction_idcolumnnew_transaction_idcolumn
- Improved change processing:
- Better handling of subscription upgrades/downgrades
- Transaction history tracking
- Enhanced webhook processing
Impact:
- Better audit trail for subscription changes
- Improved change management
- More reliable subscription transitions
5. Payment Status Enhancements
Phase 2 (develop)
- Standard payment statuses
Phase 3 (v3)
- New payment status:
AWAITING_CONFIRMATION - Better handling of pending payments
- Improved payment state management
Impact:
- Better handling of payment edge cases
- Improved user experience during payment processing
- More accurate payment status tracking
6. OTA (Over-The-Air) Updates
Phase 2 (develop)
- No OTA update support
Phase 3 (v3)
- OTA update support:
- Update checking mechanism
- Update notification system
- Background update processing
- Branch:
feat/ota-updatesmerged into v3
Impact:
- Faster app updates without app store approval
- Better user experience
- Reduced update friction
7. Therapist Wallet - Withdraw Transaction Tab
Phase 2 (develop)
- Single wallet history view
- No separate withdraw transaction tracking
- Limited withdrawal history visibility
Phase 3 (v3)
- New Withdraw Transaction Tab in Therapist Wallet:
- Separate tab for withdrawal transaction history
- Two-tab system: "Wallet History" and "Withdraw History"
- Complete withdrawal transaction tracking
- Features:
- View all withdrawal requests and their status
- Status indicators: REQUESTED, IN_PROGRESS, WITHDRAWN, REJECTED
- Bank account information display
- Withdrawal amount and date tracking
- Navigation to detailed withdrawal information
- Pagination support for withdrawal history
- Filter support for withdrawal transactions
Impact:
- Better visibility into withdrawal transactions
- Clear separation between wallet transactions and withdrawals
- Improved therapist experience for tracking earnings and withdrawals
- Better financial transparency
- Easier withdrawal request management
8. Android Build Improvements
Phase 2 (develop)
- Standard Android build configuration
Phase 3 (v3)
- 16KB page size upgrade:
- Android 16KB build support
- Crash fixes for Android
- Improved build stability
- Branch:
fix/android-16kb-buildmerged into v3
Impact:
- Better Android device compatibility
- Improved app stability
- Future-proof Android support
🐛 Bug Fixes in Phase 3
1. Subscription Management
- Fixed subscription status inconsistencies
- Resolved child subscription conflicts
- Fixed subscription change processing
2. Payment Processing
- Improved payment verification
- Fixed payment status updates
- Enhanced refund handling
3. Child Management
- Fixed child count validation
- Resolved subscription limit issues
- Improved child activation/deactivation
4. Lesson Plan Assignment
- Fixed lesson plan access control
- Resolved subscription feature checking
- Improved progress tracking
5. Assessment Management
- Fixed assessment assignment
- Improved subscription validation
- Enhanced access control
6. Android Specific
- Fixed Android 16KB build crashes
- Resolved build configuration issues
- Improved device compatibility
📱 Mobile App Changes
New Features
- OTA Updates: Over-the-air update support
- Improved UI/UX: Better user experience
- Performance Improvements: Faster app performance
- Therapist Wallet - Withdraw Transaction Tab:
- New tab system in Therapist Wallet
- Separate "Wallet History" and "Withdraw History" tabs
- Complete withdrawal transaction tracking with status indicators
- Bank account information display
- Navigation to withdrawal details
Bug Fixes
- Android Crashes: Fixed various Android-specific crashes
- Subscription UI: Improved subscription management UI
- Payment Flow: Enhanced payment processing
- Child Management: Better child management interface
- Wallet Management: Improved wallet transaction tracking and display
🔄 Migration Guide
-
Environment Variables:
# New Cashfree variables
CASHFREE_PAYMENT_CLIENT_ID=your_client_id
CASHFREE_PAYMENT_CLIENT_SECRET=your_client_secret
📝 Summary
Key Takeaways
- Subscription Model: Changed from child-based to parent-based
- Payment Gateways: Replaced Razorpay with Cashfree
- Child Count Management: Enhanced child count validation and limits
- Play Store Integration: Improved Android subscription handling
- Therapist Wallet: New withdraw transaction tab for better withdrawal tracking
- New Services: Slack integration, OTA updates, Digital Ocean enhancements
- Bug Fixes: Numerous bug fixes across the application
- Performance: Various performance improvements
- Security: Enhanced security measures
- Documentation: Comprehensive documentation updates
Statistics
- 496 files changed
- ~40,550 lines added
- ~15,434 lines removed
- Major migration: 1,078 lines of SQL
- New services: 3+ new services
- New features: 10+ major features
- Bug fixes: 50+ bug fixes
🎯 Next Steps
- Review Changes: Review all changes in detail
- Test Thoroughly: Test all new features and changes
- Update Documentation: Keep documentation up to date
- Monitor Performance: Monitor application performance
- Gather Feedback: Collect user feedback on changes
Last Updated: Based on comparison between develop (Phase 2) and v3 (Phase 3) branches