fix wrong id for ad creation

This commit is contained in:
sbriat 2023-09-12 15:10:32 +02:00
parent 1939f62049
commit 4731020e8a
3 changed files with 2 additions and 3 deletions

View File

@ -20,7 +20,6 @@ export abstract class Algorithm {
for (const processor of this.processors) { for (const processor of this.processors) {
this.candidates = await processor.execute(this.candidates); this.candidates = await processor.execute(this.candidates);
} }
// console.log(this.candidates);
return this.candidates.map((candidate: CandidateEntity) => return this.candidates.map((candidate: CandidateEntity) =>
MatchEntity.create({ adId: candidate.id }), MatchEntity.create({ adId: candidate.id }),
); );

View File

@ -16,7 +16,7 @@ export class AdCreatedMessageHandler {
const createdAd: Ad = JSON.parse(message); const createdAd: Ad = JSON.parse(message);
await this.commandBus.execute( await this.commandBus.execute(
new CreateAdCommand({ new CreateAdCommand({
id: createdAd.id, id: createdAd.aggregateId,
driver: createdAd.driver, driver: createdAd.driver,
passenger: createdAd.passenger, passenger: createdAd.passenger,
frequency: createdAd.frequency, frequency: createdAd.frequency,

View File

@ -1,7 +1,7 @@
import { Frequency } from '@modules/ad/core/domain/ad.types'; import { Frequency } from '@modules/ad/core/domain/ad.types';
export type Ad = { export type Ad = {
id: string; aggregateId: string;
driver: boolean; driver: boolean;
passenger: boolean; passenger: boolean;
frequency: Frequency; frequency: Frequency;