## Corrections Critiques ### Race Condition - Statuts de Messages - Fix : Les icônes de statut (✓, ✓✓, ✓✓ bleu) ne s'affichaient pas - Cause : WebSocket delivery confirmations arrivaient avant messages locaux - Solution : Pattern Optimistic UI dans chat_bloc.dart - Création message temporaire immédiate - Ajout à la liste AVANT requête HTTP - Remplacement par message serveur à la réponse - Fichier : lib/presentation/state_management/chat_bloc.dart ## Implémentation TODOs (13/21) ### Social (social_header_widget.dart) - ✅ Copier lien du post dans presse-papiers - ✅ Partage natif via Share.share() - ✅ Dialogue de signalement avec 5 raisons ### Partage (share_post_dialog.dart) - ✅ Interface sélection d'amis avec checkboxes - ✅ Partage externe via Share API ### Média (media_upload_service.dart) - ✅ Parsing JSON réponse backend - ✅ Méthode deleteMedia() pour suppression - ✅ Génération miniature vidéo ### Posts (create_post_dialog.dart, edit_post_dialog.dart) - ✅ Extraction URL depuis uploads - ✅ Documentation chargement médias ### Chat (conversations_screen.dart) - ✅ Navigation vers notifications - ✅ ConversationSearchDelegate pour recherche ## Nouveaux Fichiers ### Configuration - build-prod.ps1 : Script build production avec dart-define - lib/core/constants/env_config.dart : Gestion environnements ### Documentation - TODOS_IMPLEMENTED.md : Documentation complète TODOs ## Améliorations ### Architecture - Refactoring injection de dépendances - Amélioration routing et navigation - Optimisation providers (UserProvider, FriendsProvider) ### UI/UX - Amélioration thème et couleurs - Optimisation animations - Meilleure gestion erreurs ### Services - Configuration API avec env_config - Amélioration datasources (events, users) - Optimisation modèles de données
91 lines
2.4 KiB
Dart
91 lines
2.4 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
/// Entité de domaine représentant une réservation.
|
|
///
|
|
/// Cette entité est pure et indépendante de la couche de données.
|
|
/// Elle représente une réservation d'événement ou d'établissement.
|
|
class Reservation extends Equatable {
|
|
const Reservation({
|
|
required this.id,
|
|
required this.userId,
|
|
required this.userFullName,
|
|
required this.eventId,
|
|
required this.eventTitle,
|
|
required this.reservationDate,
|
|
required this.numberOfPeople,
|
|
required this.status,
|
|
this.establishmentId,
|
|
this.establishmentName,
|
|
this.notes,
|
|
this.createdAt,
|
|
});
|
|
|
|
final String id;
|
|
final String userId;
|
|
final String userFullName;
|
|
final String eventId;
|
|
final String eventTitle;
|
|
final DateTime reservationDate;
|
|
final int numberOfPeople;
|
|
final ReservationStatus status;
|
|
final String? establishmentId;
|
|
final String? establishmentName;
|
|
final String? notes;
|
|
final DateTime? createdAt;
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
id,
|
|
userId,
|
|
userFullName,
|
|
eventId,
|
|
eventTitle,
|
|
reservationDate,
|
|
numberOfPeople,
|
|
status,
|
|
establishmentId,
|
|
establishmentName,
|
|
notes,
|
|
createdAt,
|
|
];
|
|
|
|
/// Crée une copie de cette réservation avec des valeurs modifiées.
|
|
Reservation copyWith({
|
|
String? id,
|
|
String? userId,
|
|
String? userFullName,
|
|
String? eventId,
|
|
String? eventTitle,
|
|
DateTime? reservationDate,
|
|
int? numberOfPeople,
|
|
ReservationStatus? status,
|
|
String? establishmentId,
|
|
String? establishmentName,
|
|
String? notes,
|
|
DateTime? createdAt,
|
|
}) {
|
|
return Reservation(
|
|
id: id ?? this.id,
|
|
userId: userId ?? this.userId,
|
|
userFullName: userFullName ?? this.userFullName,
|
|
eventId: eventId ?? this.eventId,
|
|
eventTitle: eventTitle ?? this.eventTitle,
|
|
reservationDate: reservationDate ?? this.reservationDate,
|
|
numberOfPeople: numberOfPeople ?? this.numberOfPeople,
|
|
status: status ?? this.status,
|
|
establishmentId: establishmentId ?? this.establishmentId,
|
|
establishmentName: establishmentName ?? this.establishmentName,
|
|
notes: notes ?? this.notes,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Statut d'une réservation.
|
|
enum ReservationStatus {
|
|
pending, // En attente de confirmation
|
|
confirmed, // Confirmée
|
|
cancelled, // Annulée
|
|
completed, // Terminée
|
|
}
|