Fix: Update last_update query to use correct timestamp field for employee sync

This commit is contained in:
2026-02-28 09:10:55 -05:00
parent cc6fd07435
commit 9e399b934b

View File

@@ -56,7 +56,7 @@ class EmployeeSyncService
if full_sync if full_sync
service.query("SELECT * FROM Employee STARTPOSITION #{start_position} MAXRESULTS #{PAGE_SIZE}") service.query("SELECT * FROM Employee STARTPOSITION #{start_position} MAXRESULTS #{PAGE_SIZE}")
else else
last_update = Employee.maximum(:qbo_updated_at) || 1.year.ago last_update = Employee.maximum(:updated_at) || 1.year.ago
service.query(<<~SQL.squish) service.query(<<~SQL.squish)
SELECT * FROM Employee SELECT * FROM Employee
WHERE MetaData.LastUpdatedTime > '#{last_update.utc.iso8601}' WHERE MetaData.LastUpdatedTime > '#{last_update.utc.iso8601}'