mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Transaction transfers, payments, and matching (#883)
* Add transfer model and clean up family snapshot fixtures * Ignore transfers in income and expense snapshots * Add transfer validations * Implement basic transfer matching UI * Fix merge conflicts * Add missing translations * Tweak selection states for transfer types * Add missing i18n translation
This commit is contained in:
parent
b462bc8f8c
commit
ca39b26070
57 changed files with 991 additions and 427 deletions
21
test/support/family_snapshot_test_helper.rb
Normal file
21
test/support/family_snapshot_test_helper.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
module FamilySnapshotTestHelper
|
||||
# See: https://docs.google.com/spreadsheets/d/18LN5N-VLq4b49Mq1fNwF7_eBiHSQB46qQduRtdAEN98/edit?usp=sharing
|
||||
def get_expected_balances_for(key)
|
||||
expected_results_file.map do |row|
|
||||
{
|
||||
date: (Date.current - row["date_offset"].to_i.days).to_date,
|
||||
balance: row[key.to_s].to_d
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def get_today_snapshot_value_for(metric)
|
||||
expected_results_file[-1][metric.to_s].to_d
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def expected_results_file
|
||||
CSV.read("test/fixtures/files/expected_family_snapshots.csv", headers: true)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue