Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
on peut notifier après abrogation
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaubert committed Sep 16, 2024
1 parent 4de0ab7 commit 8ff7467
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('vérifie l’arbre des procédures spécifique', () => {

expect(service.getSnapshot().context.visibilite).toBe('publique')
expect(service.getSnapshot().context.demarcheStatut).toBe(DemarchesStatutsIds.AccepteEtPublie)
expect(service).canOnlyTransitionTo({ machine, date: dateFin }, [])
expect(service).canOnlyTransitionTo({ machine, date: dateFin }, ['FAIRE_ABROGATION'])
})
test("réalise une demande de prolongation d'ARM rejetée", () => {
const { service, dateFin } = setDateAndOrderAndInterpretMachine(psArmProMachine, '1999-04-14', [
Expand Down Expand Up @@ -168,8 +168,8 @@ describe('vérifie l’arbre des procédures spécifique', () => {
"OUVRIR_PARTICIPATION_DU_PUBLIC (publique , en instruction ) -> [RENDRE_DECISION_ADMINISTRATION_ACCEPTEE,RENDRE_DECISION_ADMINISTRATION_REJETEE,RENDRE_DECISION_ADMINISTRATION_REJETEE_DECISION_IMPLICITE]",
"RENDRE_DECISION_ADMINISTRATION_ACCEPTEE (publique , accepté ) -> [PUBLIER_DECISION_ACCEPTEE_AU_JORF,PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS]",
"PUBLIER_DECISION_ACCEPTEE_AU_JORF (publique , accepté et publié ) -> [FAIRE_ABROGATION,NOTIFIER_DEMANDEUR]",
"NOTIFIER_DEMANDEUR (publique , accepté et publié ) -> [FAIRE_ATTESTATION_DE_CONSTITUTION_DE_GARANTIES_FINANCIERES]",
"FAIRE_ATTESTATION_DE_CONSTITUTION_DE_GARANTIES_FINANCIERES (publique , accepté et publié ) -> []",
"NOTIFIER_DEMANDEUR (publique , accepté et publié ) -> [FAIRE_ABROGATION,FAIRE_ATTESTATION_DE_CONSTITUTION_DE_GARANTIES_FINANCIERES]",
"FAIRE_ATTESTATION_DE_CONSTITUTION_DE_GARANTIES_FINANCIERES (publique , accepté et publié ) -> [FAIRE_ABROGATION]",
]
`)
})
Expand Down Expand Up @@ -201,8 +201,8 @@ describe('vérifie l’arbre des procédures spécifique', () => {
"OUVRIR_PARTICIPATION_DU_PUBLIC (publique , en instruction ) -> [RENDRE_DECISION_ADMINISTRATION_ACCEPTEE,RENDRE_DECISION_ADMINISTRATION_REJETEE,RENDRE_DECISION_ADMINISTRATION_REJETEE_DECISION_IMPLICITE]",
"RENDRE_DECISION_ADMINISTRATION_ACCEPTEE (publique , accepté ) -> [PUBLIER_DECISION_ACCEPTEE_AU_JORF,PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS]",
"PUBLIER_DECISION_ACCEPTEE_AU_JORF (publique , accepté et publié ) -> [FAIRE_ABROGATION,NOTIFIER_DEMANDEUR]",
"FAIRE_ABROGATION (publique , accepté et publié ) -> [PUBLIER_DECISION_ACCEPTEE_AU_JORF,PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS]",
"PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS (publique , rejeté après abrogation) -> []",
"FAIRE_ABROGATION (publique , accepté et publié ) -> [NOTIFIER_DEMANDEUR,PUBLIER_DECISION_ACCEPTEE_AU_JORF,PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS]",
"PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS (publique , rejeté après abrogation) -> [NOTIFIER_DEMANDEUR]",
]
`)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,47 +314,70 @@ const procedureSpecifiqueMachine = (titreTypeId: TitreTypeId, demarcheTypeId: De
},
publicationAuRecueilDesActesAdministratifsOupublicationAuJORFAFaire: {
on: {
PUBLIER_DECISION_ACCEPTEE_AU_JORF: [
{
guard: 'isDemarcheStatutAcceptee',
target: 'abrogationOuNotificationAuDemandeurAFaire',
actions: assign({ demarcheStatut: DemarchesStatutsIds.AccepteEtPublie }),
},
{
guard: 'isDemarcheStatutAccepteeEtPublie',
target: 'finDeMachine',
actions: assign({ demarcheStatut: DemarchesStatutsIds.RejeteApresAbrogation }),
},
],
PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS: [
{
guard: 'isDemarcheStatutAcceptee',
target: 'abrogationOuNotificationAuDemandeurAFaire',
actions: assign({ demarcheStatut: DemarchesStatutsIds.AccepteEtPublie }),
},
{
guard: 'isDemarcheStatutAccepteeEtPublie',
target: 'finDeMachine',
actions: assign({ demarcheStatut: DemarchesStatutsIds.RejeteApresAbrogation }),
},
],
},
},
abrogationOuNotificationAuDemandeurAFaire: {
on: {
NOTIFIER_DEMANDEUR: 'attestationDeConstitutionDeGarantiesFinancieresAFaire',
FAIRE_ABROGATION: 'publicationAuRecueilDesActesAdministratifsOupublicationAuJORFAFaire',
PUBLIER_DECISION_ACCEPTEE_AU_JORF: {
target: 'abrogationOuNotificationAuDemandeurMachine',
actions: assign({ demarcheStatut: DemarchesStatutsIds.AccepteEtPublie }),
},
PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS: {
target: 'abrogationOuNotificationAuDemandeurMachine',
actions: assign({ demarcheStatut: DemarchesStatutsIds.AccepteEtPublie }),
},
},
},
attestationDeConstitutionDeGarantiesFinancieresAFaire: {
always: {
target: 'finDeMachine',
guard: not('isAxm'),
},
on: {
FAIRE_ATTESTATION_DE_CONSTITUTION_DE_GARANTIES_FINANCIERES: 'finDeMachine',
abrogationOuNotificationAuDemandeurMachine: {
type: 'parallel',
states: {
notificationAuDemandeurMachine: {
initial: 'notificationAuDemandeurAFaire',
states: {
notificationAuDemandeurAFaire: {
on: {
NOTIFIER_DEMANDEUR: 'attestationDeConstitutionDeGarantiesFinancieresAFaire',
},
},
attestationDeConstitutionDeGarantiesFinancieresAFaire: {
always: {
target: 'attestationDeConstitutionDeGarantiesFinancieresFait',
guard: not('isAxm'),
},
on: {
FAIRE_ATTESTATION_DE_CONSTITUTION_DE_GARANTIES_FINANCIERES: 'attestationDeConstitutionDeGarantiesFinancieresFait',
},
},

attestationDeConstitutionDeGarantiesFinancieresFait: { type: 'final' },
},
},

abrogationMachine: {
initial: 'abrogationAFaire',
states: {
abrogationAFaire: {
on: {
FAIRE_ABROGATION: 'publicationsAFaire',
},
},
publicationsAFaire: {
on: {
PUBLIER_DECISION_ACCEPTEE_AU_JORF: {
target: 'publicationsFaites',
actions: assign({ demarcheStatut: DemarchesStatutsIds.RejeteApresAbrogation }),
},
PUBLIER_DECISION_AU_RECUEIL_DES_ACTES_ADMINISTRATIFS: {
target: 'publicationsFaites',
actions: assign({ demarcheStatut: DemarchesStatutsIds.RejeteApresAbrogation }),
},
},
},
publicationsFaites: {
type: 'final',
},
},
},
},
onDone: 'finDeMachine',
},

notificationAuDemandeurApresDecisionRejetAFaire: {
on: {
NOTIFIER_DEMANDEUR: {
Expand All @@ -379,5 +402,4 @@ const procedureSpecifiqueMachine = (titreTypeId: TitreTypeId, demarcheTypeId: De
// - comment on peut avoir une mise en concurrence si la démarche n'est pas publique ? => Modif du logigramme, ça devient publique dés que la mise en concurrence est « en cours »
// - Pour l'enquête et la participation du public, la démarche est déjà publique => Heuuuu non, modif à faire dans le logigramme
//
// - « Mesures de publicité» ça bloque tout ?
// - Une fois qu'on a notifié le demandeur, on ne peut plus abroger ?
// - « Mesures de publicité» ça bloque tout ? -> NON

0 comments on commit 8ff7467

Please sign in to comment.