mirror of
https://github.com/we-promise/sure
synced 2026-04-25 17:15:07 +02:00
Add tests and refactor for Simplefin holdings import and processing
- Introduced tests for importer post-import logic and `SimplefinHoldingsApplyJob`. - Refactored `ProviderImportAdapter` to improve holding resolution strategy. - Added handling of investment and crypto holdings in importer with debounce logic for job enqueuing. - Updated rake task to use `SimplefinHoldingsApplyJob` for holding materialization.
This commit is contained in:
@@ -124,9 +124,9 @@ namespace :sure do
|
||||
if dry_run
|
||||
puts({ dry_run: true, sfa_id: sfa.id, account_id: account.id, name: sfa.name, would_process: count }.to_json)
|
||||
else
|
||||
SimplefinAccount::Investments::HoldingsProcessor.new(sfa).process
|
||||
SimplefinHoldingsApplyJob.perform_later(sfa.id)
|
||||
total_holdings_written += count
|
||||
puts({ ok: true, sfa_id: sfa.id, account_id: account.id, name: sfa.name, processed: count }.to_json)
|
||||
puts({ ok: true, sfa_id: sfa.id, account_id: account.id, name: sfa.name, enqueued: true, estimated_holdings: count }.to_json)
|
||||
end
|
||||
|
||||
sleep(sleep_ms / 1000.0) if sleep_ms.positive?
|
||||
|
||||
Reference in New Issue
Block a user