@@ -7,9 +7,12 @@ abstract class UserPreferenceLimitService {
77 /// {@macro user_preference_limit_service}
88 const UserPreferenceLimitService ();
99
10- /// Checks if the user is allowed to add an item of the given type,
10+ /// Checks if the user is allowed to add a *single* item of the given type,
1111 /// considering their current count of that item type and their role.
1212 ///
13+ /// This method is typically used when a user performs an action that adds
14+ /// one item, such as saving a single headline or following a single source.
15+ ///
1316 /// - [user] : The authenticated user.
1417 /// - [itemType] : The type of item being added (e.g., 'country', 'source',
1518 /// 'category', 'headline').
@@ -19,8 +22,13 @@ abstract class UserPreferenceLimitService {
1922 /// limit for their role.
2023 Future <void > checkAddItem (User user, String itemType, int currentCount);
2124
22- /// Checks if the proposed [updatedPreferences] for the user exceed
23- /// the limits based on their role.
25+ /// Checks if the proposed *entire state* of the user's preferences,
26+ /// represented by [updatedPreferences] , exceeds the limits based on their role.
27+ ///
28+ /// This method is typically used when the full [UserContentPreferences] object
29+ /// is being updated, such as when a user saves changes from a preferences screen.
30+ /// It validates the total counts across all relevant lists (followed countries,
31+ /// sources, categories, and saved headlines).
2432 ///
2533 /// - [user] : The authenticated user.
2634 /// - [updatedPreferences] : The proposed [UserContentPreferences] object.
0 commit comments