mirror of
https://github.com/we-promise/sure.git
synced 2026-07-20 16:55:25 +00:00
Adds Provider::TinkoffInvest, a token-based securities provider built on the public T-Invest REST gateway (invest-public-api.tinkoff.ru/rest). It serves prices for Russian instruments (shares, ETF/БПИФ, bonds) and, crucially, brand logos via the T-Invest CDN — the authoritative logo source for MOEX instruments, which ISS (MoexPublic) does not provide. - Registry: register `tinkoff_invest` under the :securities concept; token via ENV TINKOFF_INVEST_API_KEY or encrypted Setting.tinkoff_invest_api_key. - Logos independent of the price provider: Security#import_brand_logo consults T-Invest for a logo whenever a token is configured (after the price-provider metadata fetch, so it never short-circuits website_url backfill). Gated on token presence, not the securities checklist. - display_logo_url: with no website domain, a stored provider logo (T-Invest) now beats the ticker-only Brandfetch lettermark; when a domain exists, Brandfetch still wins (unchanged). - MoexPublic no longer reports moex.com as the issuer website — it's the exchange, not the issuer, and would make Brandfetch render the exchange logo for every instrument and shadow the real brand logo. - Prices: GetCandles (daily, paged) + GetLastPrices; Quotation units+nano/1e9; bonds priced as percent-of-par x nominal (missing nominal raises, not 0). - Settings: encrypted token field (always shown) + provider checkbox + en locale. - Tests for search/info/logo-url/prices/bond/incomplete-candle and display logic. Co-authored-by: Claude <noreply@anthropic.com>
55 lines
2.1 KiB
Plaintext
55 lines
2.1 KiB
Plaintext
<%= content_for :page_title, t(".title") %>
|
|
<%= settings_section title: t(".ai_assistant") do %>
|
|
<%= render "settings/hostings/assistant_settings" %>
|
|
<% end %>
|
|
<%= settings_section title: t(".general") do %>
|
|
<div class="space-y-6"
|
|
data-controller="provider-settings"
|
|
data-provider-settings-active-value="<%= Setting.llm_provider %>">
|
|
<%= render "settings/hostings/llm_provider_selector" %>
|
|
<%= tag.div data: { "provider-settings-target": "panel", provider: "openai" },
|
|
hidden: Setting.llm_provider != "openai" do %>
|
|
<%= render "settings/hostings/openai_settings" %>
|
|
<% end %>
|
|
<%= tag.div data: { "provider-settings-target": "panel", provider: "anthropic" },
|
|
hidden: Setting.llm_provider != "anthropic" do %>
|
|
<%= render "settings/hostings/anthropic_settings" %>
|
|
<% end %>
|
|
<%= render "settings/hostings/brand_fetch_settings" %>
|
|
</div>
|
|
<% end %>
|
|
<%= settings_section title: t(".financial_data_providers") do %>
|
|
<div class="space-y-6">
|
|
<%= render "settings/hostings/provider_selection" %>
|
|
<% if @show_yahoo_finance_settings %>
|
|
<%= render "settings/hostings/yahoo_finance_settings" %>
|
|
<% end %>
|
|
<% if @show_twelve_data_settings %>
|
|
<%= render "settings/hostings/twelve_data_settings" %>
|
|
<% end %>
|
|
<% if @show_tiingo_settings %>
|
|
<%= render "settings/hostings/tiingo_settings" %>
|
|
<% end %>
|
|
<% if @show_eodhd_settings %>
|
|
<%= render "settings/hostings/eodhd_settings" %>
|
|
<% end %>
|
|
<% if @show_alpha_vantage_settings %>
|
|
<%= render "settings/hostings/alpha_vantage_settings" %>
|
|
<% end %>
|
|
<% if @show_tinkoff_invest_settings %>
|
|
<%= render "settings/hostings/tinkoff_invest_settings" %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<%= settings_section title: t(".sync_settings") do %>
|
|
<%= render "settings/hostings/sync_settings" %>
|
|
<% end %>
|
|
<% if Current.user.super_admin? %>
|
|
<%= settings_section title: t(".invites") do %>
|
|
<%= render "settings/hostings/invite_code_settings" %>
|
|
<% end %>
|
|
<% end %>
|
|
<%= settings_section title: t(".danger_zone") do %>
|
|
<%= render "settings/hostings/danger_zone_settings" %>
|
|
<% end %>
|