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,14 +1,23 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import '../../models/account.dart';
|
||||
import '../../models/group_member.dart';
|
||||
import 'package:travel_mate/models/account.dart';
|
||||
import 'package:travel_mate/models/group_member.dart';
|
||||
|
||||
|
||||
/// Abstract base class for account-related events in the BLoC pattern.
|
||||
///
|
||||
/// This class extends [Equatable] to enable value comparison for events.
|
||||
/// All account events should inherit from this class and implement the [props] getter.
|
||||
abstract class AccountEvent extends Equatable {
|
||||
const AccountEvent();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
}
|
||||
|
||||
/// Event to load accounts associated with a specific user ID.
|
||||
///
|
||||
/// This event is dispatched when the application needs to fetch accounts
|
||||
/// for a given user, typically for displaying user-specific account data.
|
||||
class LoadAccountsByUserId extends AccountEvent {
|
||||
final String userId;
|
||||
|
||||
@@ -18,6 +27,10 @@ class LoadAccountsByUserId extends AccountEvent {
|
||||
List<Object?> get props => [userId];
|
||||
}
|
||||
|
||||
/// Event to load accounts associated with a specific trip.
|
||||
///
|
||||
/// This event is dispatched when the application needs to fetch accounts
|
||||
/// related to a particular trip, such as for trip expense management.
|
||||
class LoadAccountsByTrip extends AccountEvent {
|
||||
final String tripId;
|
||||
|
||||
@@ -27,6 +40,10 @@ class LoadAccountsByTrip extends AccountEvent {
|
||||
List<Object?> get props => [tripId];
|
||||
}
|
||||
|
||||
/// Event to create a new account.
|
||||
///
|
||||
/// This event is dispatched when a new account needs to be created,
|
||||
/// passing the [Account] object containing the account details.
|
||||
class CreateAccount extends AccountEvent {
|
||||
final Account account;
|
||||
|
||||
@@ -36,6 +53,10 @@ class CreateAccount extends AccountEvent {
|
||||
List<Object?> get props => [account];
|
||||
}
|
||||
|
||||
/// Event to update an existing account.
|
||||
///
|
||||
/// This event is dispatched when an account needs to be modified,
|
||||
/// requiring the [accountId] to identify the account and the updated [Account] object.
|
||||
class UpdateAccount extends AccountEvent {
|
||||
final String accountId;
|
||||
final Account account;
|
||||
@@ -49,6 +70,10 @@ class UpdateAccount extends AccountEvent {
|
||||
List<Object?> get props => [accountId, account];
|
||||
}
|
||||
|
||||
/// Event to create a new account along with its group members.
|
||||
///
|
||||
/// This event is dispatched when creating an account that includes
|
||||
/// a list of [GroupMember] objects, such as for shared trip accounts.
|
||||
class CreateAccountWithMembers extends AccountEvent {
|
||||
final Account account;
|
||||
final List<GroupMember> members;
|
||||
|
||||
Reference in New Issue
Block a user