SolidOS / money-pane

Insight in your personal finance data
MIT License
11 stars 1 forks source link

Deal with date skew #35

Closed michielbdejong closed 3 years ago

michielbdejong commented 3 years ago

There are multiple date types (for balance, for interest, for exchange rate, for entry), and they are reported in different ways and don't always match. There is not one date that can be used. Also, the time-of-day component is often missing (so we pretend the mutation took place at midnight GMT but that's not accurate, we should say we know it took place some time between midnight am on the day and midnight am the next day).

michielbdejong commented 3 years ago

Another (often more reliable) way to identify mutations is by looking at the log order. Example:

Alice reports:

Bob reports:

They both report the same ordered list of 3 transactions for January, so we can link them based on "previous" and "next". So then you can peg a skewed transaction to the last correct one. But then what happens if every transaction is skewed? And the start and end date/time would then also not be reliable.

michielbdejong commented 3 years ago

heuristic: If:

Then use the earliest date and merge.

michielbdejong commented 3 years ago

i'll start with implementing this in the forward direction

michielbdejong commented 3 years ago

and maybe only if to.date is 24 hours after from.date.