/// Use case: Récupérer les budgets
library get_budgets;

import 'package:dartz/dartz.dart';
import 'package:injectable/injectable.dart';
import '../../../../core/error/failures.dart';
import '../entities/budget.dart';
import '../repositories/finance_workflow_repository.dart';

@lazySingleton
class GetBudgets {
  final FinanceWorkflowRepository repository;

  GetBudgets(this.repository);

  Future<Either<Failure, List<Budget>>> call({
    String? organizationId,
    BudgetStatus? status,
    int? year,
  }) async {
    return await repository.getBudgets(
      organizationId: organizationId,
      status: status,
      year: year,
    );
  }
}
