feat(watchlist): add company identity catalog

Embed a pinned FinanceDatabase equity snapshot, add authenticated company search and identity-based follows, preserve legacy assets, and map selected Yahoo symbols for collection.

Refs #19

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:08:22 +01:00
parent 1123360914
commit d65222169a
50 changed files with 49897 additions and 193 deletions

View File

@ -1,12 +1,17 @@
import { api } from './client'
export interface Asset { id: string; user_id: string; symbol: string; name: string; figi: string | null; created_at: string }
export interface IndexSearchResult { figi: string; name: string; symbol: string; market?: string }
export interface FollowAsset { symbol: string; name: string; figi?: string | null }
export interface Asset {
id: string; user_id: string; symbol: string; name: string; figi: string | null; created_at: string
company_id?: string | null; country?: string; exchange?: string
}
export interface CompanySearchResult {
company_id: string; name: string; exchange: string; country: string; mic: string
}
export interface FollowAsset { company_id: string }
export const assetsApi = {
list: () => api.get<Asset[]>('/me/assets'),
search: (query: string, limit = 20) => api.get<IndexSearchResult[]>(`/indices/search?${new URLSearchParams({ q: query, limit: String(limit) })}`),
add: (asset: FollowAsset) => api.post<Asset>('/me/assets', asset),
search: (query: string, limit = 20) => api.get<CompanySearchResult[]>(`/companies/search?${new URLSearchParams({ q: query, limit: String(limit) })}`),
add: (asset: FollowAsset) => api.post<Asset>('/me/assets', { company_id: asset.company_id }),
remove: (id: string) => api.delete<void>(`/me/assets/${encodeURIComponent(id)}`),
}