diff --git "a/packages/domain/laur\303\251at/src/notifier/notifierLaur\303\251at.command.ts" "b/packages/domain/laur\303\251at/src/notifier/notifierLaur\303\251at.command.ts" index 9aa64fedf5..2dccc63c2a 100644 --- "a/packages/domain/laur\303\251at/src/notifier/notifierLaur\303\251at.command.ts" +++ "b/packages/domain/laur\303\251at/src/notifier/notifierLaur\303\251at.command.ts" @@ -2,6 +2,7 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { LoadAggregate } from '@potentiel-domain/core'; import { DateTime, Email, IdentifiantProjet } from '@potentiel-domain/common'; +import { Candidature } from '@potentiel-domain/candidature'; import { loadLauréatFactory } from '../lauréat.aggregate'; @@ -20,6 +21,17 @@ export const registerNotifierLauréatCommand = (loadAggregate: LoadAggregate) => const handler: MessageHandler = async (payload) => { const Lauréat = await loadLauréatAggregate(payload.identifiantProjet, false); await Lauréat.notifier(payload); + await mediator.send({ + type: 'Candidature.UseCase.NotifierCandidature', + data: { + identifiantProjetValue: payload.identifiantProjet.formatter(), + notifiéeLeValue: payload.notifiéLe.formatter(), + notifiéeParValue: payload.notifiéPar.formatter(), + attestationValue: { + format: 'application/pdf', + }, + }, + }); }; mediator.register('Lauréat.Command.NotifierLauréat', handler); diff --git "a/packages/domain/p\303\251riode/src/notifier/notifierP\303\251riode.command.ts" "b/packages/domain/p\303\251riode/src/notifier/notifierP\303\251riode.command.ts" index 753069dce8..a070afff87 100644 --- "a/packages/domain/p\303\251riode/src/notifier/notifierP\303\251riode.command.ts" +++ "b/packages/domain/p\303\251riode/src/notifier/notifierP\303\251riode.command.ts" @@ -37,18 +37,6 @@ export const registerNotifierPériodeCommand = (loadAggregate: LoadAggregate) => const candidature = await loadCandidature(identifiantCandidature); try { - await mediator.send({ - type: 'Candidature.UseCase.NotifierCandidature', - data: { - identifiantProjetValue: identifiantCandidature.formatter(), - notifiéeLeValue: notifiéeLe.formatter(), - notifiéeParValue: notifiéePar.formatter(), - attestationValue: { - format: 'application/pdf', - }, - }, - }); - if (candidature.statut?.estClassé()) { await mediator.send({ type: 'Lauréat.UseCase.NotifierLauréat', diff --git "a/packages/domain/\303\251limin\303\251/src/notifier/notifier\303\211limin\303\251.command.ts" "b/packages/domain/\303\251limin\303\251/src/notifier/notifier\303\211limin\303\251.command.ts" index 200ce5eee9..e5feb141df 100644 --- "a/packages/domain/\303\251limin\303\251/src/notifier/notifier\303\211limin\303\251.command.ts" +++ "b/packages/domain/\303\251limin\303\251/src/notifier/notifier\303\211limin\303\251.command.ts" @@ -2,6 +2,7 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { LoadAggregate } from '@potentiel-domain/core'; import { DateTime, Email, IdentifiantProjet } from '@potentiel-domain/common'; +import { Candidature } from '@potentiel-domain/candidature'; import { loadÉliminéFactory } from '../éliminé.aggregate'; @@ -20,6 +21,17 @@ export const registerNotifierÉliminéCommand = (loadAggregate: LoadAggregate) = const handler: MessageHandler = async (payload) => { const éliminé = await loadÉliminéAggregate(payload.identifiantProjet, false); await éliminé.notifier(payload); + await mediator.send({ + type: 'Candidature.UseCase.NotifierCandidature', + data: { + identifiantProjetValue: payload.identifiantProjet.formatter(), + notifiéeLeValue: payload.notifiéLe.formatter(), + notifiéeParValue: payload.notifiéPar.formatter(), + attestationValue: { + format: 'application/pdf', + }, + }, + }); }; mediator.register('Éliminé.Command.NotifierÉliminé', handler);