Remove Testprovider support and related references for streamlined provider handling.

This commit is contained in:
luckyPipewrench
2026-01-23 11:52:20 -05:00
parent b8ffe06974
commit 9caee4ec36
7 changed files with 5 additions and 23 deletions

View File

@@ -14,7 +14,6 @@ class AccountsController < ApplicationController
@mercury_items = family.mercury_items.ordered.includes(:syncs, :mercury_accounts)
@coinbase_items = family.coinbase_items.ordered.includes(:coinbase_accounts, :accounts, :syncs)
@snaptrade_items = family.snaptrade_items.ordered.includes(:syncs, :snaptrade_accounts)
@testprovider_items = family.testprovider_items.ordered.includes(:syncs, :testprovider_accounts)
# Build sync stats maps for all providers
build_sync_stats_maps
@@ -278,12 +277,5 @@ class AccountsController < ApplicationController
.count
@coinbase_unlinked_count_map[item.id] = count
end
# Testprovider sync stats
@testprovider_sync_stats_map = {}
@testprovider_items.each do |item|
latest_sync = item.syncs.ordered.first
@testprovider_sync_stats_map[item.id] = latest_sync&.sync_stats || {}
end
end
end

View File

@@ -126,8 +126,7 @@ class Settings::ProvidersController < ApplicationController
config.provider_key.to_s.casecmp("coinstats").zero? || \
config.provider_key.to_s.casecmp("mercury").zero? || \
config.provider_key.to_s.casecmp("coinbase").zero? || \
config.provider_key.to_s.casecmp("snaptrade").zero? || \
config.provider_key.to_s.casecmp("testprovider").zero?
config.provider_key.to_s.casecmp("snaptrade").zero?
end
# Providers page only needs to know whether any SimpleFin/Lunchflow connections exist with valid credentials
@@ -138,6 +137,5 @@ class Settings::ProvidersController < ApplicationController
@mercury_items = Current.family.mercury_items.ordered.select(:id)
@coinbase_items = Current.family.coinbase_items.ordered # Coinbase panel needs name and sync info for status display
@snaptrade_items = Current.family.snaptrade_items.includes(:snaptrade_accounts).ordered
@testprovider_items = Current.family.testprovider_items.ordered.select(:id)
end
end

View File

@@ -1,5 +1,5 @@
class DataEnrichment < ApplicationRecord
belongs_to :enrichable, polymorphic: true
enum :source, { rule: "rule", plaid: "plaid", simplefin: "simplefin", lunchflow: "lunchflow", synth: "synth", ai: "ai", enable_banking: "enable_banking", coinstats: "coinstats", mercury: "mercury" , testprovider: "testprovider"}
enum :source, { rule: "rule", plaid: "plaid", simplefin: "simplefin", lunchflow: "lunchflow", synth: "synth", ai: "ai", enable_banking: "enable_banking", coinstats: "coinstats", mercury: "mercury" }
end

View File

@@ -1,5 +1,5 @@
class ProviderMerchant < Merchant
enum :source, { plaid: "plaid", simplefin: "simplefin", lunchflow: "lunchflow", synth: "synth", ai: "ai", enable_banking: "enable_banking", coinstats: "coinstats", mercury: "mercury" , testprovider: "testprovider"}
enum :source, { plaid: "plaid", simplefin: "simplefin", lunchflow: "lunchflow", synth: "synth", ai: "ai", enable_banking: "enable_banking", coinstats: "coinstats", mercury: "mercury" }
validates :name, uniqueness: { scope: [ :source ] }
validates :source, presence: true

View File

@@ -57,10 +57,6 @@
<%= render @snaptrade_items.sort_by(&:created_at) %>
<% end %>
<% if @testprovider_items.any? %>
<%= render @testprovider_items.sort_by(&:created_at) %>
<% end %>
<% if @manual_accounts.any? %>
<div id="manual-accounts">
<%= render "accounts/index/manual_accounts", accounts: @manual_accounts %>

View File

@@ -59,10 +59,4 @@
<%= render "settings/providers/snaptrade_panel" %>
</turbo-frame>
<% end %>
<%= settings_section title: "Testprovider", collapsible: true, open: false do %>
<turbo-frame id="testprovider-providers-panel">
<%= render "settings/providers/testprovider_panel" %>
</turbo-frame>
<% end %>
</div>

View File

@@ -57,6 +57,7 @@ module <%= class_name %>Account::DataHelpers
Rails.logger.error("<%= class_name %>Account::DataHelpers - Failed to parse date: #{date_value.inspect} - #{e.message}")
nil
end
<% if investment_provider? -%>
# Find or create security with race condition handling
def resolve_security(symbol, symbol_data = {})
@@ -137,6 +138,7 @@ module <%= class_name %>Account::DataHelpers
nil
end
end
<% end -%>
# Handle currency as string or object (API inconsistency)
def extract_currency(data, fallback: nil)