From 46dfc89d09cf965a6992a37de956d9861c263709 Mon Sep 17 00:00:00 2001 From: Benjamin Levesque <14175665+benjlevesque@users.noreply.github.com> Date: Fri, 14 Feb 2025 18:19:30 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Ne=20pas=20ajouter=20d?= =?UTF-8?q?e=20t=C3=A2che=20planifi=C3=A9e=20GF=20pour=20un=20projet=20ach?= =?UTF-8?q?ev=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bootstrap/src/setupT\303\242che.ts" | 1 - .../accorder/accorderAbandon.usecase.ts" | 25 ++------- ...reAttestationConformit\303\251.usecase.ts" | 24 ++------- ...64tGarantiesFinanci\303\250res.usecase.ts" | 24 ++------- ...ntiesFinanci\303\250resEnCours.usecase.ts" | 35 ++++-------- ...ntiesFinanci\303\250resEnCours.usecase.ts" | 35 ++++-------- .../garantiesFinanci\303\250res.aggregate.ts" | 6 +++ .../garantiesFinanci\303\250res.register.ts" | 2 + ...rerGarantiesFinanci\303\250res.usecase.ts" | 35 ++++-------- ...peGarantiesFinanci\303\250res.behavior.ts" | 26 ++++++++- ...ypeGarantiesFinanci\303\250res.command.ts" | 26 ++++++++- ...ierGarantiesFinanci\303\250res.usecase.ts" | 33 +++--------- .../ajouter/ajouterT\303\242ches.behavior.ts" | 39 ++++++++++++++ .../ajouter/ajouterT\303\242ches.command.ts" | 54 +++++++++++++++++++ .../annuler/annulerT\303\242ches.behavior.ts" | 23 ++++++++ .../annuler/annulerT\303\242ches.command.ts" | 47 ++++++++++++++++ ...303\242ches-planifi\303\251es.register.ts" | 10 ++++ ...eDemandeChangementExecut\303\251e.saga.ts" | 2 +- ...rT\303\242chePlanifi\303\251e.behavior.ts" | 14 ++--- ...erT\303\242chePlanifi\303\251e.command.ts" | 2 - ...rT\303\242chePlanifi\303\251e.behavior.ts" | 12 ++--- ...erT\303\242chePlanifi\303\251e.command.ts" | 5 +- .../src/index.ts" | 5 ++ ...t\303\242chePlanifi\303\251e.aggregate.ts" | 20 +++---- ...242cheGarantiesFinanci\303\250res.saga.ts" | 39 +------------- ...antiesFinanci\303\250resActuelles.feature" | 11 ++++ ...antiesFinanci\303\250resActuelles.when.ts" | 27 ++-------- ...antiesFinanci\303\250resActuelles.feature" | 5 +- .../src/t\303\242che/t\303\242che.world.ts" | 3 -- 29 files changed, 322 insertions(+), 268 deletions(-) create mode 100644 "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.behavior.ts" create mode 100644 "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.command.ts" create mode 100644 "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.behavior.ts" create mode 100644 "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.command.ts" create mode 100644 "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/t\303\242ches-planifi\303\251es.register.ts" diff --git "a/packages/applications/bootstrap/src/setupT\303\242che.ts" "b/packages/applications/bootstrap/src/setupT\303\242che.ts" index 1d78023fdc..5e2fe51acc 100644 --- "a/packages/applications/bootstrap/src/setupT\303\242che.ts" +++ "b/packages/applications/bootstrap/src/setupT\303\242che.ts" @@ -70,7 +70,6 @@ const registerTâcheGarantiesFinancières = async () => { 'GarantiesFinancièresDemandées-V1', 'DépôtGarantiesFinancièresSoumis-V1', 'GarantiesFinancièresEnregistrées-V1', - 'TypeGarantiesFinancièresImporté-V1', ], eventHandler: async (event) => { await mediator.publish({ diff --git "a/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" "b/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" index 0846029319..6a16670cfb 100644 --- "a/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" @@ -8,10 +8,8 @@ import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { DocumentProjet, EnregistrerDocumentProjetCommand } from '@potentiel-domain/document'; // Package -import { AnnulerTâchePlanifiéeCommand } from '@potentiel-domain/tache-planifiee'; - import * as TypeDocumentAbandon from '../typeDocumentAbandon.valueType'; -import { TypeTâchePlanifiéeGarantiesFinancières } from '../../garantiesFinancières'; +import { AnnulerTâchesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annulerTâches.command'; import { AccorderAbandonCommand } from './accorderAbandon.command'; @@ -66,27 +64,10 @@ export const registerAccorderAbandonUseCase = () => { }, }); - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', - data: { - identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - }, - }); - - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', - data: { - identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, - }, - }); - - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', + await mediator.send({ + type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâches', data: { identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, }, }); }; diff --git "a/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" "b/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" index fad16de4e4..79770fe586 100644 --- "a/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" @@ -3,10 +3,9 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { DocumentProjet, EnregistrerDocumentProjetCommand } from '@potentiel-domain/document'; import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; -import { AnnulerTâchePlanifiéeCommand } from '@potentiel-domain/tache-planifiee'; import { TypeDocumentAchèvement } from '..'; -import * as TypeTâchePlanifiéeGarantiesFinancières from '../../garantiesFinancières/typeTâchePlanifiéeGarantiesFinancières.valueType'; +import { AnnulerTâchesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annulerTâches.command'; import { TransmettreAttestationConformitéCommand } from './transmettreAttestationConformité.command'; @@ -85,27 +84,10 @@ export const registerTransmettreAttestationConformitéUseCase = () => { }, }); - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', + await mediator.send({ + type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâches', data: { identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - }, - }); - - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', - data: { - identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, - }, - }); - - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', - data: { - identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, }, }); }; diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" index 5919360f2f..4e554d53eb 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" @@ -3,11 +3,10 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { DocumentProjet, EnregistrerDocumentProjetCommand } from '@potentiel-domain/document'; import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; -import { AnnulerTâchePlanifiéeCommand } from '@potentiel-domain/tache-planifiee'; import { Candidature } from '@potentiel-domain/candidature'; import { TypeDocumentGarantiesFinancières } from '../..'; -import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; +import { AnnulerTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/annuler/annulerTâches.command'; import { SoumettreDépôtGarantiesFinancièresCommand } from './soumettreDépôtGarantiesFinancières.command'; @@ -74,27 +73,10 @@ export const registerSoumettreDépôtGarantiesFinancièresUseCase = () => { }, }); - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', + await mediator.send({ + type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâches', data: { identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - }, - }); - - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', - data: { - identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, - }, - }); - - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', - data: { - identifiantProjet, - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, }, }); }; diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" index 9edc6d0515..2af018afb9 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" @@ -2,9 +2,8 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; -import { AjouterTâchePlanifiéeCommand } from '@potentiel-domain/tache-planifiee'; -import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; +import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouterTâches.command'; import { SupprimerDépôtGarantiesFinancièresEnCoursCommand } from './supprimerDépôtGarantiesFinancièresEnCours.command'; @@ -38,29 +37,15 @@ export const registerSupprimerGarantiesFinancièresÀTraiterUseCase = () => { }, }); - if (dateÉchéanceValue) { - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AjouterTâchePlanifiée', - data: { - identifiantProjet, - tâches: [ - { - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).ajouterNombreDeJours(1), - }, - { - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).retirerNombreDeMois(1), - }, - { - typeTâchePlanifiée: - TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).retirerNombreDeMois(2), - }, - ], - }, - }); - } + await mediator.send({ + type: 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + data: { + identifiantProjet, + dateÉchéance: dateÉchéanceValue + ? DateTime.convertirEnValueType(dateÉchéanceValue) + : undefined, + }, + }); }; mediator.register( 'Lauréat.GarantiesFinancières.UseCase.SupprimerGarantiesFinancièresÀTraiter', diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" index f4956d2020..7f619bded7 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" @@ -3,10 +3,9 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { DocumentProjetCommand, DossierProjet } from '@potentiel-domain/document'; -import { AjouterTâchePlanifiéeCommand } from '@potentiel-domain/tache-planifiee'; import { TypeDocumentGarantiesFinancières } from '../..'; -import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; +import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouterTâches.command'; import { ValiderDépôtGarantiesFinancièresEnCoursCommand } from './validerDépôtGarantiesFinancièresEnCours.command'; @@ -54,29 +53,15 @@ export const registerValiderDépôtGarantiesFinancièresEnCoursUseCase = () => { }, }); - if (dateÉchéanceValue) { - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AjouterTâchePlanifiée', - data: { - identifiantProjet, - tâches: [ - { - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).ajouterNombreDeJours(1), - }, - { - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).retirerNombreDeMois(1), - }, - { - typeTâchePlanifiée: - TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).retirerNombreDeMois(2), - }, - ], - }, - }); - } + await mediator.send({ + type: 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + data: { + identifiantProjet, + dateÉchéance: dateÉchéanceValue + ? DateTime.convertirEnValueType(dateÉchéanceValue) + : undefined, + }, + }); }; mediator.register( diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250res.aggregate.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250res.aggregate.ts" index 1743594f59..52f67cb46f 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250res.aggregate.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250res.aggregate.ts" @@ -96,6 +96,8 @@ import { GarantiesFinancièresÉchuesEvent, échoir, } from './garantiesFinancièresActuelles/échoir/échoirGarantiesFinancières.behavior'; +import { ajouterTâches } from './tâches-planifiées/ajouter/ajouterTâches.behavior'; +import { annulerTâches } from './tâches-planifiées/annuler/annulerTâches.behavior'; export type GarantiesFinancièresEvent = | DépôtGarantiesFinancièresSoumisEvent @@ -155,6 +157,8 @@ export type GarantiesFinancièresAggregate = Aggregate { }, }); - if (dateÉchéanceValue) { - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AjouterTâchePlanifiée', - data: { - identifiantProjet, - tâches: [ - { - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).ajouterNombreDeJours(1), - }, - { - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).retirerNombreDeMois(1), - }, - { - typeTâchePlanifiée: - TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).retirerNombreDeMois(2), - }, - ], - }, - }); - } + await mediator.send({ + type: 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + data: { + identifiantProjet, + dateÉchéance: dateÉchéanceValue + ? DateTime.convertirEnValueType(dateÉchéanceValue) + : undefined, + }, + }); }; mediator.register('Lauréat.GarantiesFinancières.UseCase.EnregistrerGarantiesFinancières', runner); }; diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.behavior.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.behavior.ts" index aeffce45ff..872af181aa 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.behavior.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.behavior.ts" @@ -1,6 +1,7 @@ import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { DomainEvent } from '@potentiel-domain/core'; import { Candidature } from '@potentiel-domain/candidature'; +import { TâchePlanifiéeAggregate } from '@potentiel-domain/tache-planifiee'; import { StatutGarantiesFinancières } from '../..'; import { GarantiesFinancièresAggregate } from '../../garantiesFinancières.aggregate'; @@ -20,11 +21,26 @@ export type Options = { type?: Candidature.TypeGarantiesFinancières.ValueType; dateÉchéance?: DateTime.ValueType; importéLe: DateTime.ValueType; + + // TODO remove the following options once aggregate root is available + estAchevé: boolean; + tâchePlanifiéeEchoir: TâchePlanifiéeAggregate; + tâchePlanifiéeRappel1mois: TâchePlanifiéeAggregate; + tâchePlanifiéeRappel2mois: TâchePlanifiéeAggregate; }; export async function importerType( this: GarantiesFinancièresAggregate, - { identifiantProjet, type, dateÉchéance, importéLe }: Options, + { + identifiantProjet, + type, + dateÉchéance, + importéLe, + estAchevé, + tâchePlanifiéeEchoir, + tâchePlanifiéeRappel1mois, + tâchePlanifiéeRappel2mois, + }: Options, ) { if (!type) { return; @@ -40,6 +56,14 @@ export async function importerType( }, }; + await this.ajouterTâches({ + dateÉchéance, + tâchePlanifiéeEchoir, + tâchePlanifiéeRappel1mois, + tâchePlanifiéeRappel2mois, + estAchevé, + }); + await this.publish(event); } diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.command.ts" index 4a8c25b255..ffca815801 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.command.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.command.ts" @@ -3,9 +3,12 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { IdentifiantProjet } from '@potentiel-domain/common'; import { LoadAggregate } from '@potentiel-domain/core'; import { Candidature } from '@potentiel-domain/candidature'; +import { loadTâchePlanifiéeAggregateFactory } from '@potentiel-domain/tache-planifiee'; import { loadGarantiesFinancièresFactory } from '../../garantiesFinancières.aggregate'; import { loadLauréatFactory } from '../../../lauréat.aggregate'; +import { loadAchèvementFactory } from '../../../achèvement/achèvement.aggregate'; +import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; export type ImporterTypeGarantiesFinancièresCommand = Message< 'Lauréat.GarantiesFinancières.Command.ImporterTypeGarantiesFinancières', @@ -18,6 +21,8 @@ export const registerImporterTypeGarantiesFinancièresCommand = (loadAggregate: const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); const loadLauréat = loadLauréatFactory(loadAggregate); const loadCandidature = Candidature.Aggregate.loadCandidatureFactory(loadAggregate); + const loadAchèvement = loadAchèvementFactory(loadAggregate); + const loadTâchePlanifiée = loadTâchePlanifiéeAggregateFactory(loadAggregate); const handler: MessageHandler = async ({ identifiantProjet, @@ -25,12 +30,31 @@ export const registerImporterTypeGarantiesFinancièresCommand = (loadAggregate: const garantiesFinancières = await loadGarantiesFinancières(identifiantProjet, false); const candidature = await loadCandidature(identifiantProjet, false); const lauréat = await loadLauréat(identifiantProjet, false); - + const achèvement = await loadAchèvement(identifiantProjet, false); + const tâchePlanifiéeEchoir = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.échoir.type, + identifiantProjet, + false, + ); + const tâchePlanifiéeRappel1mois = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, + identifiantProjet, + false, + ); + const tâchePlanifiéeRappel2mois = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, + identifiantProjet, + false, + ); await garantiesFinancières.importerType({ identifiantProjet, importéLe: lauréat.notifiéLe, type: candidature.garantiesFinancières?.type, dateÉchéance: candidature.garantiesFinancières?.dateEchéance, + estAchevé: achèvement.estAchevé(), + tâchePlanifiéeEchoir, + tâchePlanifiéeRappel1mois, + tâchePlanifiéeRappel2mois, }); }; mediator.register( diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" index e931d81f5f..7aece6d9d8 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" @@ -3,11 +3,10 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { DocumentProjet, EnregistrerDocumentProjetCommand } from '@potentiel-domain/document'; import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; -import { AjouterTâchePlanifiéeCommand } from '@potentiel-domain/tache-planifiee'; import { Candidature } from '@potentiel-domain/candidature'; import { TypeDocumentGarantiesFinancières } from '../..'; -import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; +import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouterTâches.command'; import { ModifierGarantiesFinancièresCommand } from './modifierGarantiesFinancières.command'; @@ -73,29 +72,13 @@ export const registerModifierGarantiesFinancièresUseCase = () => { }, }); - if (dateÉchéanceValue) { - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AjouterTâchePlanifiée', - data: { - identifiantProjet, - tâches: [ - { - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).ajouterNombreDeJours(1), - }, - { - typeTâchePlanifiée: TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).retirerNombreDeMois(1), - }, - { - typeTâchePlanifiée: - TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéanceValue).retirerNombreDeMois(2), - }, - ], - }, - }); - } + await mediator.send({ + type: 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + data: { + identifiantProjet, + dateÉchéance, + }, + }); }; mediator.register('Lauréat.GarantiesFinancières.UseCase.ModifierGarantiesFinancières', runner); }; diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.behavior.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.behavior.ts" new file mode 100644 index 0000000000..b269b30d02 --- /dev/null +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.behavior.ts" @@ -0,0 +1,39 @@ +import { DateTime } from '@potentiel-domain/common'; +import { TâchePlanifiéeAggregate } from '@potentiel-domain/tache-planifiee'; + +import { GarantiesFinancièresAggregate } from '../../garantiesFinancières.aggregate'; + +type AjouterTâchesOptions = { + dateÉchéance?: DateTime.ValueType; + + // TODO remove the following options once aggregate root is available + estAchevé?: boolean; + tâchePlanifiéeEchoir: TâchePlanifiéeAggregate; + tâchePlanifiéeRappel1mois: TâchePlanifiéeAggregate; + tâchePlanifiéeRappel2mois: TâchePlanifiéeAggregate; +}; + +export async function ajouterTâches( + this: GarantiesFinancièresAggregate, + { + estAchevé, + dateÉchéance, + tâchePlanifiéeEchoir, + tâchePlanifiéeRappel1mois, + tâchePlanifiéeRappel2mois, + }: AjouterTâchesOptions, +) { + if (dateÉchéance && !estAchevé) { + await tâchePlanifiéeEchoir.ajouter({ + àExécuterLe: dateÉchéance.ajouterNombreDeJours(1), + }); + + await tâchePlanifiéeRappel1mois.ajouter({ + àExécuterLe: dateÉchéance.retirerNombreDeMois(1), + }); + + await tâchePlanifiéeRappel2mois.ajouter({ + àExécuterLe: dateÉchéance.retirerNombreDeMois(2), + }); + } +} diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.command.ts" new file mode 100644 index 0000000000..a53c6f63a4 --- /dev/null +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.command.ts" @@ -0,0 +1,54 @@ +import { Message, MessageHandler, mediator } from 'mediateur'; + +import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; +import { LoadAggregate } from '@potentiel-domain/core'; +import { loadTâchePlanifiéeAggregateFactory } from '@potentiel-domain/tache-planifiee'; + +import { loadGarantiesFinancièresFactory } from '../../garantiesFinancières.aggregate'; +import { loadAchèvementFactory } from '../../../achèvement/achèvement.aggregate'; +import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; + +export type AjouterTâchesGarantiesFinancièresCommand = Message< + 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + { + identifiantProjet: IdentifiantProjet.ValueType; + dateÉchéance?: DateTime.ValueType; + } +>; + +export const registerAjouterTâchesCommand = (loadAggregate: LoadAggregate) => { + const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); + const loadAchèvement = loadAchèvementFactory(loadAggregate); + const loadTâchePlanifiée = loadTâchePlanifiéeAggregateFactory(loadAggregate); + const handler: MessageHandler = async ({ + identifiantProjet, + dateÉchéance, + }) => { + const garantiesFinancières = await loadGarantiesFinancières(identifiantProjet); + const achèvement = await loadAchèvement(identifiantProjet, false); + const tâchePlanifiéeEchoir = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.échoir.type, + identifiantProjet, + false, + ); + const tâchePlanifiéeRappel1mois = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, + identifiantProjet, + false, + ); + const tâchePlanifiéeRappel2mois = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, + identifiantProjet, + false, + ); + await garantiesFinancières.ajouterTâches({ + tâchePlanifiéeEchoir, + tâchePlanifiéeRappel1mois, + tâchePlanifiéeRappel2mois, + dateÉchéance, + estAchevé: achèvement.estAchevé(), + }); + }; + + mediator.register('Lauréat.GarantiesFinancières.Command.AjouterTâches', handler); +}; diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.behavior.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.behavior.ts" new file mode 100644 index 0000000000..96d65e82b9 --- /dev/null +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.behavior.ts" @@ -0,0 +1,23 @@ +import { TâchePlanifiéeAggregate } from '@potentiel-domain/tache-planifiee'; + +import { GarantiesFinancièresAggregate } from '../../garantiesFinancières.aggregate'; + +type annulerTâchesOptions = { + // TODO remove the following options once aggregate root is available + tâchePlanifiéeEchoir: TâchePlanifiéeAggregate; + tâchePlanifiéeRappel1mois: TâchePlanifiéeAggregate; + tâchePlanifiéeRappel2mois: TâchePlanifiéeAggregate; +}; + +export async function annulerTâches( + this: GarantiesFinancièresAggregate, + { + tâchePlanifiéeEchoir, + tâchePlanifiéeRappel1mois, + tâchePlanifiéeRappel2mois, + }: annulerTâchesOptions, +) { + await tâchePlanifiéeEchoir.annuler(); + await tâchePlanifiéeRappel1mois.annuler(); + await tâchePlanifiéeRappel2mois.annuler(); +} diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.command.ts" new file mode 100644 index 0000000000..3b239c6038 --- /dev/null +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.command.ts" @@ -0,0 +1,47 @@ +import { Message, MessageHandler, mediator } from 'mediateur'; + +import { IdentifiantProjet } from '@potentiel-domain/common'; +import { LoadAggregate } from '@potentiel-domain/core'; +import { loadTâchePlanifiéeAggregateFactory } from '@potentiel-domain/tache-planifiee'; + +import { loadGarantiesFinancièresFactory } from '../../garantiesFinancières.aggregate'; +import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; + +export type AnnulerTâchesGarantiesFinancièresCommand = Message< + 'Lauréat.GarantiesFinancières.Command.AnnulerTâches', + { + identifiantProjet: IdentifiantProjet.ValueType; + } +>; + +export const registerAnnulerTâchesCommand = (loadAggregate: LoadAggregate) => { + const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); + const loadTâchePlanifiée = loadTâchePlanifiéeAggregateFactory(loadAggregate); + const handler: MessageHandler = async ({ + identifiantProjet, + }) => { + const garantiesFinancières = await loadGarantiesFinancières(identifiantProjet); + const tâchePlanifiéeEchoir = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.échoir.type, + identifiantProjet, + false, + ); + const tâchePlanifiéeRappel1mois = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois.type, + identifiantProjet, + false, + ); + const tâchePlanifiéeRappel2mois = await loadTâchePlanifiée( + TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceDeuxMois.type, + identifiantProjet, + false, + ); + await garantiesFinancières.annulerTâches({ + tâchePlanifiéeEchoir, + tâchePlanifiéeRappel1mois, + tâchePlanifiéeRappel2mois, + }); + }; + + mediator.register('Lauréat.GarantiesFinancières.Command.AnnulerTâches', handler); +}; diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/t\303\242ches-planifi\303\251es.register.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/t\303\242ches-planifi\303\251es.register.ts" new file mode 100644 index 0000000000..18054f6947 --- /dev/null +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/t\303\242ches-planifi\303\251es.register.ts" @@ -0,0 +1,10 @@ +import { LoadAggregate } from '@potentiel-domain/core'; + +import { registerAjouterTâchesCommand } from './ajouter/ajouterTâches.command'; +import { registerAnnulerTâchesCommand } from './annuler/annulerTâches.command'; + +export const registerTâchesPlanifiées = (loadAggregate: LoadAggregate) => { + // commands + registerAjouterTâchesCommand(loadAggregate); + registerAnnulerTâchesCommand(loadAggregate); +}; diff --git "a/packages/domain/laur\303\251at/src/repr\303\251sentantL\303\251gal/saga/t\303\242chePlanifi\303\251eGestionAutomatiqueDemandeChangementExecut\303\251e.saga.ts" "b/packages/domain/laur\303\251at/src/repr\303\251sentantL\303\251gal/saga/t\303\242chePlanifi\303\251eGestionAutomatiqueDemandeChangementExecut\303\251e.saga.ts" index 64d47abc92..d718a55894 100644 --- "a/packages/domain/laur\303\251at/src/repr\303\251sentantL\303\251gal/saga/t\303\242chePlanifi\303\251eGestionAutomatiqueDemandeChangementExecut\303\251e.saga.ts" +++ "b/packages/domain/laur\303\251at/src/repr\303\251sentantL\303\251gal/saga/t\303\242chePlanifi\303\251eGestionAutomatiqueDemandeChangementExecut\303\251e.saga.ts" @@ -83,7 +83,7 @@ class TâchePlanifiéeGestionAutomatiqueDemandeChangementError extends Error { public identifiantProjet: string, ) { super( - `Impossible de traiter automatiquement la tâche planifier pour le changement de représentant légal`, + `Impossible de traiter automatiquement la tâche planifiée pour le changement de représentant légal`, ); } } diff --git "a/packages/domain/t\303\242che-planifi\303\251e/src/ajouter/ajouterT\303\242chePlanifi\303\251e.behavior.ts" "b/packages/domain/t\303\242che-planifi\303\251e/src/ajouter/ajouterT\303\242chePlanifi\303\251e.behavior.ts" index 152ab305cc..0a9162822c 100644 --- "a/packages/domain/t\303\242che-planifi\303\251e/src/ajouter/ajouterT\303\242chePlanifi\303\251e.behavior.ts" +++ "b/packages/domain/t\303\242che-planifi\303\251e/src/ajouter/ajouterT\303\242chePlanifi\303\251e.behavior.ts" @@ -15,22 +15,17 @@ export type TâchePlanifiéeAjoutéeEvent = DomainEvent< >; export type AjouterOptions = { - identifiantProjet: IdentifiantProjet.ValueType; - typeTâchePlanifiée: string; àExécuterLe: DateTime.ValueType; }; -export async function ajouter( - this: TâchePlanifiéeAggregate, - { identifiantProjet, typeTâchePlanifiée, àExécuterLe }: AjouterOptions, -) { +export async function ajouter(this: TâchePlanifiéeAggregate, { àExécuterLe }: AjouterOptions) { if (!this.àExécuterLe.estÉgaleÀ(àExécuterLe) || this.statut.estAnnulé()) { const event: TâchePlanifiéeAjoutéeEvent = { type: 'TâchePlanifiéeAjoutée-V1', payload: { ajoutéeLe: DateTime.now().formatter(), - identifiantProjet: identifiantProjet.formatter(), - typeTâchePlanifiée, + identifiantProjet: this.identifiantProjet.formatter(), + typeTâchePlanifiée: this.typeTâchePlanifiée, àExécuterLe: àExécuterLe.formatter(), }, }; @@ -40,9 +35,8 @@ export async function ajouter( export function applyTâchePlanifiéeAjoutée( this: TâchePlanifiéeAggregate, - { payload: { typeTâchePlanifiée, àExécuterLe } }: TâchePlanifiéeAjoutéeEvent, + { payload: { àExécuterLe } }: TâchePlanifiéeAjoutéeEvent, ) { - this.typeTâchePlanifiée = typeTâchePlanifiée; this.àExécuterLe = DateTime.convertirEnValueType(àExécuterLe); this.statut = StatutTâchePlanifiée.enAttenteExécution; } diff --git "a/packages/domain/t\303\242che-planifi\303\251e/src/ajouter/ajouterT\303\242chePlanifi\303\251e.command.ts" "b/packages/domain/t\303\242che-planifi\303\251e/src/ajouter/ajouterT\303\242chePlanifi\303\251e.command.ts" index d6bec46a5e..2977ae884b 100644 --- "a/packages/domain/t\303\242che-planifi\303\251e/src/ajouter/ajouterT\303\242chePlanifi\303\251e.command.ts" +++ "b/packages/domain/t\303\242che-planifi\303\251e/src/ajouter/ajouterT\303\242chePlanifi\303\251e.command.ts" @@ -26,8 +26,6 @@ export const registerAjouterTâchePlanifiéeCommand = (loadAggregate: LoadAggreg tâches.map(async ({ typeTâchePlanifiée, àExécuterLe }) => { const tâche = await loadTâchePlanifiée(typeTâchePlanifiée, identifiantProjet, false); await tâche.ajouter({ - typeTâchePlanifiée, - identifiantProjet, àExécuterLe, }); }), diff --git "a/packages/domain/t\303\242che-planifi\303\251e/src/annuler/annulerT\303\242chePlanifi\303\251e.behavior.ts" "b/packages/domain/t\303\242che-planifi\303\251e/src/annuler/annulerT\303\242chePlanifi\303\251e.behavior.ts" index ef5746ee4d..093e04666d 100644 --- "a/packages/domain/t\303\242che-planifi\303\251e/src/annuler/annulerT\303\242chePlanifi\303\251e.behavior.ts" +++ "b/packages/domain/t\303\242che-planifi\303\251e/src/annuler/annulerT\303\242chePlanifi\303\251e.behavior.ts" @@ -18,17 +18,14 @@ export type AnnulerOptions = { typeTâchePlanifiée: string; }; -export async function annuler( - this: TâchePlanifiéeAggregate, - { identifiantProjet, typeTâchePlanifiée }: AnnulerOptions, -) { +export async function annuler(this: TâchePlanifiéeAggregate) { if (this.statut.estÉgaleÀ(StatutTâchePlanifiée.enAttenteExécution)) { const event: TâchePlanifiéeAnnuléeEvent = { type: 'TâchePlanifiéeAnnulée-V1', payload: { annuléeLe: DateTime.now().formatter(), - identifiantProjet: identifiantProjet.formatter(), - typeTâchePlanifiée, + identifiantProjet: this.identifiantProjet.formatter(), + typeTâchePlanifiée: this.typeTâchePlanifiée, }, }; await this.publish(event); @@ -37,9 +34,8 @@ export async function annuler( export function applyTâchePlanifiéeAnnulée( this: TâchePlanifiéeAggregate, - { payload: { typeTâchePlanifiée, annuléeLe } }: TâchePlanifiéeAnnuléeEvent, + { payload: { annuléeLe } }: TâchePlanifiéeAnnuléeEvent, ) { - this.typeTâchePlanifiée = typeTâchePlanifiée; this.annuléeLe = DateTime.convertirEnValueType(annuléeLe); this.statut = StatutTâchePlanifiée.annulée; } diff --git "a/packages/domain/t\303\242che-planifi\303\251e/src/annuler/annulerT\303\242chePlanifi\303\251e.command.ts" "b/packages/domain/t\303\242che-planifi\303\251e/src/annuler/annulerT\303\242chePlanifi\303\251e.command.ts" index f2458893ae..af68f1f26a 100644 --- "a/packages/domain/t\303\242che-planifi\303\251e/src/annuler/annulerT\303\242chePlanifi\303\251e.command.ts" +++ "b/packages/domain/t\303\242che-planifi\303\251e/src/annuler/annulerT\303\242chePlanifi\303\251e.command.ts" @@ -20,10 +20,7 @@ export const registerAnnulerTâchePlanifiéeCommand = (loadAggregate: LoadAggreg typeTâchePlanifiée, }) => { const tâche = await loadTâchePlanifiée(typeTâchePlanifiée, identifiantProjet, false); - await tâche.annuler({ - typeTâchePlanifiée, - identifiantProjet, - }); + await tâche.annuler(); }; mediator.register('System.TâchePlanifiée.Command.AnnulerTâchePlanifiée', handler); }; diff --git "a/packages/domain/t\303\242che-planifi\303\251e/src/index.ts" "b/packages/domain/t\303\242che-planifi\303\251e/src/index.ts" index acb6253753..770749af6c 100644 --- "a/packages/domain/t\303\242che-planifi\303\251e/src/index.ts" +++ "b/packages/domain/t\303\242che-planifi\303\251e/src/index.ts" @@ -37,3 +37,8 @@ export * as StatutTâchePlanifiée from './statutTâchePlanifiée.valueType'; // Entities export * from './tâchePlanifiée.entity'; + +export { + loadTâchePlanifiéeAggregateFactory, + TâchePlanifiéeAggregate, +} from './tâchePlanifiée.aggregate'; diff --git "a/packages/domain/t\303\242che-planifi\303\251e/src/t\303\242chePlanifi\303\251e.aggregate.ts" "b/packages/domain/t\303\242che-planifi\303\251e/src/t\303\242chePlanifi\303\251e.aggregate.ts" index 5b62eda566..515f931ce2 100644 --- "a/packages/domain/t\303\242che-planifi\303\251e/src/t\303\242chePlanifi\303\251e.aggregate.ts" +++ "b/packages/domain/t\303\242che-planifi\303\251e/src/t\303\242chePlanifi\303\251e.aggregate.ts" @@ -1,4 +1,4 @@ -import { Aggregate, GetDefaultAggregateState, LoadAggregate } from '@potentiel-domain/core'; +import { Aggregate, AggregateState, LoadAggregate } from '@potentiel-domain/core'; import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import * as StatutTâchePlanifiée from './statutTâchePlanifiée.valueType'; @@ -25,8 +25,9 @@ export type TâchePlanifiéeEvent = | TâchePlanifiéeExecutéeEvent; export type TâchePlanifiéeAggregate = Aggregate & { + readonly identifiantProjet: IdentifiantProjet.ValueType; + readonly typeTâchePlanifiée: string; statut: StatutTâchePlanifiée.ValueType; - typeTâchePlanifiée: string; àExécuterLe: DateTime.ValueType; annuléeLe?: DateTime.ValueType; ajouter: typeof ajouter; @@ -34,13 +35,14 @@ export type TâchePlanifiéeAggregate = Aggregate & { exécuter: typeof exécuter; }; -export const getDefaultTâchePlanifiéeAggregate: GetDefaultAggregateState< - TâchePlanifiéeAggregate, - TâchePlanifiéeEvent -> = () => ({ - statut: StatutTâchePlanifiée.inconnu, +export const getDefaultTâchePlanifiéeAggregate = ( + typeTâchePlanifiée: string, + identifiantProjet: IdentifiantProjet.ValueType, +): AggregateState => ({ apply, - typeTâchePlanifiée: 'inconnue', + statut: StatutTâchePlanifiée.inconnu, + identifiantProjet, + typeTâchePlanifiée: typeTâchePlanifiée, àExécuterLe: DateTime.now(), ajouter, annuler, @@ -66,7 +68,7 @@ export const loadTâchePlanifiéeAggregateFactory = (type: string, identifiantProjet: IdentifiantProjet.ValueType, throwOnNone = true) => { return loadAggregate({ aggregateId: `tâche-planifiée|${type}#${identifiantProjet.formatter()}`, - getDefaultAggregate: getDefaultTâchePlanifiéeAggregate, + getDefaultAggregate: () => getDefaultTâchePlanifiéeAggregate(type, identifiantProjet), onNone: throwOnNone ? () => { throw new TâchePlanifiéeInconnueError(type, identifiantProjet.formatter()); diff --git "a/packages/domain/t\303\242che/src/saga/t\303\242cheGarantiesFinanci\303\250res.saga.ts" "b/packages/domain/t\303\242che/src/saga/t\303\242cheGarantiesFinanci\303\250res.saga.ts" index 4dc3ff6939..378efb7d33 100644 --- "a/packages/domain/t\303\242che/src/saga/t\303\242cheGarantiesFinanci\303\250res.saga.ts" +++ "b/packages/domain/t\303\242che/src/saga/t\303\242cheGarantiesFinanci\303\250res.saga.ts" @@ -1,8 +1,7 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { GarantiesFinancières } from '@potentiel-domain/laureat'; -import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; -import { AjouterTâchePlanifiéeCommand } from '@potentiel-domain/tache-planifiee'; +import { IdentifiantProjet } from '@potentiel-domain/common'; import { AjouterTâcheCommand } from '../ajouter/ajouterTâche.command'; import { AcheverTâcheCommand } from '../achever/acheverTâche.command'; @@ -11,8 +10,7 @@ import * as Tâche from '../typeTâche.valueType'; export type SubscriptionEvent = | GarantiesFinancières.GarantiesFinancièresDemandéesEvent | GarantiesFinancières.DépôtGarantiesFinancièresSoumisEvent - | GarantiesFinancières.GarantiesFinancièresEnregistréesEvent - | GarantiesFinancières.TypeGarantiesFinancièresImportéEvent; + | GarantiesFinancières.GarantiesFinancièresEnregistréesEvent; export type Execute = Message<'System.Saga.TâcheGarantiesFinancières', SubscriptionEvent>; @@ -41,39 +39,6 @@ export const register = () => { }, }); break; - case 'TypeGarantiesFinancièresImporté-V1': - const { - payload: { dateÉchéance }, - } = event; - - if (dateÉchéance) { - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AjouterTâchePlanifiée', - data: { - identifiantProjet: IdentifiantProjet.convertirEnValueType(identifiantProjet), - tâches: [ - { - typeTâchePlanifiée: - GarantiesFinancières.TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéance).ajouterNombreDeJours(1), - }, - { - typeTâchePlanifiée: - GarantiesFinancières.TypeTâchePlanifiéeGarantiesFinancières.rappelÉchéanceUnMois - .type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéance).retirerNombreDeMois(1), - }, - { - typeTâchePlanifiée: - GarantiesFinancières.TypeTâchePlanifiéeGarantiesFinancières - .rappelÉchéanceDeuxMois.type, - àExécuterLe: DateTime.convertirEnValueType(dateÉchéance).retirerNombreDeMois(2), - }, - ], - }, - }); - } - break; } }; diff --git "a/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/modifierGarantiesFinanci\303\250resActuelles.feature" "b/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/modifierGarantiesFinanci\303\250resActuelles.feature" index 5e3991a812..d93b1e8272 100644 --- "a/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/modifierGarantiesFinanci\303\250resActuelles.feature" +++ "b/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/modifierGarantiesFinanci\303\250resActuelles.feature" @@ -98,3 +98,14 @@ Fonctionnalité: Modifier des garanties financières actuelles Quand un admin modifie les garanties financières actuelles pour le projet "Du boulodrome de Marseille" avec : | date de constitution | 2020-01-01 | Alors l'utilisateur devrait être informé que "Vous ne pouvez pas déposer ou modifier des garanties financières car elles ont déjà été levées pour ce projet" + + Scénario: Une tâche du type "échoir les garanties financières" n'est pas ajoutée si une attestation de conformité est déjà transmise + Etant donné des garanties financières actuelles pour le projet "Du boulodrome de Marseille" avec : + | type GF | avec-date-échéance | + | date d'échéance | 2024-12-01 | + | date de validation | 2024-11-24 | + Et une attestation de conformité transmise pour le projet lauréat + Quand un admin modifie les garanties financières actuelles pour le projet "Du boulodrome de Marseille" avec : + | type GF | avec-date-échéance | + | date d'échéance | 2024-12-02 | + Alors une tâche "échoir les garanties financières" n'est plus planifiée pour le projet "Du boulodrome de Marseille" diff --git "a/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/stepDefinitions/garantiesFinanci\303\250resActuelles.when.ts" "b/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/stepDefinitions/garantiesFinanci\303\250resActuelles.when.ts" index 933f601d17..fea4307bb9 100644 --- "a/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/stepDefinitions/garantiesFinanci\303\250resActuelles.when.ts" +++ "b/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/stepDefinitions/garantiesFinanci\303\250resActuelles.when.ts" @@ -2,11 +2,7 @@ import { DataTable, When as Quand } from '@cucumber/cucumber'; import { mediator } from 'mediateur'; import { GarantiesFinancières } from '@potentiel-domain/laureat'; -import { - AjouterTâchePlanifiéeCommand, - ExécuterTâchePlanifiéeUseCase, -} from '@potentiel-domain/tache-planifiee'; -import { DateTime } from '@potentiel-domain/common'; +import { ExécuterTâchePlanifiéeUseCase } from '@potentiel-domain/tache-planifiee'; import { PotentielWorld } from '../../../../../potentiel.world'; import { corrigerCandidature } from '../../../../../candidature/stepDefinitions/candidature.when'; @@ -103,28 +99,11 @@ Quand( ); Quand( - `un admin échoie les garanties financières actuelles pour le projet {string} avec :`, - async function (this: PotentielWorld, nomProjet: string, dataTable: DataTable) { - const exemple = dataTable.rowsHash(); + `un admin échoie les garanties financières actuelles pour le projet {string}`, + async function (this: PotentielWorld, nomProjet: string) { try { const { identifiantProjet } = this.lauréatWorld.rechercherLauréatFixture(nomProjet); - const échuLeValue = new Date(exemple['à échoir le']).toISOString(); - - await mediator.send({ - type: 'System.TâchePlanifiée.Command.AjouterTâchePlanifiée', - data: { - identifiantProjet, - tâches: [ - { - typeTâchePlanifiée: - GarantiesFinancières.TypeTâchePlanifiéeGarantiesFinancières.échoir.type, - àExécuterLe: DateTime.convertirEnValueType(échuLeValue), - }, - ], - }, - }); - await mediator.send({ type: 'System.TâchePlanifiée.UseCase.ExécuterTâchePlanifiée', data: { diff --git "a/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/\303\251choirGarantiesFinanci\303\250resActuelles.feature" "b/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/\303\251choirGarantiesFinanci\303\250resActuelles.feature" index bc09a70c0b..72ee0fdf43 100644 --- "a/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/\303\251choirGarantiesFinanci\303\250resActuelles.feature" +++ "b/packages/specifications/src/projet/laur\303\251at/garantiesFinanci\303\250res/actuelles/\303\251choirGarantiesFinanci\303\250resActuelles.feature" @@ -10,8 +10,7 @@ Fonctionnalité: Échoir les garanties financières actuelles d'un projet Etant donné des garanties financières actuelles pour le projet "Du boulodrome de Marseille" avec : | type GF | avec-date-échéance | | date d'échéance | 2024-07-17 | - Quand un admin échoie les garanties financières actuelles pour le projet "Du boulodrome de Marseille" avec : - | à échoir le | 2024-07-18 | + Quand un admin échoie les garanties financières actuelles pour le projet "Du boulodrome de Marseille" Alors les garanties financières actuelles du projet "Du boulodrome de Marseille" sont échues Et un email a été envoyé au porteur avec : | sujet | Potentiel - Date d'échéance dépassée pour les garanties financières du projet Du boulodrome de Marseille dans le département(.*) | @@ -29,7 +28,7 @@ Fonctionnalité: Échoir les garanties financières actuelles d'un projet Et une demande d'abandon en cours pour le projet lauréat Quand le DGEC validateur accorde l'abandon pour le projet lauréat Alors l'abandon du projet lauréat devrait être accordé - Et une tâche indiquant de "échoir les garanties financières" n'est plus consultable dans la liste des tâches du porteur pour le projet + Et une tâche "échoir les garanties financières" n'est plus planifiée pour le projet "Du boulodrome de Marseille" @NotImplemented Scénario: Impossible d'échoir les garanties financières actuelles d'un projet si il n'y a pas de garanties financières actuelles pour ce projet diff --git "a/packages/specifications/src/t\303\242che/t\303\242che.world.ts" "b/packages/specifications/src/t\303\242che/t\303\242che.world.ts" index 73ea165fdd..3cd2d2c03f 100644 --- "a/packages/specifications/src/t\303\242che/t\303\242che.world.ts" +++ "b/packages/specifications/src/t\303\242che/t\303\242che.world.ts" @@ -5,7 +5,6 @@ export type RechercherTypeTâche = | 'confirmer un abandon' | 'transmettre les garanties financières' | 'mettre à jour le gestionnaire de réseau' - | 'échoir les garanties financières' | 'transmettre une référence de raccordement'; export class TâcheWorld { @@ -15,8 +14,6 @@ export class TâcheWorld { return TypeTâche.abandonTransmettrePreuveRecandidature; case 'confirmer un abandon': return TypeTâche.abandonConfirmer; - case 'échoir les garanties financières': - return TypeTâche.garantiesFinancieresEchoir; case 'transmettre les garanties financières': return TypeTâche.garantiesFinancièresDemander; case 'mettre à jour le gestionnaire de réseau': From 45906ba20e6580555b504b1e8653f8d47f87e4ad Mon Sep 17 00:00:00 2001 From: Benjamin Levesque <14175665+benjlevesque@users.noreply.github.com> Date: Fri, 14 Feb 2025 18:33:53 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Renames,=20permissi?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/abandon/accorder/accorderAbandon.usecase.ts" | 4 ++-- ...ansmettreAttestationConformit\303\251.usecase.ts" | 4 ++-- ...p\303\264tGarantiesFinanci\303\250res.usecase.ts" | 4 ++-- ...64tGarantiesFinanci\303\250resEnCours.usecase.ts" | 4 ++-- ...64tGarantiesFinanci\303\250resEnCours.usecase.ts" | 4 ++-- .../garantiesFinanci\303\250res.aggregate.ts" | 12 ++++++------ ...nregistrerGarantiesFinanci\303\250res.usecase.ts" | 4 ++-- ...orterTypeGarantiesFinanci\303\250res.behavior.ts" | 2 +- .../modifierGarantiesFinanci\303\250res.usecase.ts" | 4 ++-- .../ajouter/ajouter.behavior.ts" | 2 +- .../ajouter/ajouter.command.ts" | 8 ++++---- .../annuler/annuler.behavior.ts" | 2 +- .../annuler/annuler.command.ts" | 8 ++++---- .../t\303\242ches-planifi\303\251es.register.ts" | 8 ++++---- packages/domain/utilisateur/src/role.valueType.ts | 9 +++++++++ 15 files changed, 44 insertions(+), 35 deletions(-) rename "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.behavior.ts" => "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.behavior.ts" (95%) rename "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.command.ts" => "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" (89%) rename "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.behavior.ts" => "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.behavior.ts" (93%) rename "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.command.ts" => "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" (87%) diff --git "a/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" "b/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" index 6a16670cfb..1ab282bbe6 100644 --- "a/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" @@ -9,7 +9,7 @@ import { DocumentProjet, EnregistrerDocumentProjetCommand } from '@potentiel-dom // Package import * as TypeDocumentAbandon from '../typeDocumentAbandon.valueType'; -import { AnnulerTâchesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annulerTâches.command'; +import { AnnulerTâchesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annuler.command'; import { AccorderAbandonCommand } from './accorderAbandon.command'; @@ -65,7 +65,7 @@ export const registerAccorderAbandonUseCase = () => { }); await mediator.send({ - type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâches', + type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', data: { identifiantProjet, }, diff --git "a/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" "b/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" index 79770fe586..f3e0641669 100644 --- "a/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" @@ -5,7 +5,7 @@ import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { TypeDocumentAchèvement } from '..'; -import { AnnulerTâchesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annulerTâches.command'; +import { AnnulerTâchesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annuler.command'; import { TransmettreAttestationConformitéCommand } from './transmettreAttestationConformité.command'; @@ -85,7 +85,7 @@ export const registerTransmettreAttestationConformitéUseCase = () => { }); await mediator.send({ - type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâches', + type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', data: { identifiantProjet, }, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" index 4e554d53eb..9e9a2672c9 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" @@ -6,7 +6,7 @@ import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { Candidature } from '@potentiel-domain/candidature'; import { TypeDocumentGarantiesFinancières } from '../..'; -import { AnnulerTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/annuler/annulerTâches.command'; +import { AnnulerTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/annuler/annuler.command'; import { SoumettreDépôtGarantiesFinancièresCommand } from './soumettreDépôtGarantiesFinancières.command'; @@ -74,7 +74,7 @@ export const registerSoumettreDépôtGarantiesFinancièresUseCase = () => { }); await mediator.send({ - type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâches', + type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', data: { identifiantProjet, }, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" index 2af018afb9..49f060372d 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" @@ -3,7 +3,7 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; -import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouterTâches.command'; +import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; import { SupprimerDépôtGarantiesFinancièresEnCoursCommand } from './supprimerDépôtGarantiesFinancièresEnCours.command'; @@ -38,7 +38,7 @@ export const registerSupprimerGarantiesFinancièresÀTraiterUseCase = () => { }); await mediator.send({ - type: 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + type: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', data: { identifiantProjet, dateÉchéance: dateÉchéanceValue diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" index 7f619bded7..9a573a13a5 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" @@ -5,7 +5,7 @@ import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { DocumentProjetCommand, DossierProjet } from '@potentiel-domain/document'; import { TypeDocumentGarantiesFinancières } from '../..'; -import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouterTâches.command'; +import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; import { ValiderDépôtGarantiesFinancièresEnCoursCommand } from './validerDépôtGarantiesFinancièresEnCours.command'; @@ -54,7 +54,7 @@ export const registerValiderDépôtGarantiesFinancièresEnCoursUseCase = () => { }); await mediator.send({ - type: 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + type: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', data: { identifiantProjet, dateÉchéance: dateÉchéanceValue diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250res.aggregate.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250res.aggregate.ts" index 52f67cb46f..10b81dacff 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250res.aggregate.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250res.aggregate.ts" @@ -96,8 +96,8 @@ import { GarantiesFinancièresÉchuesEvent, échoir, } from './garantiesFinancièresActuelles/échoir/échoirGarantiesFinancières.behavior'; -import { ajouterTâches } from './tâches-planifiées/ajouter/ajouterTâches.behavior'; -import { annulerTâches } from './tâches-planifiées/annuler/annulerTâches.behavior'; +import { ajouterTâchesPlanifiées } from './tâches-planifiées/ajouter/ajouter.behavior'; +import { annulerTâchesPlanifiées } from './tâches-planifiées/annuler/annuler.behavior'; export type GarantiesFinancièresEvent = | DépôtGarantiesFinancièresSoumisEvent @@ -157,8 +157,8 @@ export type GarantiesFinancièresAggregate = Aggregate { }); await mediator.send({ - type: 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + type: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', data: { identifiantProjet, dateÉchéance: dateÉchéanceValue diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.behavior.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.behavior.ts" index 872af181aa..1b7d75c3f7 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.behavior.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/importer/importerTypeGarantiesFinanci\303\250res.behavior.ts" @@ -56,7 +56,7 @@ export async function importerType( }, }; - await this.ajouterTâches({ + await this.ajouterTâchesPlanifiées({ dateÉchéance, tâchePlanifiéeEchoir, tâchePlanifiéeRappel1mois, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" index 7aece6d9d8..43b8db6613 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" @@ -6,7 +6,7 @@ import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { Candidature } from '@potentiel-domain/candidature'; import { TypeDocumentGarantiesFinancières } from '../..'; -import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouterTâches.command'; +import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; import { ModifierGarantiesFinancièresCommand } from './modifierGarantiesFinancières.command'; @@ -73,7 +73,7 @@ export const registerModifierGarantiesFinancièresUseCase = () => { }); await mediator.send({ - type: 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + type: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', data: { identifiantProjet, dateÉchéance, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.behavior.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.behavior.ts" similarity index 95% rename from "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.behavior.ts" rename to "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.behavior.ts" index b269b30d02..c57f7211ce 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.behavior.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.behavior.ts" @@ -13,7 +13,7 @@ type AjouterTâchesOptions = { tâchePlanifiéeRappel2mois: TâchePlanifiéeAggregate; }; -export async function ajouterTâches( +export async function ajouterTâchesPlanifiées( this: GarantiesFinancièresAggregate, { estAchevé, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" similarity index 89% rename from "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.command.ts" rename to "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" index a53c6f63a4..0a7ef78aff 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouterT\303\242ches.command.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" @@ -9,14 +9,14 @@ import { loadAchèvementFactory } from '../../../achèvement/achèvement.aggrega import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; export type AjouterTâchesGarantiesFinancièresCommand = Message< - 'Lauréat.GarantiesFinancières.Command.AjouterTâches', + 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', { identifiantProjet: IdentifiantProjet.ValueType; dateÉchéance?: DateTime.ValueType; } >; -export const registerAjouterTâchesCommand = (loadAggregate: LoadAggregate) => { +export const registerAjouterTâchesPlanfiéesCommand = (loadAggregate: LoadAggregate) => { const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); const loadAchèvement = loadAchèvementFactory(loadAggregate); const loadTâchePlanifiée = loadTâchePlanifiéeAggregateFactory(loadAggregate); @@ -41,7 +41,7 @@ export const registerAjouterTâchesCommand = (loadAggregate: LoadAggregate) => { identifiantProjet, false, ); - await garantiesFinancières.ajouterTâches({ + await garantiesFinancières.ajouterTâchesPlanifiées({ tâchePlanifiéeEchoir, tâchePlanifiéeRappel1mois, tâchePlanifiéeRappel2mois, @@ -50,5 +50,5 @@ export const registerAjouterTâchesCommand = (loadAggregate: LoadAggregate) => { }); }; - mediator.register('Lauréat.GarantiesFinancières.Command.AjouterTâches', handler); + mediator.register('Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', handler); }; diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.behavior.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.behavior.ts" similarity index 93% rename from "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.behavior.ts" rename to "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.behavior.ts" index 96d65e82b9..64607e725f 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.behavior.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.behavior.ts" @@ -9,7 +9,7 @@ type annulerTâchesOptions = { tâchePlanifiéeRappel2mois: TâchePlanifiéeAggregate; }; -export async function annulerTâches( +export async function annulerTâchesPlanifiées( this: GarantiesFinancièresAggregate, { tâchePlanifiéeEchoir, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" similarity index 87% rename from "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.command.ts" rename to "packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" index 3b239c6038..c10f51788b 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annulerT\303\242ches.command.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" @@ -8,13 +8,13 @@ import { loadGarantiesFinancièresFactory } from '../../garantiesFinancières.ag import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; export type AnnulerTâchesGarantiesFinancièresCommand = Message< - 'Lauréat.GarantiesFinancières.Command.AnnulerTâches', + 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', { identifiantProjet: IdentifiantProjet.ValueType; } >; -export const registerAnnulerTâchesCommand = (loadAggregate: LoadAggregate) => { +export const registerAnnulerTâchesPlanifiéesCommand = (loadAggregate: LoadAggregate) => { const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); const loadTâchePlanifiée = loadTâchePlanifiéeAggregateFactory(loadAggregate); const handler: MessageHandler = async ({ @@ -36,12 +36,12 @@ export const registerAnnulerTâchesCommand = (loadAggregate: LoadAggregate) => { identifiantProjet, false, ); - await garantiesFinancières.annulerTâches({ + await garantiesFinancières.annulerTâchesPlanifiées({ tâchePlanifiéeEchoir, tâchePlanifiéeRappel1mois, tâchePlanifiéeRappel2mois, }); }; - mediator.register('Lauréat.GarantiesFinancières.Command.AnnulerTâches', handler); + mediator.register('Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', handler); }; diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/t\303\242ches-planifi\303\251es.register.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/t\303\242ches-planifi\303\251es.register.ts" index 18054f6947..1750947d31 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/t\303\242ches-planifi\303\251es.register.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/t\303\242ches-planifi\303\251es.register.ts" @@ -1,10 +1,10 @@ import { LoadAggregate } from '@potentiel-domain/core'; -import { registerAjouterTâchesCommand } from './ajouter/ajouterTâches.command'; -import { registerAnnulerTâchesCommand } from './annuler/annulerTâches.command'; +import { registerAjouterTâchesPlanfiéesCommand } from './ajouter/ajouter.command'; +import { registerAnnulerTâchesPlanifiéesCommand } from './annuler/annuler.command'; export const registerTâchesPlanifiées = (loadAggregate: LoadAggregate) => { // commands - registerAjouterTâchesCommand(loadAggregate); - registerAnnulerTâchesCommand(loadAggregate); + registerAjouterTâchesPlanfiéesCommand(loadAggregate); + registerAnnulerTâchesPlanifiéesCommand(loadAggregate); }; diff --git a/packages/domain/utilisateur/src/role.valueType.ts b/packages/domain/utilisateur/src/role.valueType.ts index 2d800fbea2..108b0985ba 100644 --- a/packages/domain/utilisateur/src/role.valueType.ts +++ b/packages/domain/utilisateur/src/role.valueType.ts @@ -221,6 +221,8 @@ const référencielPermissions = { 'Lauréat.GarantiesFinancières.Mainlevée.Command.AccorderDemandeMainlevée', rejeterDemandeMainlevée: 'Lauréat.GarantiesFinancières.Mainlevée.Command.RejeterDemandeMainlevée', + ajouterTâchesPlanifiées: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', + annulerTâchesPlanifiées: 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', }, }, achèvement: { @@ -468,6 +470,7 @@ const policies = { référencielPermissions.lauréat.abandon.query.consulter, référencielPermissions.lauréat.abandon.usecase.accorder, référencielPermissions.lauréat.abandon.command.accorder, + référencielPermissions.lauréat.garantiesFinancières.command.annulerTâchesPlanifiées, ], rejeter: [ référencielPermissions.candidature.query.consulterProjet, @@ -586,17 +589,20 @@ const policies = { référencielPermissions.lauréat.garantiesFinancières.usecase.soumettre, référencielPermissions.lauréat.garantiesFinancières.command.soumettre, référencielPermissions.document.command.enregister, + référencielPermissions.lauréat.garantiesFinancières.command.annulerTâchesPlanifiées, ], valider: [ référencielPermissions.lauréat.garantiesFinancières.usecase.valider, référencielPermissions.lauréat.garantiesFinancières.command.valider, référencielPermissions.document.command.déplacer, + référencielPermissions.lauréat.garantiesFinancières.command.ajouterTâchesPlanifiées, ], supprimer: [ référencielPermissions.lauréat.garantiesFinancières.usecase .supprimerGarantiesFinancièresÀTraiter, référencielPermissions.lauréat.garantiesFinancières.command .supprimerGarantiesFinancièresÀTraiter, + référencielPermissions.lauréat.garantiesFinancières.command.ajouterTâchesPlanifiées, ], modifier: [ référencielPermissions.appelOffre.query.consulter, @@ -632,6 +638,7 @@ const policies = { référencielPermissions.document.command.enregister, référencielPermissions.lauréat.garantiesFinancières.usecase.modifier, référencielPermissions.lauréat.garantiesFinancières.command.modifier, + référencielPermissions.lauréat.garantiesFinancières.command.ajouterTâchesPlanifiées, ], enregistrerAttestation: [ référencielPermissions.appelOffre.query.consulter, @@ -643,6 +650,7 @@ const policies = { référencielPermissions.document.command.enregister, référencielPermissions.lauréat.garantiesFinancières.usecase.enregistrer, référencielPermissions.lauréat.garantiesFinancières.command.enregistrer, + référencielPermissions.lauréat.garantiesFinancières.command.ajouterTâchesPlanifiées, ], }, mainlevée: { @@ -699,6 +707,7 @@ const policies = { transmettre: [ référencielPermissions.lauréat.achèvement.useCase.transmettre, référencielPermissions.lauréat.achèvement.command.transmettre, + référencielPermissions.lauréat.garantiesFinancières.command.annulerTâchesPlanifiées, référencielPermissions.document.command.enregister, ], modifier: [ From 9965ed312f93ebf9d19304d4beea9aa468f55623 Mon Sep 17 00:00:00 2001 From: Benjamin Levesque <14175665+benjlevesque@users.noreply.github.com> Date: Fri, 14 Feb 2025 18:40:05 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=90=9B=20Fix=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" index c10f51788b..c4c1278dbe 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" @@ -20,7 +20,7 @@ export const registerAnnulerTâchesPlanifiéesCommand = (loadAggregate: LoadAggr const handler: MessageHandler = async ({ identifiantProjet, }) => { - const garantiesFinancières = await loadGarantiesFinancières(identifiantProjet); + const garantiesFinancières = await loadGarantiesFinancières(identifiantProjet, false); const tâchePlanifiéeEchoir = await loadTâchePlanifiée( TypeTâchePlanifiéeGarantiesFinancières.échoir.type, identifiantProjet, From 7a149a149e4fd4bfafe56babe68dc631140f97ff Mon Sep 17 00:00:00 2001 From: Benjamin Levesque <14175665+benjlevesque@users.noreply.github.com> Date: Mon, 17 Feb 2025 15:04:48 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=9A=9A=20Rename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/abandon/accorder/accorderAbandon.usecase.ts" | 4 ++-- .../transmettreAttestationConformit\303\251.usecase.ts" | 4 ++-- ...D\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" | 4 ++-- ...51p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" | 4 ++-- ...51p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" | 4 ++-- .../enregistrerGarantiesFinanci\303\250res.usecase.ts" | 4 ++-- .../modifier/modifierGarantiesFinanci\303\250res.usecase.ts" | 4 ++-- .../ajouter/ajouter.command.ts" | 4 ++-- .../annuler/annuler.command.ts" | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git "a/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" "b/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" index 1ab282bbe6..6f9a8df676 100644 --- "a/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/abandon/accorder/accorderAbandon.usecase.ts" @@ -9,7 +9,7 @@ import { DocumentProjet, EnregistrerDocumentProjetCommand } from '@potentiel-dom // Package import * as TypeDocumentAbandon from '../typeDocumentAbandon.valueType'; -import { AnnulerTâchesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annuler.command'; +import { AnnulerTâchesPlanifiéesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annuler.command'; import { AccorderAbandonCommand } from './accorderAbandon.command'; @@ -64,7 +64,7 @@ export const registerAccorderAbandonUseCase = () => { }, }); - await mediator.send({ + await mediator.send({ type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', data: { identifiantProjet, diff --git "a/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" "b/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" index f3e0641669..0c1f6c65bf 100644 --- "a/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/ach\303\250vement/transmettre/transmettreAttestationConformit\303\251.usecase.ts" @@ -5,7 +5,7 @@ import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { TypeDocumentAchèvement } from '..'; -import { AnnulerTâchesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annuler.command'; +import { AnnulerTâchesPlanifiéesGarantiesFinancièresCommand } from '../../garantiesFinancières/tâches-planifiées/annuler/annuler.command'; import { TransmettreAttestationConformitéCommand } from './transmettreAttestationConformité.command'; @@ -84,7 +84,7 @@ export const registerTransmettreAttestationConformitéUseCase = () => { }, }); - await mediator.send({ + await mediator.send({ type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', data: { identifiantProjet, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" index 9e9a2672c9..8509177399 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/soumettreD\303\251p\303\264t/soumettreD\303\251p\303\264tGarantiesFinanci\303\250res.usecase.ts" @@ -6,7 +6,7 @@ import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { Candidature } from '@potentiel-domain/candidature'; import { TypeDocumentGarantiesFinancières } from '../..'; -import { AnnulerTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/annuler/annuler.command'; +import { AnnulerTâchesPlanifiéesGarantiesFinancièresCommand } from '../../tâches-planifiées/annuler/annuler.command'; import { SoumettreDépôtGarantiesFinancièresCommand } from './soumettreDépôtGarantiesFinancières.command'; @@ -73,7 +73,7 @@ export const registerSoumettreDépôtGarantiesFinancièresUseCase = () => { }, }); - await mediator.send({ + await mediator.send({ type: 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', data: { identifiantProjet, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" index 49f060372d..8ffac2e2f5 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tEnCours/supprimerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" @@ -3,7 +3,7 @@ import { Message, MessageHandler, mediator } from 'mediateur'; import { DateTime, IdentifiantProjet } from '@potentiel-domain/common'; import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; -import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; +import { AjouterTâchesPlanifiéesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; import { SupprimerDépôtGarantiesFinancièresEnCoursCommand } from './supprimerDépôtGarantiesFinancièresEnCours.command'; @@ -37,7 +37,7 @@ export const registerSupprimerGarantiesFinancièresÀTraiterUseCase = () => { }, }); - await mediator.send({ + await mediator.send({ type: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', data: { identifiantProjet, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" index 9a573a13a5..2cc2ce7c90 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/d\303\251p\303\264tEnCours/validerD\303\251p\303\264tEnCours/validerD\303\251p\303\264tGarantiesFinanci\303\250resEnCours.usecase.ts" @@ -5,7 +5,7 @@ import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { DocumentProjetCommand, DossierProjet } from '@potentiel-domain/document'; import { TypeDocumentGarantiesFinancières } from '../..'; -import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; +import { AjouterTâchesPlanifiéesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; import { ValiderDépôtGarantiesFinancièresEnCoursCommand } from './validerDépôtGarantiesFinancièresEnCours.command'; @@ -53,7 +53,7 @@ export const registerValiderDépôtGarantiesFinancièresEnCoursUseCase = () => { }, }); - await mediator.send({ + await mediator.send({ type: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', data: { identifiantProjet, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/enregistrer/enregistrerGarantiesFinanci\303\250res.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/enregistrer/enregistrerGarantiesFinanci\303\250res.usecase.ts" index ce8fcd2862..60b991d2ec 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/enregistrer/enregistrerGarantiesFinanci\303\250res.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/enregistrer/enregistrerGarantiesFinanci\303\250res.usecase.ts" @@ -6,7 +6,7 @@ import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { Candidature } from '@potentiel-domain/candidature'; import { TypeDocumentGarantiesFinancières } from '../..'; -import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; +import { AjouterTâchesPlanifiéesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; import { EnregistrerGarantiesFinancièresCommand } from './enregistrerGarantiesFinancières.command'; @@ -72,7 +72,7 @@ export const registerEnregistrerGarantiesFinancièresUseCase = () => { }, }); - await mediator.send({ + await mediator.send({ type: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', data: { identifiantProjet, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" index 43b8db6613..4ab7084e9c 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/garantiesFinanci\303\250resActuelles/modifier/modifierGarantiesFinanci\303\250res.usecase.ts" @@ -6,7 +6,7 @@ import { IdentifiantUtilisateur } from '@potentiel-domain/utilisateur'; import { Candidature } from '@potentiel-domain/candidature'; import { TypeDocumentGarantiesFinancières } from '../..'; -import { AjouterTâchesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; +import { AjouterTâchesPlanifiéesGarantiesFinancièresCommand } from '../../tâches-planifiées/ajouter/ajouter.command'; import { ModifierGarantiesFinancièresCommand } from './modifierGarantiesFinancières.command'; @@ -72,7 +72,7 @@ export const registerModifierGarantiesFinancièresUseCase = () => { }, }); - await mediator.send({ + await mediator.send({ type: 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', data: { identifiantProjet, diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" index 0a7ef78aff..1a5a4ce965 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" @@ -8,7 +8,7 @@ import { loadGarantiesFinancièresFactory } from '../../garantiesFinancières.ag import { loadAchèvementFactory } from '../../../achèvement/achèvement.aggregate'; import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; -export type AjouterTâchesGarantiesFinancièresCommand = Message< +export type AjouterTâchesPlanifiéesGarantiesFinancièresCommand = Message< 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', { identifiantProjet: IdentifiantProjet.ValueType; @@ -20,7 +20,7 @@ export const registerAjouterTâchesPlanfiéesCommand = (loadAggregate: LoadAggre const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); const loadAchèvement = loadAchèvementFactory(loadAggregate); const loadTâchePlanifiée = loadTâchePlanifiéeAggregateFactory(loadAggregate); - const handler: MessageHandler = async ({ + const handler: MessageHandler = async ({ identifiantProjet, dateÉchéance, }) => { diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" index c4c1278dbe..9a0a9d4a2a 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" @@ -7,7 +7,7 @@ import { loadTâchePlanifiéeAggregateFactory } from '@potentiel-domain/tache-pl import { loadGarantiesFinancièresFactory } from '../../garantiesFinancières.aggregate'; import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; -export type AnnulerTâchesGarantiesFinancièresCommand = Message< +export type AnnulerTâchesPlanifiéesGarantiesFinancièresCommand = Message< 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', { identifiantProjet: IdentifiantProjet.ValueType; @@ -17,7 +17,7 @@ export type AnnulerTâchesGarantiesFinancièresCommand = Message< export const registerAnnulerTâchesPlanifiéesCommand = (loadAggregate: LoadAggregate) => { const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); const loadTâchePlanifiée = loadTâchePlanifiéeAggregateFactory(loadAggregate); - const handler: MessageHandler = async ({ + const handler: MessageHandler = async ({ identifiantProjet, }) => { const garantiesFinancières = await loadGarantiesFinancières(identifiantProjet, false); From b74f0511e47225d044c396dacfe6b8f61e9f530d Mon Sep 17 00:00:00 2001 From: Benjamin Levesque <14175665+benjlevesque@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:07:45 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=92=A1=20Ajout=20commentaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ajouter/ajouter.command.ts" | 5 +++++ .../annuler/annuler.command.ts" | 5 +++++ 2 files changed, 10 insertions(+) diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" index 1a5a4ce965..97925e68eb 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/ajouter/ajouter.command.ts" @@ -8,6 +8,10 @@ import { loadGarantiesFinancièresFactory } from '../../garantiesFinancières.ag import { loadAchèvementFactory } from '../../../achèvement/achèvement.aggregate'; import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; +/** + * @deprecated Cette commande est temporaire pour permettre l'appel au behavior, + * qui à terme sera fait directement depuis le behavior appelant, via l'aggregate root. + **/ export type AjouterTâchesPlanifiéesGarantiesFinancièresCommand = Message< 'Lauréat.GarantiesFinancières.Command.AjouterTâchesPlanifiées', { @@ -16,6 +20,7 @@ export type AjouterTâchesPlanifiéesGarantiesFinancièresCommand = Message< } >; +/** @deprecated */ export const registerAjouterTâchesPlanfiéesCommand = (loadAggregate: LoadAggregate) => { const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); const loadAchèvement = loadAchèvementFactory(loadAggregate); diff --git "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" index 9a0a9d4a2a..180c1b7ab2 100644 --- "a/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" +++ "b/packages/domain/laur\303\251at/src/garantiesFinanci\303\250res/t\303\242ches-planifi\303\251es/annuler/annuler.command.ts" @@ -7,6 +7,10 @@ import { loadTâchePlanifiéeAggregateFactory } from '@potentiel-domain/tache-pl import { loadGarantiesFinancièresFactory } from '../../garantiesFinancières.aggregate'; import * as TypeTâchePlanifiéeGarantiesFinancières from '../../typeTâchePlanifiéeGarantiesFinancières.valueType'; +/** + * @deprecated Cette commande est temporaire pour permettre l'appel au behavior, + * qui à terme sera fait directement depuis le behavior appelant, via l'aggregate root. + **/ export type AnnulerTâchesPlanifiéesGarantiesFinancièresCommand = Message< 'Lauréat.GarantiesFinancières.Command.AnnulerTâchesPlanifiées', { @@ -14,6 +18,7 @@ export type AnnulerTâchesPlanifiéesGarantiesFinancièresCommand = Message< } >; +/** @deprecated */ export const registerAnnulerTâchesPlanifiéesCommand = (loadAggregate: LoadAggregate) => { const loadGarantiesFinancières = loadGarantiesFinancièresFactory(loadAggregate); const loadTâchePlanifiée = loadTâchePlanifiéeAggregateFactory(loadAggregate);