Enhance model and service documentation with detailed comments and descriptions

- Updated Group, Trip, User, and other model classes to include comprehensive documentation for better understanding and maintainability.
- Improved error handling and logging in services, including AuthService, ErrorService, and StorageService.
- Added validation and business logic explanations in ExpenseService and TripService.
- Refactored method comments to follow a consistent format across the codebase.
- Translated error messages and comments from French to English for consistency.
This commit is contained in:
Dayron
2025-10-30 15:56:17 +01:00
parent 1eeea6997e
commit 2faf37f145
46 changed files with 2656 additions and 220 deletions

View File

@@ -1,10 +1,42 @@
/// A service that handles trip-related business logic and data operations.
///
/// This service provides functionality for:
/// - Trip creation, updating, and deletion
/// - Trip validation and business rule enforcement
/// - Location-based trip suggestions
/// - Trip statistics and analytics
/// - Integration with Firebase Firestore for data persistence
///
/// The service ensures data integrity by validating trip information
/// before database operations and provides comprehensive error handling
/// and logging through the ErrorService.
///
/// Example usage:
/// ```dart
/// final tripService = TripService();
///
/// // Create a new trip
/// final tripId = await tripService.createTrip(newTrip);
///
/// // Get trip suggestions for a location
/// final suggestions = await tripService.getTripSuggestions('Paris');
///
/// // Calculate trip statistics
/// final stats = await tripService.getTripStatistics(tripId);
/// ```
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:travel_mate/services/error_service.dart';
import '../models/trip.dart';
/// Service for managing trip-related operations and business logic.
class TripService {
/// Service for error handling and logging
final _errorService = ErrorService();
/// Firestore instance for database operations
final FirebaseFirestore _firestore = FirebaseFirestore.instance;
/// Collection name for trips in Firestore
static const String _tripsCollection = 'trips';
// Charger tous les voyages