import 'package:rasadyar_core/core.dart';

part 'app_model.g.dart';

@HiveType(typeId: appModelTypeId)
class AppModel extends HiveObject {
  @HiveField(0, defaultValue: true)
  bool? isFirstRun;

  @HiveField(1)
  bool? isDarkMode;

  @HiveField(2)
  Module? selectedModule;

  @HiveField(3)
  List<TargetPage>? targetPages;

  AppModel({this.isFirstRun, this.isDarkMode, this.selectedModule, this.targetPages});

  @override
  String toString() {
    return 'AppModel{isFirstRun: $isFirstRun, isDarkMode: $isDarkMode, selectedModule: $selectedModule, targetPages: $targetPages}';
  }
}

@HiveType(typeId: targetTypeId)
class TargetPage extends HiveObject {
  @HiveField(0)
  String? route;

  @HiveField(1)
  List<String>? functions;

  @HiveField(2)
  Module? module;

  @HiveField(3)
  String? selectedRole;

  TargetPage({required this.route, this.functions, this.module});

  @override
  String toString() {
    return 'TargetPage{route: $route, functions: $functions, module: $module}';
  }
}
