Allow user to set multi-currency available budget. WIP

This commit is contained in:
James Cole
2019-09-01 10:48:18 +02:00
parent 509276e20b
commit 4cd52963a6
11 changed files with 236 additions and 56 deletions

View File

@@ -99,6 +99,22 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
}
}
/**
* @param Budget $budget
* @param TransactionCurrency $currency
* @param Carbon $start
* @param Carbon $end
*
* @return BudgetLimit|null
*/
public function find(Budget $budget, TransactionCurrency $currency, Carbon $start, Carbon $end): ?BudgetLimit
{
return $budget->budgetlimits()
->where('transaction_currency_id', $currency->id)
->where('start_date', $start->format('Y-m-d'))
->where('end_date', $end->format('Y-m-d'))->first();
}
/**
* @param Carbon $start
* @param Carbon $end