From c1075c174c15b4e73a7806e94f6a729b9fd43141 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 16 Apr 2024 07:43:08 +1000 Subject: [PATCH] Bank Transactions updates for auto sync dates --- app/Jobs/Bank/ProcessBankTransactionsYodlee.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Jobs/Bank/ProcessBankTransactionsYodlee.php b/app/Jobs/Bank/ProcessBankTransactionsYodlee.php index b14afe5a27d1..3b651fc9a0d4 100644 --- a/app/Jobs/Bank/ProcessBankTransactionsYodlee.php +++ b/app/Jobs/Bank/ProcessBankTransactionsYodlee.php @@ -26,6 +26,7 @@ use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\Middleware\WithoutOverlapping; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Carbon; class ProcessBankTransactionsYodlee implements ShouldQueue { @@ -71,8 +72,8 @@ class ProcessBankTransactionsYodlee implements ShouldQueue set_time_limit(0); - //Loop through everything until we are up to date - $this->from_date = $this->from_date ?: '2021-01-01'; + //Loop through everything until we are up to date - improve handling of delayed accounts + $this->from_date = $this->from_date ? Carbon::parse($this->from_date)->subWeeks(2)->format('Y-m-d') : '2021-01-01'; nlog("Yodlee: Processing transactions for account: {$this->bank_integration->account->key}");