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_shift_details_usecase.dart';
import 'domain/usecases/accept_shift_usecase.dart';
import 'domain/usecases/decline_shift_usecase.dart';
import 'domain/usecases/apply_for_shift_usecase.dart';
import 'presentation/blocs/shift_details/shift_details_bloc.dart';
import 'presentation/pages/shift_details_page.dart';

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

    // UseCases
    i.add(GetShiftDetailsUseCase.new);
    i.add(AcceptShiftUseCase.new);
    i.add(DeclineShiftUseCase.new);
    i.add(ApplyForShiftUseCase.new);

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

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