import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../data/referral_repository.dart';
import '../../domain/models/referral_info.dart';

/// My referral info + code
final referralInfoProvider = FutureProvider<ReferralInfo>((ref) async {
  return ref.watch(referralRepositoryProvider).getMyReferralInfo();
});

/// My direct referrals (first page)
final referralListProvider =
    FutureProvider<({List<ReferralItem> items, int total})>((ref) async {
  return ref.watch(referralRepositoryProvider).getMyReferrals();
});

/// Pending rewards
final pendingRewardsProvider =
    FutureProvider<({List<RewardItem> items, int total})>((ref) async {
  return ref.watch(referralRepositoryProvider).getMyRewards(status: 'PENDING');
});

/// All rewards (for history tab)
final allRewardsProvider =
    FutureProvider<({List<RewardItem> items, int total})>((ref) async {
  return ref.watch(referralRepositoryProvider).getMyRewards();
});
