public async Task <List <Household> > SearchHouseholds(GetGrantDisbursementsParam param)
        {
            var householdQuery = _context.Household
                                 .Include(p => p.FamilyMembers)
                                 .WhereIf(!String.IsNullOrEmpty(param.HousingType), p => p.HousingType == (HousingTypeEnum)Enum.Parse(typeof(HousingTypeEnum), param.HousingType, true))
                                 .WhereIf(!String.IsNullOrEmpty(param.EmploymentStatus), p => p.FamilyMembers.Any(x => x.OccupationType == (OccupationTypeEnum)Enum.Parse(typeof(OccupationTypeEnum), param.EmploymentStatus, true)))
                                 .WhereIf(param.HouseholdSizeFrom != null, p => p.HouseholdSize >= param.HouseholdSizeFrom)
                                 .WhereIf(param.HouseholdSizeTo != null, p => p.HouseholdSize <= param.HouseholdSizeTo)
                                 .WhereIf(param.TotalAnnualIncomeFrom != null, p => p.TotalAnnualIncome >= param.TotalAnnualIncomeFrom)
                                 .WhereIf(param.TotalAnnualIncomeTo != null, p => p.TotalAnnualIncome <= param.TotalAnnualIncomeTo)
                                 .WhereIf(param.AgeFrom != null, p => p.MinAge >= param.AgeFrom)
                                 .WhereIf(param.AgeTo != null, p => p.MaxAge <= param.AgeTo)
                                 .Where(p => p.FamilyMembers.Count > 0);

            return(await householdQuery.ToListAsync());
        }
        public async Task <IEnumerable <GrantDisbursementSchemesDto> > GetGrantDisbursements(GetGrantDisbursementsParam param)
        {
            var households = await _householdBc.SearchHouseholds(param);

            var result          = new List <GrantDisbursementSchemesDto>();
            var grantStrategies = _grantStrategyFactory.GetGrantStrategies();

            foreach (IGrantStrategy g in grantStrategies)
            {
                var eligbleHouseholds = await g.GetGrantDisbursements(households);

                eligbleHouseholds.ToList().ForEach(p => result.Add(p));
            }

            return(result);
        }