|
|
@ -10,6 +10,7 @@ import { SectorName } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
import { SymbolProfile } from '@prisma/client'; |
|
|
import { SymbolProfile } from '@prisma/client'; |
|
|
|
|
|
import { Big } from 'big.js'; |
|
|
import { isPlainObject } from 'lodash-es'; |
|
|
import { isPlainObject } from 'lodash-es'; |
|
|
|
|
|
|
|
|
@Injectable() |
|
|
@Injectable() |
|
|
@ -179,8 +180,9 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface { |
|
|
aliases: TrackinsightDataEnhancerService.sectorsMapping |
|
|
aliases: TrackinsightDataEnhancerService.sectorsMapping |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
weightsBySector[sectorName] = |
|
|
weightsBySector[sectorName] = new Big(weightsBySector[sectorName] ?? 0) |
|
|
(weightsBySector[sectorName] ?? 0) + value.weight; |
|
|
.plus(value.weight) |
|
|
|
|
|
.toNumber(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
response.sectors = Object.entries(weightsBySector).map( |
|
|
response.sectors = Object.entries(weightsBySector).map( |
|
|
|