import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_core/core.dart';
import 'package:krow_data_connect/krow_data_connect.dart';
import 'package:staff_availability/src/presentation/pages/availability_page.dart';

import 'data/repositories_impl/availability_repository_impl.dart';
import 'domain/repositories/availability_repository.dart';
import 'domain/usecases/apply_quick_set_usecase.dart';
import 'domain/usecases/get_weekly_availability_usecase.dart';
import 'domain/usecases/update_day_availability_usecase.dart';
import 'presentation/blocs/availability_bloc.dart';

class StaffAvailabilityModule extends Module {
  @override
  List<Module> get imports => [DataConnectModule()];

  @override
  void binds(Injector i) {
    // Repository
    i.add<AvailabilityRepository>(AvailabilityRepositoryImpl.new);

    // UseCases
    i.add(GetWeeklyAvailabilityUseCase.new);
    i.add(UpdateDayAvailabilityUseCase.new);
    i.add(ApplyQuickSetUseCase.new);

    // BLoC
    i.add(AvailabilityBloc.new);
  }

  @override
  void routes(RouteManager r) {
    r.child(
      StaffPaths.childRoute(StaffPaths.availability, StaffPaths.availability),
      child: (_) => const AvailabilityPage(),
    );
  }
}
