|
@ -40,7 +40,7 @@ export class OrderService { |
|
|
private readonly exchangeRateDataService: ExchangeRateDataService, |
|
|
private readonly exchangeRateDataService: ExchangeRateDataService, |
|
|
private readonly prismaService: PrismaService, |
|
|
private readonly prismaService: PrismaService, |
|
|
private readonly symbolProfileService: SymbolProfileService |
|
|
private readonly symbolProfileService: SymbolProfileService |
|
|
) { } |
|
|
) {} |
|
|
|
|
|
|
|
|
public async createOrder( |
|
|
public async createOrder( |
|
|
data: Prisma.OrderCreateInput & { |
|
|
data: Prisma.OrderCreateInput & { |
|
@ -201,13 +201,19 @@ export class OrderService { |
|
|
const orderIds = activities.map(order => order.id); |
|
|
const orderIds = activities.map(order => order.id); |
|
|
const { count } = await this.prismaService.order.deleteMany({ |
|
|
const { count } = await this.prismaService.order.deleteMany({ |
|
|
where: { |
|
|
where: { |
|
|
id: { in: orderIds } |
|
|
id: { |
|
|
|
|
|
in: activities.map(({ id }) => { |
|
|
|
|
|
return id; |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
this.eventEmitter.emit( |
|
|
this.eventEmitter.emit( |
|
|
PortfolioChangedEvent.getName(), |
|
|
PortfolioChangedEvent.getName(), |
|
|
new PortfolioChangedEvent({ userId: where.userId as string }) |
|
|
new PortfolioChangedEvent({ |
|
|
|
|
|
userId: <string>where.userId |
|
|
|
|
|
}) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
return count; |
|
|
return count; |
|
|