feat(frontend): fusion liste des frais et message compte existant [#NEWTS-9]

This commit is contained in:
Luc SORIGNET
2026-03-15 12:09:02 +01:00
parent c296af2c07
commit e30a41a58b
10 changed files with 755 additions and 294 deletions

View File

@ -12,6 +12,7 @@ from .models import (
Planning,
Discount,
Fee,
FeeType,
PaymentPlan,
PaymentMode,
EstablishmentCompetency,
@ -288,7 +289,13 @@ class FeeListCreateView(APIView):
return JsonResponse({'error': 'establishment_id est requis'}, safe=False, status=status.HTTP_400_BAD_REQUEST)
filter = request.GET.get('filter', '').strip()
fee_type_value = 0 if filter == 'registration' else 1
if filter not in ('registration', 'tuition'):
return JsonResponse(
{'error': "Le paramètre 'filter' doit être 'registration' ou 'tuition'"},
safe=False,
status=status.HTTP_400_BAD_REQUEST,
)
fee_type_value = FeeType.REGISTRATION_FEE if filter == 'registration' else FeeType.TUITION_FEE
fees = Fee.objects.filter(type=fee_type_value, establishment_id=establishment_id).distinct()
fee_serializer = FeeSerializer(fees, many=True)