feat: expose instrument isin in portfolio positions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user