From 9fdb0777f619e4df5bef9584aaed37016ba35f82 Mon Sep 17 00:00:00 2001 From: Benjamin Daubry Date: Thu, 31 Oct 2024 15:19:07 +0100 Subject: [PATCH] Financabilite : versionning / strategy pattern --- .../use_case/write/soumettre_proposition_service.py | 10 +++++----- .../use_case/write/soumettre_proposition_service.py | 8 ++++---- .../admission/doctorat/preparation/handlers.py | 4 ++-- .../admission/formation_generale/handlers.py | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ddd/admission/doctorat/preparation/use_case/write/soumettre_proposition_service.py b/ddd/admission/doctorat/preparation/use_case/write/soumettre_proposition_service.py index f589e9b19..57a657811 100644 --- a/ddd/admission/doctorat/preparation/use_case/write/soumettre_proposition_service.py +++ b/ddd/admission/doctorat/preparation/use_case/write/soumettre_proposition_service.py @@ -49,14 +49,14 @@ from admission.ddd.admission.domain.service.i_maximum_propositions import IMaximumPropositionsAutorisees from admission.ddd.admission.domain.service.i_profil_candidat import IProfilCandidatTranslator from admission.ddd.admission.domain.service.i_titres_acces import ITitresAcces -from admission.ddd.admission.enums.question_specifique import Onglets from admission.ddd.admission.domain.service.profil_soumis_candidat import ( ProfilSoumisCandidatTranslator, ) +from admission.ddd.admission.enums.question_specifique import Onglets from base.models.enums.academic_calendar_type import AcademicCalendarTypes from ddd.logic.financabilite.domain.model.enums.etat import EtatFinancabilite -from ddd.logic.financabilite.domain.service.financabilite import Financabilite -from ddd.logic.financabilite.domain.service.i_financabilite import IFinancabiliteFetcher +from ddd.logic.financabilite.domain.service.algorithmes.v2024.algorithme import Algorithme2024 +from ddd.logic.financabilite.domain.service.i_fetcher import IFetcher from ddd.logic.shared_kernel.academic_year.domain.service.get_current_academic_year import GetCurrentAcademicYear from ddd.logic.shared_kernel.academic_year.repository.i_academic_year import IAcademicYearRepository @@ -77,7 +77,7 @@ def soumettre_proposition( calendrier_inscription: 'ICalendrierInscription', element_confirmation: 'IElementsConfirmation', maximum_propositions_service: 'IMaximumPropositionsAutorisees', - financabilite_fetcher: 'IFinancabiliteFetcher', + financabilite_fetcher: 'IFetcher', ) -> 'PropositionIdentity': # GIVEN proposition_id = PropositionIdentityBuilder.build_from_uuid(cmd.uuid_proposition) @@ -160,7 +160,7 @@ def soumettre_proposition( ) # THEN - financabilite = Financabilite( + financabilite = Algorithme2024( parcours=parcours, formation=formation_dto, est_en_reorientation=False, diff --git a/ddd/admission/formation_generale/use_case/write/soumettre_proposition_service.py b/ddd/admission/formation_generale/use_case/write/soumettre_proposition_service.py index fa58f74dd..1ab65ab27 100644 --- a/ddd/admission/formation_generale/use_case/write/soumettre_proposition_service.py +++ b/ddd/admission/formation_generale/use_case/write/soumettre_proposition_service.py @@ -54,8 +54,8 @@ from admission.ddd.admission.formation_generale.repository.i_proposition import IPropositionRepository from base.models.enums.academic_calendar_type import AcademicCalendarTypes from ddd.logic.financabilite.domain.model.enums.etat import EtatFinancabilite -from ddd.logic.financabilite.domain.model.enums.situation import SituationFinancabilite -from ddd.logic.financabilite.domain.service.financabilite import Financabilite +from ddd.logic.financabilite.domain.service.algorithmes.v2024.algorithme import Algorithme2024 +from ddd.logic.financabilite.domain.service.i_fetcher import IFetcher from ddd.logic.shared_kernel.academic_year.domain.service.get_current_academic_year import GetCurrentAcademicYear from ddd.logic.shared_kernel.academic_year.repository.i_academic_year import IAcademicYearRepository @@ -76,7 +76,7 @@ def soumettre_proposition( inscription_tardive_service: 'IInscriptionTardive', paiement_frais_dossier_service: 'IPaiementFraisDossier', historique: 'IHistorique', - financabilite_fetcher: 'IFinancabiliteFetcher', + financabilite_fetcher: 'IFetcher', ) -> 'PropositionIdentity': # GIVEN proposition_id = PropositionIdentityBuilder.build_from_uuid(cmd.uuid_proposition) @@ -159,7 +159,7 @@ def soumettre_proposition( est_inscription_tardive = inscription_tardive_service.est_inscription_tardive(pool) # THEN - financabilite = Financabilite( + financabilite = Algorithme2024( parcours=parcours, formation=formation_dto, est_en_reorientation=proposition.est_reorientation_inscription_externe, diff --git a/infrastructure/admission/doctorat/preparation/handlers.py b/infrastructure/admission/doctorat/preparation/handlers.py index 5bee4e3e5..fed4d7751 100644 --- a/infrastructure/admission/doctorat/preparation/handlers.py +++ b/infrastructure/admission/doctorat/preparation/handlers.py @@ -46,7 +46,7 @@ AnneeInscriptionFormationTranslator, ) from admission.infrastructure.admission.domain.service.profil_candidat import ProfilCandidatTranslator -from infrastructure.financabilite.domain.service.financabilite import FinancabiliteFetcher +from infrastructure.financabilite.domain.service.financabilite_fetcher import Fetcher from infrastructure.shared_kernel.academic_year.repository.academic_year import AcademicYearRepository from infrastructure.shared_kernel.campus.repository.uclouvain_campus import UclouvainCampusRepository from infrastructure.shared_kernel.personne_connue_ucl.personne_connue_ucl import PersonneConnueUclTranslator @@ -198,7 +198,7 @@ calendrier_inscription=CalendrierInscription(), element_confirmation=ElementsConfirmation(), maximum_propositions_service=MaximumPropositionsAutorisees(), - financabilite_fetcher=FinancabiliteFetcher(), + financabilite_fetcher=Fetcher(), ), DefinirCotutelleCommand: lambda msg_bus, cmd: definir_cotutelle( cmd, diff --git a/infrastructure/admission/formation_generale/handlers.py b/infrastructure/admission/formation_generale/handlers.py index f34c20480..2385e13ab 100644 --- a/infrastructure/admission/formation_generale/handlers.py +++ b/infrastructure/admission/formation_generale/handlers.py @@ -161,7 +161,7 @@ from admission.infrastructure.admission.shared_kernel.email_destinataire.repository.email_destinataire import ( EmailDestinataireRepository, ) -from infrastructure.financabilite.domain.service.financabilite import FinancabiliteFetcher +from infrastructure.financabilite.domain.service.financabilite_fetcher import Fetcher from infrastructure.shared_kernel.academic_year.repository.academic_year import AcademicYearRepository from infrastructure.shared_kernel.campus.repository.uclouvain_campus import UclouvainCampusRepository from infrastructure.shared_kernel.personne_connue_ucl.personne_connue_ucl import PersonneConnueUclTranslator @@ -245,7 +245,7 @@ def _call_if_digit_switch_active(callable_fn): inscription_tardive_service=InscriptionTardive(), paiement_frais_dossier_service=PaiementFraisDossier(), historique=HistoriqueGlobal(), - financabilite_fetcher=FinancabiliteFetcher(), + financabilite_fetcher=Fetcher(), ), CompleterCurriculumCommand: lambda msg_bus, cmd: completer_curriculum( cmd,