File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
application/queries/query-mappers Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { DateService } from '../../../utils/date-service'
2
- import { Demarche } from '../../../domain/demarche'
2
+ import {
3
+ Demarche ,
4
+ POURQUOI_DEMARCHE_PERSO ,
5
+ QUOI_DEMARCHE_PERSO
6
+ } from '../../../domain/demarche'
3
7
import {
4
8
DemarcheDto ,
5
9
DemarcheDtoEtat
@@ -11,6 +15,13 @@ export function fromDemarcheDtoToDemarche(
11
15
demarcheDto : DemarcheDto ,
12
16
dateService : DateService
13
17
) : Demarche {
18
+ let label = demarcheDto . libellePourquoi
19
+ if (
20
+ demarcheDto . pourQuoi === POURQUOI_DEMARCHE_PERSO &&
21
+ demarcheDto . quoi === QUOI_DEMARCHE_PERSO
22
+ ) {
23
+ label = 'Autre démarche'
24
+ }
14
25
const aujourdhuiAMidi = dateService . now ( ) . set ( { hour : 12 } )
15
26
return {
16
27
id : demarcheDto . idDemarche ,
@@ -27,7 +38,7 @@ export function fromDemarcheDtoToDemarche(
27
38
dateAnnulation : demarcheDto . dateAnnulation
28
39
? DateTime . fromISO ( demarcheDto . dateAnnulation )
29
40
: undefined ,
30
- label : demarcheDto . libellePourquoi ,
41
+ label,
31
42
titre : demarcheDto . libelleQuoi ,
32
43
sousTitre : demarcheDto . libelleComment ,
33
44
dateCreation : DateTime . fromISO ( demarcheDto . dateCreation ) ,
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ import { catalogueDemarchesInMemory } from '../infrastructure/clients/utils/dema
8
8
9
9
export const DemarcheRepositoryToken = 'DemarcheRepositoryToken'
10
10
11
- const POURQUOI_DEMARCHE_PERSO = 'P01'
12
- const QUOI_DEMARCHE_PERSO = 'Q38'
11
+ export const POURQUOI_DEMARCHE_PERSO = 'P01'
12
+ export const QUOI_DEMARCHE_PERSO = 'Q38'
13
13
14
14
export interface Demarche {
15
15
id : string
You can’t perform that action at this time.
0 commit comments