fix wrong id for ad creation
This commit is contained in:
parent
1939f62049
commit
4731020e8a
|
@ -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 }),
|
||||||
);
|
);
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue