Skip to content

Commit

Permalink
Merge pull request #1370 from SocialGouv/feat/us-2502-marquer-jeune-a…
Browse files Browse the repository at this point in the history
…-archiver

feat: marque jeune milo à archiver
  • Loading branch information
arthurlbrjc committed Jun 11, 2024
2 parents 502fe16 + 6610203 commit d8c682d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
StatutAction,
} from 'interfaces/action'
import { Agenda } from 'interfaces/agenda'
import { estMilo, estPassEmploi, estPoleEmploi } from 'interfaces/conseiller'
import { estMilo, estPoleEmploi } from 'interfaces/conseiller'
import { EvenementListItem } from 'interfaces/evenement'
import { Offre, Recherche } from 'interfaces/favoris'
import {
Expand Down Expand Up @@ -82,7 +82,7 @@ type FicheBeneficiaireProps = {
}
lectureSeule: boolean
onglet: Onglet
erreurSessions: boolean
erreurSessions?: boolean
metadonneesFavoris?: MetadonneesFavoris
offresPE?: Offre[]
recherchesPE?: Recherche[]
Expand Down Expand Up @@ -305,21 +305,29 @@ function FicheBeneficiairePage({
/>
)}

{!jeune.isActivated &&
(estPoleEmploi(conseiller) || estPassEmploi(conseiller)) && (
<FailureAlert
label='Ce bénéficiaire ne s’est pas encore connecté à l’application.'
sub={
<p className='pl-8'>
<strong>
Il ne pourra pas échanger de messages avec vous.
</strong>
</p>
}
/>
)}
{jeune.estAArchiver && (
<FailureAlert
label='La récupération des informations de ce bénéficiaire depuis i-milo a échoué.'
sub={
<p className='pl-8'>
Veuillez vérifier si ce compte doit être archivé.
</p>
}
/>
)}

{!jeune.estAArchiver && !jeune.isActivated && !estMilo(conseiller) && (
<FailureAlert
label='Ce bénéficiaire ne s’est pas encore connecté à l’application.'
sub={
<p className='pl-8'>
<strong>Il ne pourra pas échanger de messages avec vous.</strong>
</p>
}
/>
)}

{!jeune.isActivated && estMilo(conseiller) && (
{!jeune.estAArchiver && !jeune.isActivated && estMilo(conseiller) && (
<FailureAlert
label='Ce bénéficiaire ne s’est pas encore connecté à l’application.'
sub={
Expand Down
2 changes: 1 addition & 1 deletion components/rdv/OngletRdvsBeneficiaire.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface OngletRdvsBeneficiaireProps {
rdvs: EvenementListItem[]
beneficiaire: BaseJeune
conseiller: Conseiller
erreurSessions: boolean
erreurSessions?: boolean
}

export default function OngletRdvsBeneficiaire({
Expand Down
1 change: 1 addition & 0 deletions fixtures/jeune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const unDetailJeune = (
creationDate: '2021-12-07T17:30:07.756Z',
situations: [],
idConseiller: 'id-conseiller',
estAArchiver: false,
}
return { ...defaults, ...overrides }
}
Expand Down
9 changes: 5 additions & 4 deletions interfaces/jeune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ export interface DetailJeune extends BaseJeune {
isActivated: boolean
isReaffectationTemporaire: boolean
idConseiller: string
email?: string
urlDossier?: string
dateFinCEJ?: string
situations: Array<{
etat?: EtatSituation
categorie: CategorieSituation
etat?: EtatSituation
dateFin?: string
}>
estAArchiver: boolean
email?: string
urlDossier?: string
dateFinCEJ?: string
idPartenaire?: string
structureMilo?: { id: string }
}
Expand Down
4 changes: 3 additions & 1 deletion interfaces/json/jeune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ export interface DetailJeuneJson extends BaseJeuneJson {
creationDate: string
isActivated: boolean
isReaffectationTemporaire: boolean
conseiller: { id: string }
email?: string
urlDossier?: string
dateFinCEJ?: string
situations?: Situation[]
idPartenaire?: string
conseiller: { id: string }
estAArchiver?: boolean
}

export type JeuneEtablissementJson = {
Expand Down Expand Up @@ -155,6 +156,7 @@ export function jsonToDetailJeune({
}: DetailJeuneJson): DetailJeune {
return {
...jeune,
estAArchiver: Boolean(jeune.estAArchiver),
prenom: firstName,
nom: lastName,
idConseiller: conseiller.id,
Expand Down

0 comments on commit d8c682d

Please sign in to comment.