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,20 +1,52 @@
import 'dart:convert';
import 'package:cloud_firestore/cloud_firestore.dart';
/// Model representing a travel trip in the application.
///
/// This class encapsulates all trip-related information including dates,
/// location, participants, and budget details. It provides serialization
/// methods for Firebase operations and supports trip lifecycle management.
class Trip {
/// Unique identifier for the trip (usually Firestore document ID).
final String? id;
/// Title or name of the trip.
final String title;
/// Detailed description of the trip.
final String description;
/// Trip destination or location.
final String location;
/// Trip start date and time.
final DateTime startDate;
/// Trip end date and time.
final DateTime endDate;
/// Optional budget for the trip in the local currency.
final double? budget;
/// List of participant user IDs.
final List<String> participants;
/// User ID of the trip creator.
final String createdBy;
/// Timestamp when the trip was created.
final DateTime createdAt;
/// Timestamp when the trip was last updated.
final DateTime updatedAt;
/// Current status of the trip (e.g., 'draft', 'active', 'completed').
final String status;
/// Creates a new [Trip] instance.
///
/// Most fields are required except [id] and [budget].
/// [status] defaults to 'draft' for new trips.
Trip({
this.id,
required this.title,