Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
celineung committed Nov 13, 2024
1 parent 35a2ac8 commit 1aa1abb
Showing 1 changed file with 103 additions and 53 deletions.
156 changes: 103 additions & 53 deletions front/src/app/contents/admin/conventionValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,87 @@ const CopyButton = ({
};

const beneficiaryFields: ColField[] = [
{
key: "signatories.beneficiary.birthdate",
colLabel: "Date de naissance",
},
{
key: "signatories.beneficiary.isRqth",
colLabel: "RQTH",
getValue: (convention) =>
convention.signatories.beneficiary.isRqth ? "Oui" : "Non",
},
{
key: "signatories.beneficiary.financiaryHelp",
colLabel: "Aide matérielle",
getValue: (convention) =>
convention.signatories.beneficiary.financiaryHelp || "Aucune",
},
];

const beneficiaryEmergencyContactFields: ColField[] = [
{
key: "signatories.beneficiary.emergencyContact",
colLabel: "Prénom et nom",
getValue: (convention) =>
convention.signatories.beneficiary.emergencyContact || "-",
},
{
key: "signatories.beneficiary.emergencyContactEmail",
colLabel: "Email",
getValue: (convention) =>
convention.signatories.beneficiary.emergencyContactEmail || "-",
},
{
key: "signatories.beneficiary.emergencyContactPhone",
colLabel: "Téléphone",
getValue: (convention) =>
convention.signatories.beneficiary.emergencyContactPhone || "-",
},
];

const establishmentFields: ColField[] = [
{
key: "businessName",
colLabel: "Nom (raison sociale)",
},
{
key: "siret",
colLabel: "Siret",
},
];

const establishmentTutorFields: ColField[] = [
{
key: "establishmentTutor.firstName",
colLabel: "Prénom",
},
{
key: "establishmentTutor.lastName",
colLabel: "Nom",
},
{
key: "establishmentTutor.job",
colLabel: "Poste",
},
{
key: "establishmentTutor.email",
colLabel: "Email",
getValue: (convention) =>
convention.establishmentTutor
? renderEmail(convention.establishmentTutor.email)
: "",
copyButton: (convention) => (
<CopyButton textLabel="" value={convention.establishmentTutor.email} />
),
},
{
key: "establishmentTutor.phone",
colLabel: "Téléphone",
},
];

const beneficiarySignatoryFields: ColField[] = [
{
key: "signatories.beneficiary.signedAt",
colLabel: "Signé",
Expand Down Expand Up @@ -288,47 +369,6 @@ const establishmentRepresentativeFields: ColField[] = [
},
];

const enterpriseFields: ColField[] = [
{
key: "businessName",
colLabel: "Entreprise",
},
{
key: "siret",
colLabel: "Siret",
getValue: (convention) => renderSiret(convention.siret),
},
];
const establishmentTutorFields: ColField[] = [
{
key: "establishmentTutor.email",
colLabel: "Mail du tuteur",
getValue: (convention) =>
convention.establishmentTutor
? renderEmail(convention.establishmentTutor.email)
: "",
copyButton: (convention) => (
<CopyButton textLabel="" value={convention.establishmentTutor.email} />
),
},
{
key: "establishmentTutor.phone",
colLabel: "Numéro de téléphone du tuteur",
},
{
key: "establishmentTutor.firstName",
colLabel: "Prénom",
},
{
key: "establishmentTutor.lastName",
colLabel: "Prénom",
},
{
key: "establishmentTutor.job",
colLabel: "Poste",
},
];

const agencyFields: ColField[] = [
{
key: "agencyName",
Expand Down Expand Up @@ -466,7 +506,7 @@ export const sections: FieldsAndTitle[] = [
rowFields: [
{
title: "Bénéficiaire",
fields: beneficiaryFields,
fields: beneficiarySignatoryFields,
},
{
title: "Représentant légal bénéficiaire",
Expand All @@ -484,22 +524,32 @@ export const sections: FieldsAndTitle[] = [
additionalClasses: "fr-table--green-emeraude",
},
{
listTitle: "Entreprise",
cols: [
"Entreprise",
"Siret",
"Email tuteur",
"Téléphone tuteur",
"Prénom",
"Nom",
"Poste",
listTitle: "Informations sur le bénéficiaire",
rowFields: [
{
title: "Bénéficiaire",
fields: beneficiaryFields,
},
{
title: "Contact d'urgence",
fields: beneficiaryEmergencyContactFields,
},
],
additionalClasses: "fr-table--green-emeraude",
},
{
listTitle: "Informations de l'entreprise",
rowFields: [
{
fields: [...enterpriseFields, ...establishmentTutorFields],
title: "Entreprise",
fields: establishmentFields,
},
{
title: "Tuteur",
fields: establishmentTutorFields,
},
],
additionalClasses: " fr-table--blue-cumulus",
additionalClasses: "fr-table--green-emeraude",
},
{
listTitle: "Structure",
Expand Down

0 comments on commit 1aa1abb

Please sign in to comment.