import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_core/core.dart';
import 'domain/repositories/payments_repository.dart';
import 'domain/usecases/get_payment_summary_usecase.dart';
import 'domain/usecases/get_payment_history_usecase.dart';
import 'data/repositories/payments_repository_impl.dart';
import 'presentation/blocs/payments/payments_bloc.dart';
import 'presentation/pages/payments_page.dart';

class StaffPaymentsModule extends Module {
  @override
  void binds(Injector i) {
    // Repositories
    i.add<PaymentsRepository>(PaymentsRepositoryImpl.new);

    // Use Cases
    i.add(GetPaymentSummaryUseCase.new);
    i.add(GetPaymentHistoryUseCase.new);

    // Blocs
    i.add(PaymentsBloc.new);
  }

  @override
  void routes(RouteManager r) {
    r.child(
      StaffPaths.childRoute(StaffPaths.payments, StaffPaths.payments),
      child: (BuildContext context) => const PaymentsPage(),
    );
  }
}
