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'}