mirror of
https://github.com/we-promise/sure.git
synced 2026-06-04 10:19:03 +00:00
fix(reset): scope family financial data resets (#1835)
Centralize family financial reset cleanup behind an explicitly scoped service, update reset status docs, and add two-family regression coverage for destructive reset behavior.
This commit is contained in:
@@ -70,14 +70,8 @@ class Api::V1::UsersController < Api::V1::BaseController
|
||||
end
|
||||
|
||||
def reset_target_counts(family)
|
||||
{
|
||||
accounts: family.accounts.count,
|
||||
categories: family.categories.count,
|
||||
tags: family.tags.count,
|
||||
merchants: family.merchants.count,
|
||||
plaid_items: family.plaid_items.count,
|
||||
imports: family.imports.count,
|
||||
budgets: family.budgets.count
|
||||
}
|
||||
counts = Family::FinancialDataReset.new(family: family, dry_run: true, confirmed: false).call.before_counts.except(:syncs)
|
||||
|
||||
counts.merge(plaid_items: family.plaid_items.count)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user