feat(mobile): implémentation feedback + correction URLs inscriptions
Connecte le frontend mobile aux nouveaux endpoints backend événements. ## Repository Interface (evenement_repository.dart) - ✅ Ajout submitFeedback(evenementId, note, commentaire) - ✅ Ajout getFeedbacks(evenementId) → retourne feedbacks + stats ## Repository Impl (evenement_repository_impl.dart) - ✅ Correction inscrireEvenement : /inscrire → /inscriptions (POST) - ✅ Correction desinscrireEvenement : /desinscrire → /inscriptions (DELETE) - ✅ Implémentation submitFeedback : POST /api/evenements/{id}/feedback - ✅ Implémentation getFeedbacks : GET /api/evenements/{id}/feedbacks - Gestion erreurs 400 (déjà soumis, pas participant, etc.) ## Use Case (submit_event_feedback.dart) - ✅ Remplacement UnimplementedError par appel repository - ✅ Validation note 1-5 - ✅ Transmission note + commentaire optionnel ## Fonctionnalités débloquées - Inscription/désinscription événements ✅ (URLs corrigées) - Soumission feedback post-événement ✅ - Consultation feedbacks + note moyenne ✅ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,4 +49,14 @@ abstract class IEvenementRepository {
|
||||
|
||||
/// Récupère les statistiques des événements
|
||||
Future<Map<String, dynamic>> getEvenementsStats();
|
||||
|
||||
/// Soumet un feedback pour un événement
|
||||
Future<void> submitFeedback({
|
||||
required String evenementId,
|
||||
required int note,
|
||||
String? commentaire,
|
||||
});
|
||||
|
||||
/// Récupère les feedbacks d'un événement
|
||||
Future<Map<String, dynamic>> getFeedbacks(String evenementId);
|
||||
}
|
||||
|
||||
@@ -21,19 +21,24 @@ class SubmitEventFeedback {
|
||||
/// Soumet un feedback pour l'événement
|
||||
/// Réservé aux participants de l'événement
|
||||
///
|
||||
/// TODO: Ajouter endpoint backend POST /api/evenements/{id}/feedback
|
||||
/// Lève une exception si:
|
||||
/// - L'événement n'existe pas
|
||||
/// - Le membre n'a pas participé
|
||||
/// - L'événement n'est pas terminé
|
||||
/// - Un feedback a déjà été soumis
|
||||
Future<void> call({
|
||||
required String evenementId,
|
||||
required int note,
|
||||
String? commentaire,
|
||||
}) async {
|
||||
// TODO: Implémenter quand endpoint backend sera disponible
|
||||
throw UnimplementedError(
|
||||
'Endpoint POST /api/evenements/{id}/feedback non implémenté côté backend',
|
||||
if (note < 1 || note > 5) {
|
||||
throw ArgumentError('La note doit être entre 1 et 5');
|
||||
}
|
||||
|
||||
await _repository.submitFeedback(
|
||||
evenementId: evenementId,
|
||||
note: note,
|
||||
commentaire: commentaire,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user