FinTS unfortunately has no unique id or timestamp for transactions (or banks don't return it). So, to detect new transactions, we tag every transaction with a sequence number which is unique per account and day (starting with 1 on every new day).
This works quite fine as long as the bank returns transaction always in the same order and new transaction are returned after known ones. This is quite optimistic, but apparently true for most banks. There is at least one bank (namely 1822direkt) which returns intra-day transaction in reversed order, i.e. new transactions are returned before already known ones. Example:
run: trans1
run: trans2, trans1
run: trans3, trans2, trans1
This results in trans1 to be considered a new transaction (and stored multiple times in the database) in every run.
A proper fix could be to calculate a transaction hash and to use it to identify known transactions. A transaction with the same properties could happen multiple times per day, so there must be extra logic, like tagging transactions retrieved from the database as "consumed" when a transaction with the same hash is returned from the bank, so a transaction with the same hash is considered new. The intradaynum field would be obsolete then and not used any more.
FinTS unfortunately has no unique id or timestamp for transactions (or banks don't return it). So, to detect new transactions, we tag every transaction with a sequence number which is unique per account and day (starting with 1 on every new day).
This works quite fine as long as the bank returns transaction always in the same order and new transaction are returned after known ones. This is quite optimistic, but apparently true for most banks. There is at least one bank (namely 1822direkt) which returns intra-day transaction in reversed order, i.e. new transactions are returned before already known ones. Example:
This results in trans1 to be considered a new transaction (and stored multiple times in the database) in every run.
A proper fix could be to calculate a transaction hash and to use it to identify known transactions. A transaction with the same properties could happen multiple times per day, so there must be extra logic, like tagging transactions retrieved from the database as "consumed" when a transaction with the same hash is returned from the bank, so a transaction with the same hash is considered new. The intradaynum field would be obsolete then and not used any more.