🤖 Auto commit for release 'develop' on 2025-08-15

This commit is contained in:
JC5
2025-08-15 13:37:27 +02:00
parent 4885dbc78e
commit f2dc0d234b
20 changed files with 293 additions and 269 deletions

View File

@@ -55,17 +55,20 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
// orderBy('date', 'DESC')->toRawSql();
return
$this->userGroup->currencyExchangeRates()
->where(function (Builder $q1) use ($from, $to): void {
$q1->where(function (Builder $q) use ($from, $to): void {
$q->where('from_currency_id', $from->id)
->where('to_currency_id', $to->id);
})->orWhere(function (Builder $q) use ($from, $to): void {
$q->where('from_currency_id', $to->id)
->where('to_currency_id', $from->id);
});
})
->orderBy('date', 'DESC')
->get(['currency_exchange_rates.*']);
->where(function (Builder $q1) use ($from, $to): void {
$q1->where(function (Builder $q) use ($from, $to): void {
$q->where('from_currency_id', $from->id)
->where('to_currency_id', $to->id)
;
})->orWhere(function (Builder $q) use ($from, $to): void {
$q->where('from_currency_id', $to->id)
->where('to_currency_id', $from->id)
;
});
})
->orderBy('date', 'DESC')
->get(['currency_exchange_rates.*'])
;
}
@@ -75,10 +78,11 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
/** @var null|CurrencyExchangeRate */
return
$this->userGroup->currencyExchangeRates()
->where('from_currency_id', $from->id)
->where('to_currency_id', $to->id)
->where('date', $date->format('Y-m-d'))
->first();
->where('from_currency_id', $from->id)
->where('to_currency_id', $to->id)
->where('date', $date->format('Y-m-d'))
->first()
;
}
#[Override]
@@ -112,8 +116,8 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
public function deleteRates(TransactionCurrency $from, TransactionCurrency $to): void
{
$this->userGroup->currencyExchangeRates()
->where('from_currency_id', $from->id)
->where('to_currency_id', $to->id)
->delete();
->where('from_currency_id', $from->id)
->where('to_currency_id', $to->id)
->delete();
}
}