feat: Ajout d'un nouvel état dans l'automatique lorsqu'un mandat SEPA

doit être envoyé aux parent
This commit is contained in:
N3WT DE COMPET
2025-04-27 13:40:48 +02:00
parent 3c62cc9ad2
commit 545349c7db
14 changed files with 214 additions and 153 deletions

View File

@ -23,7 +23,7 @@ import StudentInfoForm from '@/components/Inscription/StudentInfoForm';
import ResponsableInputFields from '@/components/Inscription/ResponsableInputFields';
import PaymentMethodSelector from '@/components/Inscription/PaymentMethodSelector';
import ProgressStep from '@/components/ProgressStep';
import { CheckCircle, Loader2 } from 'lucide-react';
import { CheckCircle, Hourglass } from 'lucide-react';
/**
* Composant de formulaire d'inscription partagé
@ -315,16 +315,21 @@ export default function InscriptionFormShared({
// Soumission du formulaire
const handleSubmit = (e) => {
e.preventDefault();
// Vérifier si le mode de paiement sélectionné est un prélèvement SEPA
const isSepaPayment =
formData.registration_payment === '1' || formData.tuition_payment === '1';
const data = {
student: {
...formData,
guardians,
},
establishment: selectedEstablishmentId,
status: 3,
status: isSepaPayment ? 8 : 3,
tuition_payment: formData.tuition_payment,
registration_payment: formData.registration_payment,
};
onSubmit(data);
};
@ -448,7 +453,7 @@ export default function InscriptionFormShared({
{template.file !== null ? (
<CheckCircle className="w-5 h-5 text-green-600" />
) : (
<Loader2 className="w-5 h-5 text-gray-600" />
<Hourglass className="w-5 h-5 text-gray-600" />
)}
</span>
{template.name || 'Document sans nom'}

View File

@ -13,7 +13,6 @@ export default function PaymentMethodSelector({
const isValid = !Object.keys(formData).some(
(field) => getLocalError(field) !== ''
);
console.log(isValid);
setIsPageValid(isValid);
}, [formData, setIsPageValid]);

View File

@ -1,18 +1,9 @@
import React, { useState } from 'react';
import {
Trash2,
Eye,
EyeOff,
ToggleLeft,
ToggleRight,
Info,
XCircle,
} from 'lucide-react';
import { Trash2, ToggleLeft, ToggleRight, Info, XCircle } from 'lucide-react';
import Table from '@/components/Table';
import Popup from '@/components/Popup';
import StatusLabel from '@/components/StatusLabel';
import SpecialityItem from '@/components/Structure/Configuration/SpecialityItem';
import Tooltip from '@/components/Tooltip';
const roleTypeToLabel = (roleType) => {
switch (roleType) {

View File

@ -11,6 +11,7 @@ const StatusLabel = ({ status, onChange, showDropdown = true, parent }) => {
{ value: 2, label: 'Nouveau' },
{ value: 3, label: 'En validation' },
{ value: 7, label: 'SEPA reçu' },
{ value: 8, label: 'En validation' },
]
: [
{ value: 1, label: 'A envoyer' },
@ -20,6 +21,7 @@ const StatusLabel = ({ status, onChange, showDropdown = true, parent }) => {
{ value: 5, label: 'Validé' },
{ value: 6, label: 'Archivé' },
{ value: 7, label: 'En attente SEPA' },
{ value: 8, label: 'SEPA à envoyer' },
];
const currentStatus = statusOptions.find((option) => option.value === status);
@ -29,7 +31,7 @@ const StatusLabel = ({ status, onChange, showDropdown = true, parent }) => {
if (parent) {
return (
(status === 2 && 'bg-orange-50 text-orange-600') ||
(status === 3 && 'bg-purple-50 text-purple-600') ||
((status === 3 || status === 8) && 'bg-purple-50 text-purple-600') ||
(status === 7 && 'bg-yellow-50 text-yellow-600')
);
}
@ -40,7 +42,8 @@ const StatusLabel = ({ status, onChange, showDropdown = true, parent }) => {
(status === 4 && 'bg-red-50 text-red-600') ||
(status === 5 && 'bg-green-50 text-green-600') ||
(status === 6 && 'bg-red-50 text-red-600') ||
(status === 7 && 'bg-yellow-50 text-yellow-600')
(status === 7 && 'bg-yellow-50 text-yellow-600') ||
(status === 8 && 'bg-cyan-50 text-cyan-600')
);
};

View File

@ -163,7 +163,7 @@ export default function ParentFilesSection({
return (
<MultiSelect
name="groups"
label="Sélection de groupes de fichiers"
label="Sélection du(des) dossier(s) d'inscription"
options={groups}
selectedOptions={selectedGroups}
onChange={handleGroupChange}