This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable authorization validity check (#549)
- Loading branch information
Showing
5 changed files
with
110 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
components/validityCheck/ValidityCheckValidAuthorizationStatus.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// @flow | ||
import React from "react"; | ||
import { Card, Heading, Text } from "rebass"; | ||
import { format } from "date-fns"; | ||
import frLocale from "date-fns/locale/fr"; | ||
import { List, SubList } from "./Style"; | ||
|
||
type Props = { | ||
data: Object, | ||
}; | ||
|
||
const ValidityCheckValidAuthorizationStatus = (props: Props) => { | ||
const { | ||
data: { ds_id: id, prenom, nom, siret, date_de_debut_apt: start, date_de_fin_apt: end }, | ||
} = props; | ||
const startDate = start ? format(new Date(start), "dd-MM-yyyy", { locale: frLocale }) : ""; | ||
const endDate = end ? format(new Date(end), "dd-MM-yyyy", { locale: frLocale }) : ""; | ||
return ( | ||
<Card border="1px solid" borderColor="green" borderRadius="6px" mb="4" p={[3, 4]}> | ||
<Heading color="green" mb="2"> | ||
Autorisation de travail valide | ||
</Heading> | ||
<List> | ||
<li>{`- Numéro : ${id}`}</li> | ||
<li> | ||
- Pour le salarié : | ||
<SubList> | ||
<li>{`- Prénom : ${prenom}`}</li> | ||
<li>{`- Nom : ${nom}`}</li> | ||
</SubList> | ||
</li> | ||
<li>{`- Pour l'entreprise identifiée par le numéro SIRET ${siret}`}</li> | ||
<li>{`- Valable du ${startDate} au ${endDate}.`}</li> | ||
</List> | ||
<Text fontWeight="bold" mt="3"> | ||
Contactez-nous pour récupérer une copie de l'attestation. | ||
</Text> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default ValidityCheckValidAuthorizationStatus; |
50 changes: 50 additions & 0 deletions
50
components/validityCheck/ValidityCheckValidIntroductionStatus.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// @flow | ||
import React from "react"; | ||
import { Card, Heading, Text } from "rebass"; | ||
import { format } from "date-fns"; | ||
import frLocale from "date-fns/locale/fr"; | ||
import { List, SubList } from "./Style"; | ||
|
||
type Props = { | ||
data: Object, | ||
}; | ||
|
||
const extractFromChamps = (champs: Object[], libelle: string[]) => | ||
champs.find((champ) => champ.type_de_champ.libelle === libelle).value; | ||
|
||
const ValidityCheckValidIntroductionStatus = (props: Props) => { | ||
const { | ||
data: { ds_id: id, prenom, nom, siret, champs }, | ||
} = props; | ||
|
||
const typeContrat = extractFromChamps(champs, "Type de contrat"); | ||
const emploi = extractFromChamps(champs, "Emploi occupé"); | ||
const dureeTravail = extractFromChamps(champs, "Nombre d'heures"); | ||
|
||
return ( | ||
<Card border="1px solid" borderColor="green" borderRadius="6px" mb="4" p={[3, 4]}> | ||
<Heading color="green" mb="2"> | ||
"Demande d'introduction valide." | ||
</Heading> | ||
<List> | ||
<li>{`- Numéro : ${id}`}</li> | ||
<li> | ||
- Pour le salarié : | ||
<SubList> | ||
<li>{`- Prénom : ${prenom}`}</li> | ||
<li>{`- Nom : ${nom}`}</li> | ||
</SubList> | ||
</li> | ||
<li>{`- Pour l'entreprise identifiée par le numéro SIRET ${siret}`}</li> | ||
<li>{`- Pour un contrat de type : ${typeContrat}`}</li> | ||
<li>{`- Pour occuper l'emploi : ${emploi}`}</li> | ||
<li>{`- Pour une durée de travail de ${dureeTravail}`}</li> | ||
</List> | ||
<Text fontWeight="bold" mt="3"> | ||
Contactez-nous pour récupérer une copie de l'attestation. | ||
</Text> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default ValidityCheckValidIntroductionStatus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters