mirror of
https://github.com/we-promise/sure.git
synced 2026-08-05 16:42:18 +00:00
Fix transactions posting a day early when booked around midnight. (#2744)
* Fix 2668 * Fix CodeRabbit nitpick * Fix Akahu parsing * Anchor provider transaction date parsing to family timezone * Coderabbit suggestion for Date/DateTime order * Remove duplicate condition in wise * Safe unless column_exists + pass family to date parse to family components
This commit is contained in:
@@ -430,4 +430,25 @@ class EnableBankingEntry::ProcessorTest < ActiveSupport::TestCase
|
||||
|
||||
assert_nil processor.send(:merchant)
|
||||
end
|
||||
|
||||
test "converts unix timestamp date using family timezone not UTC" do
|
||||
# 2025-07-14 23:30:00 UTC == 2025-07-15 01:30:00 CEST
|
||||
@family.update!(timezone: "Europe/Berlin")
|
||||
|
||||
tx = {
|
||||
entry_reference: "tz_ref",
|
||||
transaction_id: nil,
|
||||
booking_date: 1752535800, # 2025-07-14 23:30:00 UTC
|
||||
transaction_amount: { amount: "10.00", currency: "EUR" },
|
||||
creditor: { name: "Late Night Shop" },
|
||||
credit_debit_indicator: "DBIT",
|
||||
remittance_information: [ "After midnight" ],
|
||||
status: "BOOK"
|
||||
}
|
||||
|
||||
result = EnableBankingEntry::Processor.new(tx, enable_banking_account: @enable_banking_account).process
|
||||
|
||||
assert_not_nil result
|
||||
assert_equal Date.new(2025, 7, 15), result.date
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user