public async Task <decimal> CalculateAvailableMonthlyBudget(string clientId)
        {
            var budgetPreferences = await budgetPreferencesRepository.Get(clientId);

            var availableMonthlyBudget = CalculateEstimatedMonthlyIncome(budgetPreferences.Income);

            foreach (var variableCost in budgetPreferences.Costs)
            {
                availableMonthlyBudget -= variableCost.Value;
            }

            return(availableMonthlyBudget);
        }
Пример #2
0
 public async Task <ActionResult <BudgetPreferences> > Get(string clientId)
 {
     return(await budgetPreferencesRepository.Get(clientId));
 }