import 'package:flutter/foundation.dart';
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:lanebow/models/subscription_model.dart';
import 'package:lanebow/services/in_app_purchase_service.dart';

// InAppPurchaseService를 모킹한 클래스 (initialize 메서드 추가)
class MockInAppPurchaseServiceWithInitialize implements InAppPurchaseService {
  // 초기화 메서드 (실제 InAppPurchaseService에는 private이지만 테스트용으로 public 구현)
  Future<bool> initialize() async {
    return true;
  }
  
  // 구독 구매 메서드 (실제 서비스와 동일한 시그니처)
  @override
  Future<bool> purchaseSubscription(SubscriptionPlanType planType) async {
    return true;
  }
  
  // 구매 복원 메서드
  @override
  Future<bool> restorePurchases() async {
    return true;
  }
  
  // ChangeNotifier 구현
  @override
  void dispose() {}
  
  @override
  void addListener(VoidCallback listener) {}
  
  @override
  void notifyListeners() {}
  
  @override
  void removeListener(VoidCallback listener) {}
  
  @override
  bool get hasListeners => false;
  
  @override
  bool get isLoading => false;
  
  @override
  List<ProductDetails> get products => [];
  
  @override
  List<PurchaseDetails> get purchases => [];
  
  // InAppPurchaseService 구현
  @override
  String? get error => null;
  
  @override
  bool get isAvailable => true;
  
  bool _isPurchaseVerified = true;
  PurchaseDetails? _lastVerifiedPurchase;
  
  @override
  bool get isPurchaseVerified => _isPurchaseVerified;
  
  @override
  set isPurchaseVerified(bool value) {
    _isPurchaseVerified = value;
  }
  
  @override
  PurchaseDetails? get lastVerifiedPurchase => _lastVerifiedPurchase;
  
  @override
  set lastVerifiedPurchase(PurchaseDetails? value) {
    _lastVerifiedPurchase = value;
  }
  
  @override
  ProductDetails? getProductByPlanType(SubscriptionPlanType planType) => null;
  
  Future<bool> cancelSubscription() async => true;
  
  Future<bool> changePlan(SubscriptionPlanType newPlanType) async => true;
  
  Future<bool> changeAutoRenewalSetting(bool enableAutoRenewal) async => true;
  
  Future<bool> verifyPurchase(PurchaseDetails purchaseDetails) async => true;
}
