|
@ -45,8 +45,8 @@ export class AssetProfileDialog implements OnDestroy, OnInit { |
|
|
public countries: { |
|
|
public countries: { |
|
|
[code: string]: { name: string; value: number }; |
|
|
[code: string]: { name: string; value: number }; |
|
|
}; |
|
|
}; |
|
|
public isBenchmark = false; |
|
|
|
|
|
public historicalDataAsString: string; |
|
|
public historicalDataAsString: string; |
|
|
|
|
|
public isBenchmark = false; |
|
|
public marketDataDetails: MarketData[] = []; |
|
|
public marketDataDetails: MarketData[] = []; |
|
|
public sectors: { |
|
|
public sectors: { |
|
|
[name: string]: { name: string; value: number }; |
|
|
[name: string]: { name: string; value: number }; |
|
@ -203,23 +203,19 @@ export class AssetProfileDialog implements OnDestroy, OnInit { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
|
|
this.unsubscribeSubject.next(); |
|
|
|
|
|
this.unsubscribeSubject.complete(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public importHistoricalData() { |
|
|
public importHistoricalData() { |
|
|
const inputHistoricalData = this.historicalDataAsString; |
|
|
const inputHistoricalData = this.historicalDataAsString; |
|
|
const inputSplittedByLine = inputHistoricalData.split('\n'); |
|
|
const inputSplittedByLine = inputHistoricalData.split('\n'); |
|
|
const dataBulkUpdate: UpdateMarketDataDto[] = []; |
|
|
const dataBulkUpdate: UpdateMarketDataDto[] = inputSplittedByLine.map( |
|
|
inputSplittedByLine.forEach((line) => { |
|
|
(line) => { |
|
|
const inputSplittedBySeparator = line.split(';'); |
|
|
const inputSplittedBySeparator = line.split(';'); |
|
|
const inputDate = parseISO(inputSplittedBySeparator[0]); |
|
|
const inputDate = parseISO(inputSplittedBySeparator[0]); |
|
|
dataBulkUpdate.push({ |
|
|
return { |
|
|
date: inputDate, |
|
|
date: inputDate, |
|
|
marketPrice: Number(inputSplittedBySeparator[1]) |
|
|
marketPrice: Number(inputSplittedBySeparator[1]) |
|
|
}); |
|
|
}; |
|
|
}); |
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
this.adminService |
|
|
this.adminService |
|
|
.postMarketData({ |
|
|
.postMarketData({ |
|
@ -234,4 +230,9 @@ export class AssetProfileDialog implements OnDestroy, OnInit { |
|
|
|
|
|
|
|
|
this.historicalDataAsString = ''; |
|
|
this.historicalDataAsString = ''; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
|
|
this.unsubscribeSubject.next(); |
|
|
|
|
|
this.unsubscribeSubject.complete(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|