Skip to content
Snippets Groups Projects
Unverified Commit 9f74066a authored by vmaubert's avatar vmaubert
Browse files

fix(titre): corrige le calcul de la date de fin d’une phase (#147)

parent 1e7541c4
No related branches found
No related tags found
No related merge requests found
......@@ -194,7 +194,7 @@ const titreDemarchesOctNiDpuNiDex = [
{
id: 'h-cx-courdemanges-1988-oct01-dpu01',
titreDemarcheId: 'h-cx-courdemanges-1988-oct01',
typeId: 'rpu',
typeId: 'mdp',
statutId: 'acc',
ordre: 1,
date: '1988-03-06',
......
......@@ -109,7 +109,7 @@ const titreDemarcheOctroiDateDebutFind = (titreEtapes: ITitreEtape[]) => {
// en ajoutant la durée cumulée à la date de la première étape de publication
const titreEtapeDpuFirst = titreEtapesSortAscByOrdre(titreEtapes).find(
titreEtape =>
['dpu', 'dup', 'def', 'sco', 'aco'].includes(titreEtape.typeId)
['dpu', 'dup', 'def', 'sco', 'aco', 'rpu'].includes(titreEtape.typeId)
)
if (titreEtapeDpuFirst) {
......@@ -140,6 +140,12 @@ const titreDemarcheOctroiDateFinAndDureeFind = (
const dateDebut = titreDemarcheOctroiDateDebutFind(titreEtapes)
if (!dateDebut) {
if (!dateFin) {
console.warn(
`pas de date de début ni de date de fin pour la démarche ${titreEtapes?.[0].titreDemarcheId}`
)
}
return { duree: dureeAcc, dateFin }
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment