import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_data_connect/krow_data_connect.dart';
import 'data/repositories/clock_in_repository_impl.dart';
import 'domain/repositories/clock_in_repository_interface.dart';
import 'domain/usecases/clock_in_usecase.dart';
import 'domain/usecases/clock_out_usecase.dart';
import 'domain/usecases/get_activity_log_usecase.dart';
import 'domain/usecases/get_attendance_status_usecase.dart';
import 'domain/usecases/get_todays_shift_usecase.dart';
import 'presentation/bloc/clock_in_bloc.dart';
import 'presentation/pages/clock_in_page.dart';

class StaffClockInModule extends Module {
  @override
  void binds(Injector i) {
    // Data Sources (Mocks from data_connect)
    i.add<ShiftsRepositoryMock>(ShiftsRepositoryMock.new);

    // Repositories
    i.add<ClockInRepositoryInterface>(ClockInRepositoryImpl.new);

    // Use Cases
    i.add<GetTodaysShiftUseCase>(GetTodaysShiftUseCase.new);
    i.add<GetAttendanceStatusUseCase>(GetAttendanceStatusUseCase.new);
    i.add<ClockInUseCase>(ClockInUseCase.new);
    i.add<ClockOutUseCase>(ClockOutUseCase.new);
    i.add<GetActivityLogUseCase>(GetActivityLogUseCase.new);

    // BLoC
    i.add<ClockInBloc>(ClockInBloc.new);
  }

  @override
  void routes(r) {
    r.child('/', child: (context) => const ClockInPage());
  }
}
