mirror of
https://github.com/we-promise/sure
synced 2026-04-25 17:15:07 +02:00
Refactor transaction merging logic to prefer accurate posted dates and improve deduplication (#449)
- Updated `date_utils.rb` to return `nil` for timestamps equal to 0. - Enhanced `SimplefinItem::Importer` to merge transactions by prioritizing non-pending records with valid posted timestamps. - Introduced a comparator and key-builder for resolving transaction conflicts systematically. Co-authored-by: Josh Waldrep <joshua.waldrep5+github@gmail.com>
This commit is contained in:
@@ -15,6 +15,7 @@ module Simplefin
|
||||
when Time, DateTime
|
||||
val.to_date
|
||||
when Integer, Float
|
||||
return nil if val.to_i == 0
|
||||
Time.at(val).utc.to_date
|
||||
when String
|
||||
Date.parse(val)
|
||||
|
||||
Reference in New Issue
Block a user