Various code cleanup.

This commit is contained in:
James Cole
2025-02-16 19:45:31 +01:00
parent c371662c51
commit 4cb775cf4b
4 changed files with 3 additions and 217 deletions

View File

@@ -138,26 +138,6 @@ class AccountDestroyService
DB::table('recurrences_transactions')->where('destination_id', $account->id)->update(['destination_id' => $moveTo->id]);
}
private function destroyJournals(Account $account): void
{
/** @var JournalDestroyService $service */
$service = app(JournalDestroyService::class);
app('log')->debug('Now trigger account delete response #'.$account->id);
/** @var Transaction $transaction */
foreach ($account->transactions()->get() as $transaction) {
app('log')->debug('Now at transaction #'.$transaction->id);
/** @var null|TransactionJournal $journal */
$journal = $transaction->transactionJournal()->first();
if (null !== $journal) {
app('log')->debug('Call for deletion of journal #'.$journal->id);
$service->destroy($journal);
}
}
}
private function destroyRecurrences(Account $account): void
{
$recurrences = RecurrenceTransaction::where(