class BudgetReAppropriationService {

    public List<BudgetReAppropriation> fetchRelated(final List<BudgetReAppropriation> budgetreappropriations) {
        if (budgetreappropriations != null)
            for (final BudgetReAppropriation budgetReAppropriation : budgetreappropriations)
                // fetch related items
                if (budgetReAppropriation.getBudgetDetail() != null
                        && budgetReAppropriation.getBudgetDetail().getId() != null
                        && budgetReAppropriation.getBudgetDetail().getTenantId() != null) {
                    final BudgetDetail budgetDetail = budgetDetailRepository
                            .findById(budgetReAppropriation.getBudgetDetail());
                    if (budgetDetail == null)
                        throw new InvalidDataException("budgetDetail", "budgetDetail.invalid", " Invalid budgetDetail");
                    budgetReAppropriation.setBudgetDetail(budgetDetail);
                }

        return budgetreappropriations;
    }

    @Autowired public  BudgetReAppropriationService(final BudgetReAppropriationRepository budgetReAppropriationRepository,
            final SmartValidator validator, final BudgetDetailRepository budgetDetailRepository);

}