From df4737d0a51b13122a0da6d4265c4219f1843cae Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Sat, 27 Jun 2026 19:51:29 -0400 Subject: [PATCH] Fixed issue #47 - history timestamp not updating. --- finnow-api/source/account/data_impl_sqlite.d | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/finnow-api/source/account/data_impl_sqlite.d b/finnow-api/source/account/data_impl_sqlite.d index 1e46eed..119ee4c 100644 --- a/finnow-api/source/account/data_impl_sqlite.d +++ b/finnow-api/source/account/data_impl_sqlite.d @@ -202,12 +202,12 @@ SQL", private AccountHistoryValueRecordItemResponse fetchValueRecordHistoryItem(in BaseHistoryItem item) { return util.sqlite.findOne( db, - "SELECT vr.id, vr.type, vr.value, vr.currency FROM history_item_linked_value_record h " ~ + "SELECT vr.id, vr.type, vr.value, vr.currency, vr.timestamp FROM history_item_linked_value_record h " ~ "LEFT JOIN account_value_record vr ON vr.id = h.value_record_id " ~ "WHERE h.item_id = ?", (row) { auto obj = new AccountHistoryValueRecordItemResponse(); - obj.timestamp = item.timestamp; + obj.timestamp = row.peek!string(4); obj.type = item.type; obj.valueRecordId = row.peek!ulong(0); obj.valueRecordType = row.peek!string(1); @@ -222,13 +222,14 @@ SQL", private AccountHistoryJournalEntryItemResponse fetchJournalEntryHistoryItem(in BaseHistoryItem item) { return util.sqlite.findOne( db, - "SELECT je.type, je.amount, je.currency, tx.id, tx.description FROM history_item_linked_journal_entry h " ~ + "SELECT je.type, je.amount, je.currency, tx.id, tx.description, tx.timestamp " ~ + "FROM history_item_linked_journal_entry h " ~ "LEFT JOIN account_journal_entry je ON je.id = h.journal_entry_id " ~ "LEFT JOIN \"transaction\" tx ON tx.id = je.transaction_id " ~ "WHERE h.item_id = ?", (row) { auto obj = new AccountHistoryJournalEntryItemResponse(); - obj.timestamp = item.timestamp; + obj.timestamp = row.peek!string(5); obj.type = item.type; obj.journalEntryType = row.peek!string(0); obj.amount = row.peek!ulong(1);