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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user