Providers sharing (#1273)

* third party provider scoping

* Simplify logic and allow only admins to mange providers

* Broadcast fixes

* FIX tests and build

* Fixes

* Reviews

* Scope merchants

* DRY fixes
This commit is contained in:
soky srm
2026-03-25 17:47:04 +01:00
committed by GitHub
parent 1627cf197b
commit 9410e5b38d
74 changed files with 588 additions and 583 deletions

View File

@@ -2,6 +2,7 @@
configured_with_token:
family: dylan_family
name: "Indexa Capital Connection"
api_token: "test_api_token_123"
status: good
@@ -9,6 +10,7 @@ configured_with_token:
configured_with_credentials:
family: empty
name: "Indexa Capital Credentials"
username: "testuser@example.com"
document: "12345678A"

View File

@@ -1,5 +1,6 @@
one:
family: dylan_family
name: "Test Lunchflow Connection"
api_key: "test_api_key_123"
status: good

View File

@@ -1,5 +1,6 @@
one:
family: dylan_family
name: "Test Mercury Connection"
token: "test_mercury_token_123"
base_url: "https://api-sandbox.mercury.com/api/v1"

View File

@@ -1,5 +1,6 @@
one:
family: dylan_family
plaid_id: "item_mock_1"
access_token: encrypted_token_1
name: "Test Bank"

View File

@@ -3,6 +3,7 @@
configured_item:
family: dylan_family
name: "SnapTrade Connection"
client_id: "test_client_id"
consumer_key: "test_consumer_key"
@@ -17,6 +18,7 @@ configured_item:
# but before connecting to SnapTrade portal)
pending_registration_item:
family: empty
name: "Pending Registration"
client_id: "pending_client_id"
consumer_key: "pending_consumer_key"

View File

@@ -267,6 +267,8 @@ class AccountTest < ActiveSupport::TestCase
end
test "auto_share_with_family creates shares for all non-owner members" do
@family.update!(default_account_sharing: "private")
account = Account.create_and_sync({
family: @family,
owner: @admin,

View File

@@ -536,6 +536,16 @@ class IncomeStatementTest < ActiveSupport::TestCase
assert_nil net.net_expense_categories.find { |ct| ct.category.id == @food_category.id }
end
test "empty account_ids returns no results for category stats" do
results = IncomeStatement::CategoryStats.new(@family, account_ids: []).call
assert_empty results
end
test "empty account_ids returns no results for family stats" do
results = IncomeStatement::FamilyStats.new(@family, account_ids: []).call
assert_empty results
end
test "returns zero totals when family has only tax-advantaged accounts" do
# Create a fresh family with ONLY tax-advantaged accounts
family_only_retirement = Family.create!(