|
|
@ -22,13 +22,16 @@ export class MarketDataService { |
|
|
) {} |
|
|
) {} |
|
|
|
|
|
|
|
|
public async deleteMany({ dataSource, symbol }: AssetProfileIdentifier) { |
|
|
public async deleteMany({ dataSource, symbol }: AssetProfileIdentifier) { |
|
|
this.eventEmitter.emit('market-data.updated', { symbol }); |
|
|
const result = await this.prismaService.marketData.deleteMany({ |
|
|
return this.prismaService.marketData.deleteMany({ |
|
|
|
|
|
where: { |
|
|
where: { |
|
|
dataSource, |
|
|
dataSource, |
|
|
symbol |
|
|
symbol |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.eventEmitter.emit('market-data.updated', { symbol }); |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async get({ |
|
|
public async get({ |
|
|
@ -198,14 +201,7 @@ export class MarketDataService { |
|
|
oldAssetProfileIdentifier: AssetProfileIdentifier, |
|
|
oldAssetProfileIdentifier: AssetProfileIdentifier, |
|
|
newAssetProfileIdentifier: AssetProfileIdentifier |
|
|
newAssetProfileIdentifier: AssetProfileIdentifier |
|
|
) { |
|
|
) { |
|
|
this.eventEmitter.emit('market-data.updated', { |
|
|
const result = await this.prismaService.marketData.updateMany({ |
|
|
symbol: oldAssetProfileIdentifier.symbol |
|
|
|
|
|
}); |
|
|
|
|
|
this.eventEmitter.emit('market-data.updated', { |
|
|
|
|
|
symbol: newAssetProfileIdentifier.symbol |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return this.prismaService.marketData.updateMany({ |
|
|
|
|
|
data: { |
|
|
data: { |
|
|
dataSource: newAssetProfileIdentifier.dataSource, |
|
|
dataSource: newAssetProfileIdentifier.dataSource, |
|
|
symbol: newAssetProfileIdentifier.symbol |
|
|
symbol: newAssetProfileIdentifier.symbol |
|
|
@ -215,6 +211,15 @@ export class MarketDataService { |
|
|
symbol: oldAssetProfileIdentifier.symbol |
|
|
symbol: oldAssetProfileIdentifier.symbol |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.eventEmitter.emit('market-data.updated', { |
|
|
|
|
|
symbol: oldAssetProfileIdentifier.symbol |
|
|
|
|
|
}); |
|
|
|
|
|
this.eventEmitter.emit('market-data.updated', { |
|
|
|
|
|
symbol: newAssetProfileIdentifier.symbol |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async updateMarketData(params: { |
|
|
public async updateMarketData(params: { |
|
|
|