mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Import statements and update configuration.
This commit is contained in:
@@ -45,6 +45,7 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Override;
|
||||
|
||||
/**
|
||||
* Class AccountRepository.
|
||||
@@ -162,7 +163,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac
|
||||
return $account;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getAccountBalances(Account $account): Collection
|
||||
{
|
||||
return $account->accountBalances;
|
||||
@@ -533,7 +534,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac
|
||||
return null;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function periodCollection(Account $account, Carbon $start, Carbon $end): array
|
||||
{
|
||||
return $account->transactions()
|
||||
|
||||
@@ -35,6 +35,8 @@ use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use League\Flysystem\UnableToDeleteFile;
|
||||
use Exception;
|
||||
use LogicException;
|
||||
|
||||
/**
|
||||
* Class AttachmentRepository.
|
||||
@@ -44,7 +46,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface, UserGroupIn
|
||||
use UserGroupTrait;
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function destroy(Attachment $attachment): bool
|
||||
{
|
||||
@@ -158,7 +160,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface, UserGroupIn
|
||||
if (null !== $dbNote) {
|
||||
try {
|
||||
$dbNote->delete();
|
||||
} catch (\LogicException $e) {
|
||||
} catch (LogicException $e) {
|
||||
app('log')->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Override;
|
||||
|
||||
/**
|
||||
* Class BudgetLimitRepository
|
||||
@@ -254,7 +255,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
||||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getNoteText(BudgetLimit $budgetLimit): string
|
||||
{
|
||||
return (string) $budgetLimit->notes()->first()?->text;
|
||||
@@ -323,7 +324,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
||||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function setNoteText(BudgetLimit $budgetLimit, string $text): void
|
||||
{
|
||||
$dbNote = $budgetLimit->notes()->first();
|
||||
|
||||
@@ -39,6 +39,7 @@ use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class CategoryRepository.
|
||||
@@ -271,7 +272,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function lastUseDate(Category $category, Collection $accounts): ?Carbon
|
||||
{
|
||||
@@ -314,7 +315,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
private function getLastTransactionDate(Category $category, Collection $accounts): ?Carbon
|
||||
{
|
||||
@@ -347,7 +348,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update(Category $category, array $data): Category
|
||||
{
|
||||
|
||||
@@ -42,6 +42,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Override;
|
||||
|
||||
/**
|
||||
* Class CurrencyRepository.
|
||||
@@ -277,7 +278,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
|
||||
return $result;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function find(int $currencyId): ?TransactionCurrency
|
||||
{
|
||||
return TransactionCurrency::find($currencyId);
|
||||
|
||||
@@ -31,24 +31,25 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Override;
|
||||
|
||||
class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGroupInterface
|
||||
{
|
||||
use UserGroupTrait;
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function deleteRate(CurrencyExchangeRate $rate): void
|
||||
{
|
||||
$this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getAll(): Collection
|
||||
{
|
||||
return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
||||
{
|
||||
// orderBy('date', 'DESC')->toRawSql();
|
||||
@@ -71,7 +72,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
||||
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getSpecificRateOnDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): ?CurrencyExchangeRate
|
||||
{
|
||||
/** @var null|CurrencyExchangeRate */
|
||||
@@ -84,7 +85,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
||||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function storeExchangeRate(TransactionCurrency $from, TransactionCurrency $to, string $rate, Carbon $date): CurrencyExchangeRate
|
||||
{
|
||||
$object = new CurrencyExchangeRate();
|
||||
@@ -100,7 +101,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
||||
return $object;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function updateExchangeRate(CurrencyExchangeRate $object, string $rate, ?Carbon $date = null): CurrencyExchangeRate
|
||||
{
|
||||
$object->rate = $rate;
|
||||
|
||||
@@ -32,6 +32,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* Class JournalCLIRepository
|
||||
@@ -184,7 +185,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface, UserGroupIn
|
||||
$result = $query->get(['transaction_journals.id as id', DB::raw('count(transactions.id) as transaction_count')]); // @phpstan-ignore-line
|
||||
$journalIds = [];
|
||||
|
||||
/** @var \stdClass $row */
|
||||
/** @var stdClass $row */
|
||||
foreach ($result as $row) {
|
||||
if ((int) $row->transaction_count > 2) {
|
||||
$journalIds[] = (int) $row->id;
|
||||
|
||||
@@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionJournalLink;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Support\Collection;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class LinkTypeRepository.
|
||||
@@ -71,7 +72,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function destroyLink(TransactionJournalLink $link): bool
|
||||
{
|
||||
@@ -170,7 +171,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf
|
||||
/**
|
||||
* Store link between two journals.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function storeLink(array $information, TransactionJournal $inward, TransactionJournal $outward): ?TransactionJournalLink
|
||||
{
|
||||
@@ -237,7 +238,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
private function setNoteText(TransactionJournalLink $link, string $text): void
|
||||
{
|
||||
@@ -279,7 +280,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf
|
||||
/**
|
||||
* Update an existing transaction journal link.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function updateLink(TransactionJournalLink $journalLink, array $data): TransactionJournalLink
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@ use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups;
|
||||
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Trait ModifiesPiggyBanks
|
||||
@@ -142,7 +143,7 @@ trait ModifiesPiggyBanks
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function destroy(PiggyBank $piggyBank): bool
|
||||
{
|
||||
|
||||
@@ -41,6 +41,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Override;
|
||||
|
||||
/**
|
||||
* Class PiggyBankRepository.
|
||||
@@ -390,7 +391,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte
|
||||
return $balance;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function purgeAll(): void
|
||||
{
|
||||
PiggyBank::withTrashed()
|
||||
@@ -407,7 +408,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte
|
||||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function resetOrder(): void
|
||||
{
|
||||
$factory = new PiggyBankFactory();
|
||||
|
||||
@@ -33,6 +33,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use FireflyIII\Support\Search\OperatorQuerySearch;
|
||||
use Illuminate\Support\Collection;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class RuleRepository.
|
||||
@@ -42,7 +43,7 @@ class RuleRepository implements RuleRepositoryInterface, UserGroupInterface
|
||||
use UserGroupTrait;
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function destroy(Rule $rule): bool
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class RuleGroupRepository.
|
||||
@@ -72,7 +73,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface, UserGroupInte
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function destroy(RuleGroup $ruleGroup, ?RuleGroup $moveTo): bool
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@ use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class TagRepository.
|
||||
@@ -51,7 +52,7 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function destroy(Tag $tag): bool
|
||||
{
|
||||
|
||||
@@ -48,6 +48,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class TransactionGroupRepository
|
||||
@@ -291,7 +292,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface,
|
||||
/**
|
||||
* Return object with all found meta field things as Carbon objects.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getMetaDateFields(int $journalId, array $fields): NullArrayObject
|
||||
{
|
||||
|
||||
@@ -34,6 +34,8 @@ use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
use Exception;
|
||||
use Override;
|
||||
|
||||
/**
|
||||
* Class UserRepository.
|
||||
@@ -44,7 +46,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
* This updates the users email address and records some things so it can be confirmed or undone later.
|
||||
* The user is blocked until the change is confirmed.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*
|
||||
* @see updateEmail
|
||||
*/
|
||||
@@ -99,7 +101,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function destroy(User $user): bool
|
||||
{
|
||||
@@ -243,7 +245,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getUserGroups(User $user): Collection
|
||||
{
|
||||
$memberships = $user->groupMemberships()->get();
|
||||
|
||||
@@ -35,6 +35,8 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Override;
|
||||
use ValueError;
|
||||
|
||||
/**
|
||||
* Class UserGroupRepository
|
||||
@@ -176,13 +178,13 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
|
||||
return UserGroup::all();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getById(int $id): ?UserGroup
|
||||
{
|
||||
return UserGroup::find($id);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getMembershipsFromGroupId(int $groupId): Collection
|
||||
{
|
||||
return $this->user->groupMemberships()->where('user_group_id', $groupId)->get();
|
||||
@@ -286,7 +288,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
|
||||
foreach ($rolesSimplified as $role) {
|
||||
try {
|
||||
$enum = UserRoleEnum::from($role);
|
||||
} catch (\ValueError) {
|
||||
} catch (ValueError) {
|
||||
// TODO error message
|
||||
continue;
|
||||
}
|
||||
@@ -313,7 +315,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
|
||||
return $roles;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function useUserGroup(UserGroup $userGroup): void
|
||||
{
|
||||
$this->user->user_group_id = $userGroup->id;
|
||||
|
||||
@@ -37,6 +37,8 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Override;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* Class AccountRepository
|
||||
@@ -47,7 +49,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
use UserGroupTrait;
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function countAccounts(array $types): int
|
||||
{
|
||||
$query = $this->userGroup->accounts();
|
||||
@@ -120,7 +122,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return $account;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getAccountBalances(Account $account): Collection
|
||||
{
|
||||
return $account->accountBalances;
|
||||
@@ -172,7 +174,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return $account;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getAccountTypes(Collection $accounts): Collection
|
||||
{
|
||||
return AccountType::leftJoin('accounts', 'accounts.account_type_id', '=', 'account_types.id')
|
||||
@@ -195,7 +197,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return $query->get(['accounts.*']);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getAccountsInOrder(array $types, array $sort, int $startRow, int $endRow): Collection
|
||||
{
|
||||
$query = $this->userGroup->accounts();
|
||||
@@ -235,7 +237,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return $query->get(['accounts.*']);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getLastActivity(Collection $accounts): array
|
||||
{
|
||||
return Transaction::whereIn('account_id', $accounts->pluck('id')->toArray())
|
||||
@@ -245,7 +247,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getMetaValues(Collection $accounts, array $fields): Collection
|
||||
{
|
||||
$query = AccountMeta::whereIn('account_id', $accounts->pluck('id')->toArray());
|
||||
@@ -256,7 +258,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return $query->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data']);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getObjectGroups(Collection $accounts): array
|
||||
{
|
||||
$groupIds = [];
|
||||
@@ -265,14 +267,14 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
->whereIn('object_groupable_id', $accounts->pluck('id')->toArray())->get()
|
||||
;
|
||||
|
||||
/** @var \stdClass $row */
|
||||
/** @var stdClass $row */
|
||||
foreach ($set as $row) {
|
||||
$groupIds[] = $row->object_group_id;
|
||||
}
|
||||
$groupIds = array_unique($groupIds);
|
||||
$groups = ObjectGroup::whereIn('id', $groupIds)->get();
|
||||
|
||||
/** @var \stdClass $row */
|
||||
/** @var stdClass $row */
|
||||
foreach ($set as $row) {
|
||||
if (!array_key_exists($row->object_groupable_id, $return)) {
|
||||
/** @var null|ObjectGroup $group */
|
||||
@@ -368,7 +370,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
return $query->get(['accounts.*']);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function update(Account $account, array $data): Account
|
||||
{
|
||||
/** @var AccountUpdateService $service */
|
||||
|
||||
@@ -30,6 +30,7 @@ use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Override;
|
||||
|
||||
/**
|
||||
* Class ExchangeRateRepository
|
||||
@@ -40,19 +41,19 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
{
|
||||
use UserGroupTrait;
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function deleteRate(CurrencyExchangeRate $rate): void
|
||||
{
|
||||
$this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getAll(): Collection
|
||||
{
|
||||
return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
||||
{
|
||||
// orderBy('date', 'DESC')->toRawSql();
|
||||
@@ -75,7 +76,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function getSpecificRateOnDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): ?CurrencyExchangeRate
|
||||
{
|
||||
/** @var null|CurrencyExchangeRate */
|
||||
@@ -88,7 +89,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function storeExchangeRate(TransactionCurrency $from, TransactionCurrency $to, string $rate, Carbon $date): CurrencyExchangeRate
|
||||
{
|
||||
$object = new CurrencyExchangeRate();
|
||||
@@ -104,7 +105,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
return $object;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
#[Override]
|
||||
public function updateExchangeRate(CurrencyExchangeRate $object, string $rate, ?Carbon $date = null): CurrencyExchangeRate
|
||||
{
|
||||
$object->rate = $rate;
|
||||
|
||||
Reference in New Issue
Block a user