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:
LPW
2025-12-13 03:13:02 -05:00
committed by GitHub
parent b73ac207e0
commit 101b9dac95
2 changed files with 60 additions and 5 deletions

View File

@@ -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)