feat: Gestion de la validation du dossier d'inscription

This commit is contained in:
N3WT DE COMPET
2025-04-27 16:34:41 +02:00
parent ada2a44c3e
commit b23264c0d4
8 changed files with 236 additions and 220 deletions

View File

@ -35,7 +35,7 @@ import {
archiveRegisterForm,
fetchStudents,
editRegisterForm,
sendSEPARegisterForm,
editRegisterFormWithBinaryFile,
} from '@/app/actions/subscriptionAction';
import {
@ -379,7 +379,7 @@ export default function Page({ params: { locale } }) {
formData.append('sepa_file', file);
// Appeler l'API pour uploader le fichier SEPA
sendSEPARegisterForm(row.student.id, formData, csrfToken)
editRegisterFormWithBinaryFile(row.student.id, formData, csrfToken)
.then((response) => {
logger.debug('Mandat SEPA uploadé avec succès :', response);
setPopupMessage('Le mandat SEPA a été uploadé avec succès.');
@ -797,11 +797,7 @@ export default function Page({ params: { locale } }) {
</span>
),
onClick: () => {
const paymentSepa =
row.registration_payment === 1 || row.tuition_payment === 1
? 1
: 0;
const url = `${FE_ADMIN_SUBSCRIPTIONS_VALIDATE_URL}?studentId=${row.student.id}&firstName=${row.student.first_name}&lastName=${row.student.last_name}&paymentSepa=${paymentSepa}&file=${row.registration_file}`;
const url = `${FE_ADMIN_SUBSCRIPTIONS_VALIDATE_URL}?studentId=${row.student.id}&firstName=${row.student.first_name}&lastName=${row.student.last_name}&sepa_file=${row.sepa_file}&student_file=${row.registration_file}`;
router.push(`${url}`);
},
},
@ -809,11 +805,11 @@ export default function Page({ params: { locale } }) {
5: [
{
icon: (
<span title="Valider le dossier">
<CheckCircle className="w-5 h-5 text-green-500 hover:text-green-700" />
<span title="Voir les fichiers">
<FileText className="w-5 h-5 text-cyan-500 hover:text-cyan-700" />
</span>
),
onClick: () => openModalAssociationEleve(row.student),
onClick: () => openFilesModal(row),
},
],
7: [
@ -1087,7 +1083,10 @@ export default function Page({ params: { locale } }) {
key={`${currentPage}-${searchTerm}`}
data={
activeTab === 'pending'
? registrationFormsDataPending
? [
...registrationFormsDataPending,
...registrationFormsDataSubscribed,
]
: activeTab === 'subscribed'
? registrationFormsDataSubscribed
: registrationFormsDataArchived