mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
fix: Fix Enable Banking sync date determination
This commit is contained in:
@@ -56,7 +56,7 @@ module Syncable
|
||||
end
|
||||
|
||||
def last_synced_at
|
||||
latest_sync&.completed_at
|
||||
latest_completed_sync&.completed_at
|
||||
end
|
||||
|
||||
def last_sync_created_at
|
||||
@@ -68,6 +68,10 @@ module Syncable
|
||||
syncs.ordered.first
|
||||
end
|
||||
|
||||
def latest_completed_sync
|
||||
syncs.completed.ordered.first
|
||||
end
|
||||
|
||||
def syncer
|
||||
self.class::Syncer.new(self)
|
||||
end
|
||||
|
||||
@@ -241,7 +241,7 @@ class EnableBankingItem::Importer
|
||||
if enable_banking_item.last_synced_at
|
||||
enable_banking_item.last_synced_at.to_date - 7.days
|
||||
else
|
||||
user_start_date || 90.days.ago.to_date
|
||||
30.days.ago.to_date
|
||||
end
|
||||
else
|
||||
# Initial sync: use user's configured date or default to 3 months
|
||||
|
||||
Reference in New Issue
Block a user