Skip to content

Commit 6527854

Browse files
committed
[PARCOURS DEVENIR AIDANT] Prends en compte un futur Aidant en attente d’adhésion à une association
1 parent d4864bd commit 6527854

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

mon-aide-cyber-api/src/gestion-demandes/devenir-aidant/DemandeDevenirAidant.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ export type TypeEntite = 'ServicePublic' | 'ServiceEtat' | 'Association';
2929

3030
export type EntiteDemande = {
3131
type: TypeEntite;
32-
nom: string;
33-
siret: string;
32+
nom?: string;
33+
siret?: string;
3434
};

mon-aide-cyber-api/test/gestion-demandes/devenir-aidant/CapteurCommandeDevenirAidant.spec.ts

+34
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,40 @@ describe('Capteur de commande demande devenir aidant', () => {
308308
});
309309
});
310310

311+
it('Crée la demande pour un futur Aidant en attente d’adhésion à une association', async () => {
312+
const entrepots = new EntrepotsMemoire();
313+
314+
const demandeDevenirAidant = await new CapteurCommandeDevenirAidant(
315+
entrepots,
316+
new BusEvenementDeTest(),
317+
new AdaptateurEnvoiMailMemoire(),
318+
annuaireCot,
319+
unServiceAidant(entrepots.aidants())
320+
).execute({
321+
departement: ardennes,
322+
mail: 'email',
323+
nom: 'nom',
324+
prenom: 'prenom',
325+
entite: {
326+
type: 'Association',
327+
},
328+
type: 'CommandeDevenirAidant',
329+
});
330+
331+
expect(demandeDevenirAidant).toStrictEqual<DemandeDevenirAidant>({
332+
departement: ardennes,
333+
mail: 'email',
334+
nom: 'nom',
335+
prenom: 'prenom',
336+
identifiant: expect.any(String),
337+
date: FournisseurHorloge.maintenant(),
338+
statut: StatutDemande.EN_COURS,
339+
entite: {
340+
type: 'Association',
341+
},
342+
});
343+
});
344+
311345
it('Met à jour une demande existante', async () => {
312346
const entrepots = new EntrepotsMemoire();
313347
await entrepots

0 commit comments

Comments
 (0)