1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

Multi-step account forms + clearer balance editing (#2427)
Some checks failed
Publish Docker image / ci (push) Has been cancelled
Publish Docker image / Build docker image (push) Has been cancelled

* Initial multi-step property form

* Improve form structure, add optional tooltip help icons to form fields

* Add basic inline alert component

* Clean up and improve property form lifecycle

* Implement Account status concept

* Lint fixes

* Remove whitespace

* Balance editing, scope updates for account

* Passing tests

* Fix brakeman warning

* Remove stale columns

* data constraint tweaks

* Redundant property
This commit is contained in:
Zach Gollwitzer 2025-07-03 09:33:07 -04:00 committed by GitHub
parent ba7e8d3893
commit 662f2c04ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 1036 additions and 427 deletions

View file

@ -67,21 +67,21 @@ class EntryTest < ActiveSupport::TestCase
assert_equal 0, family.entries.search(params).size
end
test "active scope only returns entries from active accounts" do
test "visible scope only returns entries from visible accounts" do
# Create transactions for all account types
active_transaction = create_transaction(account: accounts(:depository), name: "Active transaction")
inactive_transaction = create_transaction(account: accounts(:credit_card), name: "Inactive transaction")
visible_transaction = create_transaction(account: accounts(:depository), name: "Visible transaction")
invisible_transaction = create_transaction(account: accounts(:credit_card), name: "Invisible transaction")
# Update account statuses
accounts(:credit_card).update!(is_active: false)
accounts(:credit_card).disable!
# Test the scope
active_entries = Entry.active
visible_entries = Entry.visible
# Should include entry from active account
assert_includes active_entries, active_transaction
assert_includes visible_entries, visible_transaction
# Should not include entry from inactive account
assert_not_includes active_entries, inactive_transaction
# Should not include entry from disabled account
assert_not_includes visible_entries, invisible_transaction
end
end

View file

@ -39,7 +39,7 @@ class BalanceSheetTest < ActiveSupport::TestCase
create_account(balance: 10000, accountable: Depository.new)
other_liability = create_account(balance: 5000, accountable: OtherLiability.new)
other_liability.update!(is_active: false)
other_liability.disable!
assert_equal 10000 - 1000, BalanceSheet.new(@family).net_worth
assert_equal 10000, BalanceSheet.new(@family).assets.total

View file

@ -89,7 +89,7 @@ class Family::AutoTransferMatchableTest < ActiveSupport::TestCase
end
test "does not consider inactive accounts when matching transfers" do
@depository.update!(is_active: false)
@depository.disable!
outflow = create_transaction(date: Date.current, account: @depository, amount: 500)
inflow = create_transaction(date: Date.current, account: @credit_card, amount: -500)