feat: expose instrument isin in portfolio positions

This commit is contained in:
2026-08-17 13:34:38 +03:00
parent 25d7c5780b
commit 5aa9bd395a
4 changed files with 10 additions and 4 deletions
+3 -2
View File
@@ -44,7 +44,7 @@ const types: Record<string, string> = {
type CachedSnapshot = { snapshot: PortfolioDto; storedAt: number };
type CachedMetadata = {
value: { ticker?: string; name?: string } | null;
value: { ticker?: string; name?: string; isin?: string } | null;
storedAt: number;
};
@@ -209,6 +209,7 @@ export class PortfolioService {
currentValue,
averagePurchasePrice,
absoluteReturn,
isin: metadata?.isin?.trim() || null,
};
}
@@ -236,7 +237,7 @@ export class PortfolioService {
) {
const lookup = async (
key: string,
fetch: () => Promise<{ ticker?: string; name?: string } | null>,
fetch: () => Promise<{ ticker?: string; name?: string; isin?: string } | null>,
) => {
const cached = this.metadata.get(key);
if (cached && Date.now() - cached.storedAt <= metadataForMs)