import 'package:flutter_modular/flutter_modular.dart';
import 'domain/repositories/shifts_repository_interface.dart';
import 'data/repositories_impl/shifts_repository_impl.dart';
import 'domain/usecases/get_my_shifts_usecase.dart';
import 'domain/usecases/get_available_shifts_usecase.dart';
import 'domain/usecases/get_pending_assignments_usecase.dart';
import 'presentation/blocs/shifts/shifts_bloc.dart';
import 'presentation/pages/shifts_page.dart';
import 'presentation/pages/shift_details_page.dart';

class StaffShiftsModule extends Module {
  @override
  void binds(Injector i) {
    // Repository
    i.add<ShiftsRepositoryInterface>(ShiftsRepositoryImpl.new);

    // UseCases
    i.add(GetMyShiftsUseCase.new);
    i.add(GetAvailableShiftsUseCase.new);
    i.add(GetPendingAssignmentsUseCase.new);

    // Bloc
    i.add(ShiftsBloc.new);
  }

  @override
  void routes(RouteManager r) {
    r.child('/', child: (_) => const ShiftsPage());
    r.child('/details/:id', child: (_) => ShiftDetailsPage(shiftId: r.args.params['id'], shift: r.args.data));
  }
}
