Skip to main content

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_id instead of child_id
  • Only one active subscription per parent (enforced by unique constraint)
  • child_subscription table restructured:
    • Removed child_id column
    • Added parent_id column
    • Added unique index: ux_child_subscription_one_in_use on parent_id where in_use = true

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_provider table introduced:
    • APP_STORE (iOS subscriptions)
    • PLAY_STORE (Android subscriptions)
    • NONE (Free plan)
  • subscription_products table now includes provider column

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_gateway table with values:
    • CASHFREE
  • appointment table now includes payment_gateway column
  • New cashfree_customer_id column in users table
  • New CashfreePgProvider service 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_count column in subscription_plans table:
    • FREE plan: 3 children
    • OTHER plans: 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: CANCELLED added to subscription_change_status
  • Enhanced tracking:
    • old_transaction_id column
    • new_transaction_id column
  • 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-updates merged 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-build merged 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

  1. OTA Updates: Over-the-air update support
  2. Improved UI/UX: Better user experience
  3. Performance Improvements: Faster app performance
  4. 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

  1. Android Crashes: Fixed various Android-specific crashes
  2. Subscription UI: Improved subscription management UI
  3. Payment Flow: Enhanced payment processing
  4. Child Management: Better child management interface
  5. Wallet Management: Improved wallet transaction tracking and display

🔄 Migration Guide

  1. Environment Variables:

    # New Cashfree variables
    CASHFREE_PAYMENT_CLIENT_ID=your_client_id
    CASHFREE_PAYMENT_CLIENT_SECRET=your_client_secret

📝 Summary

Key Takeaways

  1. Subscription Model: Changed from child-based to parent-based
  2. Payment Gateways: Replaced Razorpay with Cashfree
  3. Child Count Management: Enhanced child count validation and limits
  4. Play Store Integration: Improved Android subscription handling
  5. Therapist Wallet: New withdraw transaction tab for better withdrawal tracking
  6. New Services: Slack integration, OTA updates, Digital Ocean enhancements
  7. Bug Fixes: Numerous bug fixes across the application
  8. Performance: Various performance improvements
  9. Security: Enhanced security measures
  10. 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

  1. Review Changes: Review all changes in detail
  2. Test Thoroughly: Test all new features and changes
  3. Update Documentation: Keep documentation up to date
  4. Monitor Performance: Monitor application performance
  5. Gather Feedback: Collect user feedback on changes

Last Updated: Based on comparison between develop (Phase 2) and v3 (Phase 3) branches