import 'package:get/get.dart';
import 'package:logger/logger.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/profile/officer_profile_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/profile/profile_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/settings/display_mode_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/settings/email_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/settings/language_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/settings/notifications_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/settings/privacy_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/settings/security_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/settings/settings_controller.dart';
import 'package:sigap/src/features/personalization/presentasion/controllers/settings/text_size_controller.dart';

class PersonalizationBindings extends Bindings {
  @override
  void dependencies() {
    // Register Logger if not already registered
    if (!Get.isRegistered<Logger>()) {
      Get.lazyPut<Logger>(() => Logger(), fenix: true);
    }

    // Register profile controllers
    _registerProfileControllers();

    // Register settings controllers
    _registerSettingsControllers();
  }

  void _registerProfileControllers() {
    // Register profile-related controllers
    Get.lazyPut<ProfileController>(() => ProfileController(), fenix: true);

    Get.lazyPut<OfficerController>(() => OfficerController(),
      fenix: true,
    );
  }

  void _registerSettingsControllers() {
    // Register main settings controller
    Get.lazyPut<SettingsController>(() => SettingsController(), fenix: true);

    // Register individual settings feature controllers
    Get.lazyPut<DisplayModeController>(
      () => DisplayModeController(),
      fenix: true,
    );

    Get.lazyPut<LanguageController>(() => LanguageController(), fenix: true);

    Get.lazyPut<NotificationsController>(
      () => NotificationsController(),
      fenix: true,
    );

    Get.lazyPut<PrivacyController>(() => PrivacyController(), fenix: true);

    Get.lazyPut<SecurityController>(() => SecurityController(), fenix: true);

    Get.lazyPut<EmailController>(() => EmailController(), fenix: true);

    Get.lazyPut<TextSizeController>(() => TextSizeController(), fenix: true);
  }
}
