feat: Mise en place des paiements en plusieurs fois (partie BACK) [#25]

This commit is contained in:
N3WT DE COMPET
2025-02-11 20:48:11 +01:00
parent ffc6ce8de8
commit 23203c0397
17 changed files with 599 additions and 86 deletions

View File

@ -119,15 +119,17 @@ const DiscountsSection = ({ discounts, setDiscounts, handleCreate, handleEdit, h
};
const renderInputField = (field, value, onChange, placeholder) => (
<div>
<InputText
name={field}
type={field === 'amount' ? 'number' : 'text'}
value={value}
onChange={onChange}
placeholder={placeholder}
errorMsg={localErrors && localErrors[field] && Array.isArray(localErrors[field]) ? localErrors[field][0] : ''}
/>
<div className="flex justify-center space-x-2">
<div className="w-full max-w-xs">
<InputText
name={field}
type={field === 'amount' ? 'number' : 'text'}
value={value}
onChange={onChange}
placeholder={placeholder}
errorMsg={localErrors && localErrors[field] && Array.isArray(localErrors[field]) ? localErrors[field][0] : ''}
/>
</div>
</div>
);
@ -142,7 +144,7 @@ const DiscountsSection = ({ discounts, setDiscounts, handleCreate, handleEdit, h
return renderInputField('name', currentData.name, handleChange, 'Libellé de la réduction');
case 'REMISE':
return (
<div className="flex items-center space-x-2">
<div className="flex justify-center space-x-2">
{renderInputField('amount', currentData.amount, handleChange,'Montant')}
<button
@ -270,7 +272,7 @@ const DiscountsSection = ({ discounts, setDiscounts, handleCreate, handleEdit, h
<div className="flex justify-between items-center">
<div className="flex items-center mb-4">
<Tag className="w-6 h-6 text-emerald-500 mr-2" />
<h2 className="text-xl font-semibold">Réductions {type === 0 ? 'd\'inscription' : 'de scolarité'}</h2>
<h2 className="text-xl font-semibold">Liste des réductions</h2>
</div>
<button type="button" onClick={handleAddDiscount} className="text-emerald-500 hover:text-emerald-700">
<Plus className="w-5 h-5" />