@@ -16,7 +16,7 @@ part 'activities_query.freezed.dart';
1616/// ## Example
1717/// ```dart
1818/// final query = ActivitiesQuery(
19- /// filter: Filter.equal(ActivitiesFilterField.type , "post"),
19+ /// filter: Filter.equal(ActivitiesFilterField.activityType , "post"),
2020/// sort: [ActivitiesSort.desc(ActivitiesSortField.createdAt)],
2121/// limit: 20,
2222/// );
@@ -66,6 +66,14 @@ class ActivitiesFilterField extends FilterField<ActivityData> {
6666 /// Creates a new activities filter field.
6767 ActivitiesFilterField (super .remote, super .value);
6868
69+ /// Filter by the type of activity (e.g., "post", "comment", "reaction").
70+ ///
71+ /// **Supported operators:** `.equal` , `.in`
72+ static final activityType = ActivitiesFilterField (
73+ 'activity_type' ,
74+ (data) => data.type,
75+ );
76+
6977 /// Filter by the creation timestamp of the activity.
7078 ///
7179 /// **Supported operators:** `.equal` , `.greaterThan` , `.lessThan` , `.greaterThanOrEqual` , `.lessThanOrEqual`
@@ -76,7 +84,8 @@ class ActivitiesFilterField extends FilterField<ActivityData> {
7684
7785 /// Filter by the expiration timestamp of the activity.
7886 ///
79- /// **Supported operators:** `.exists`
87+ /// **Supported operators:** `.equal` , `.notEqual` , `.greaterThan` ,
88+ /// `.lessThan` , `.greaterThanOrEqual` , `.lessThanOrEqual` , `.exists`
8089 static final expiresAt = ActivitiesFilterField (
8190 'expires_at' ,
8291 (data) => data.expiresAt,
@@ -90,14 +99,30 @@ class ActivitiesFilterField extends FilterField<ActivityData> {
9099 (data) => data.id,
91100 );
92101
102+ /// Filter by the feed ID(s) the activity belongs to.
103+ ///
104+ /// **Supported operators:** `.equal` , `.in`
105+ static final feed = ActivitiesFilterField (
106+ 'feed' ,
107+ (data) => data.feeds,
108+ );
109+
93110 /// Filter by the filter tags associated with the activity.
94111 ///
95- /// **Supported operators:** `.equal` , `.in` , `.customContains `
112+ /// **Supported operators:** `.equal` , `.in` , `.contains `
96113 static final filterTags = ActivitiesFilterField (
97114 'filter_tags' ,
98115 (data) => data.filterTags,
99116 );
100117
118+ /// Filter by the interest tags associated with the activity.
119+ ///
120+ /// **Supported operators:** `.equal` , `.in` , `.contains`
121+ static final interestTags = ActivitiesFilterField (
122+ 'interest_tags' ,
123+ (data) => data.interestTags,
124+ );
125+
101126 /// Filter by the popularity score of the activity.
102127 ///
103128 /// **Supported operators:** `.equal` , `.greaterThan` , `.lessThan` , `.greaterThanOrEqual` , `.lessThanOrEqual`
@@ -108,35 +133,49 @@ class ActivitiesFilterField extends FilterField<ActivityData> {
108133
109134 /// Filter by the search data content of the activity.
110135 ///
111- /// **Supported operators:** `.equal ` , `.customQ ` , `.customAutocomplete `
136+ /// **Supported operators:** `.contains ` , `.in ` , `.pathExists `
112137 static final searchData = ActivitiesFilterField (
113138 'search_data' ,
114139 (data) => data.searchData,
115140 );
116141
117142 /// Filter by the text content of the activity.
118143 ///
119- /// **Supported operators:** `.equal` , `.customQ` , `.customAutocomplete `
144+ /// **Supported operators:** `.equal` , `.q` (full-text search) , `.autocomplete `
120145 static final text = ActivitiesFilterField (
121146 'text' ,
122147 (data) => data.text,
123148 );
124149
125- /// Filter by the type of activity (e.g., "post", "comment", "reaction").
126- ///
127- /// **Supported operators:** `.equal` , `.in`
128- static final type = ActivitiesFilterField (
129- 'type' ,
130- (data) => data.type,
131- );
132-
133150 /// Filter by the user ID who created the activity.
134151 ///
135152 /// **Supported operators:** `.equal` , `.in`
136153 static final userId = ActivitiesFilterField (
137154 'user_id' ,
138155 (data) => data.user.id,
139156 );
157+
158+ /// Filter by the proximity to a specific location.
159+ ///
160+ /// Note: This requires an object with latitude ('lat'), longitude ('lng')
161+ /// and distance in km ('distance).
162+ ///
163+ /// **Supported operators:** `.equal`
164+ static final near = ActivitiesFilterField (
165+ 'near' ,
166+ (data) => data.location,
167+ );
168+
169+ /// Filter by activities within specific geographical bounds.
170+ ///
171+ /// Note: This requires an object with 'sw_lat', 'sw_lng' (southwest corner)
172+ /// and 'ne_lat', 'ne_lng' (northeast) corner keys.
173+ ///
174+ /// **Supported operators:** `.equal`
175+ static final withinBounds = ActivitiesFilterField (
176+ 'within_bounds' ,
177+ (data) => data.location,
178+ );
140179}
141180
142181// endregion
0 commit comments