Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
42 lines
No EOL
1.2 KiB
Dart
42 lines
No EOL
1.2 KiB
Dart
import 'package:injectable/injectable.dart';
|
|
import 'package:mnemo_cards_backend/database/database.dart';
|
|
import 'package:mnemo_cards_common_backend/mnemo_cards_common_backend.dart';
|
|
import 'package:mnemo_cards_common/mnemo_cards_common.dart';
|
|
|
|
@lazySingleton
|
|
class SubscriptionManager {
|
|
final AppDatabase _db;
|
|
|
|
SubscriptionManager(this._db);
|
|
|
|
Future<SubscriptionDto> getSubscriptionDto(UserModel user) async {
|
|
// TODO: Implement with Drift
|
|
return SubscriptionDto(
|
|
page: null,
|
|
isActive: false,
|
|
start: null,
|
|
finish: null,
|
|
);
|
|
}
|
|
|
|
Future<SubscriptionPlanModel?> getSubscriptionPlan(String id) async {
|
|
final intId = int.tryParse(id);
|
|
if (intId == null) return null;
|
|
|
|
final plan = await _db.subscriptionDao.getPlanById(intId);
|
|
if (plan == null) return null;
|
|
|
|
// TODO: Convert SubscriptionPlan (Drift) to SubscriptionPlanModel (Isar)
|
|
return null; // Temporary return null
|
|
}
|
|
|
|
Future<void> createSubscription(UserModel user, SubscriptionPlanModel plan) async {
|
|
// TODO: Implement with Drift
|
|
throw UnimplementedError('SubscriptionManager.createSubscription not implemented');
|
|
}
|
|
|
|
Future<List<SubscriptionPlanModel>> getAllPlans() async {
|
|
// TODO: Implement with Drift
|
|
return [];
|
|
}
|
|
} |