|
|
@ -65,7 +65,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
|
|
|
|
| 'exchange'
|
|
|
|
| 'exchange'
|
|
|
|
| 'name'
|
|
|
|
| 'name'
|
|
|
|
| 'value'
|
|
|
|
| 'value'
|
|
|
|
>;
|
|
|
|
> & { etfProvider: string };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
public sectors: {
|
|
|
|
public sectors: {
|
|
|
|
[name: string]: { name: string; value: number };
|
|
|
|
[name: string]: { name: string; value: number };
|
|
|
@ -249,7 +249,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
|
|
|
|
public initializeAnalysisData() {
|
|
|
|
public initializeAnalysisData() {
|
|
|
|
this.initialize();
|
|
|
|
this.initialize();
|
|
|
|
|
|
|
|
|
|
|
|
for (const [id, { current, name, original }] of Object.entries(
|
|
|
|
for (const [id, { current, name }] of Object.entries(
|
|
|
|
this.portfolioDetails.accounts
|
|
|
|
this.portfolioDetails.accounts
|
|
|
|
)) {
|
|
|
|
)) {
|
|
|
|
this.accounts[id] = {
|
|
|
|
this.accounts[id] = {
|
|
|
@ -275,6 +275,10 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
|
|
|
|
assetClass: position.assetClass,
|
|
|
|
assetClass: position.assetClass,
|
|
|
|
assetSubClass: position.assetSubClass,
|
|
|
|
assetSubClass: position.assetSubClass,
|
|
|
|
currency: position.currency,
|
|
|
|
currency: position.currency,
|
|
|
|
|
|
|
|
etfProvider: this.extractEtfProvider({
|
|
|
|
|
|
|
|
assetSubClass: position.assetSubClass,
|
|
|
|
|
|
|
|
name: position.name
|
|
|
|
|
|
|
|
}),
|
|
|
|
exchange: position.exchange,
|
|
|
|
exchange: position.exchange,
|
|
|
|
name: position.name
|
|
|
|
name: position.name
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -452,4 +456,19 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private extractEtfProvider({
|
|
|
|
|
|
|
|
assetSubClass,
|
|
|
|
|
|
|
|
name
|
|
|
|
|
|
|
|
}: {
|
|
|
|
|
|
|
|
assetSubClass: PortfolioPosition['assetSubClass'];
|
|
|
|
|
|
|
|
name: string;
|
|
|
|
|
|
|
|
}) {
|
|
|
|
|
|
|
|
if (assetSubClass === 'ETF') {
|
|
|
|
|
|
|
|
const [firstWord] = name.split(' ');
|
|
|
|
|
|
|
|
return firstWord;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return UNKNOWN_KEY;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|