class FundService {

	public List<Fund> fetchRelated(List<Fund> funds) {
		for (Fund fund : funds) {
			// fetch related items
            fund.setTenantId(ApplicationThreadLocals.getTenantId().get());
			if (fund.getTenantId() != null)
				if (fund.getParent() != null && fund.getParent().getId() != null) {
					fund.getParent().setTenantId(fund.getTenantId());
					Fund parentId = fundRepository.findById(fund.getParent());
					if (parentId == null) {
						throw new InvalidDataException("parentId", ErrorCode.INVALID_REF_VALUE.getCode(),
								fund.getParent().getId());
					}
					fund.setParent(parentId);
				}

		}

		return funds;
	}

}