@@ -49,7 +49,8 @@ class CountryService {
4949
5050 // In-memory caches for frequently accessed lists with time-based invalidation.
5151 final Map <String , _CacheEntry <List <Country >>> _cachedEventCountries = {};
52- final Map <String , _CacheEntry <List <Country >>> _cachedHeadquarterCountries = {};
52+ final Map <String , _CacheEntry <List <Country >>> _cachedHeadquarterCountries =
53+ {};
5354
5455 // Futures to hold in-flight aggregation requests to prevent cache stampedes.
5556 Future <List <Country >>? _eventCountriesFuture;
@@ -127,12 +128,14 @@ class CountryService {
127128 combinedFilter.addAll ({'name' : nameFilter});
128129 }
129130
130- final response = await _countryRepository.readAll (
131- filter: combinedFilter,
132- );
131+ final response = await _countryRepository.readAll (filter: combinedFilter);
133132 return response.items;
134133 } catch (e, s) {
135- _log.severe ('Failed to fetch all countries with nameFilter: $nameFilter .' , e, s);
134+ _log.severe (
135+ 'Failed to fetch all countries with nameFilter: $nameFilter .' ,
136+ e,
137+ s,
138+ );
136139 throw OperationFailedException ('Failed to retrieve all countries: $e ' );
137140 }
138141 }
@@ -155,8 +158,9 @@ class CountryService {
155158 }
156159 // Atomically assign the future if no fetch is in progress,
157160 // and clear it when the future completes.
158- _eventCountriesFuture ?? = _fetchAndCacheEventCountries (nameFilter: nameFilter)
159- .whenComplete (() => _eventCountriesFuture = null );
161+ _eventCountriesFuture ?? = _fetchAndCacheEventCountries (
162+ nameFilter: nameFilter,
163+ ).whenComplete (() => _eventCountriesFuture = null );
160164 return _eventCountriesFuture! ;
161165 }
162166
@@ -178,9 +182,9 @@ class CountryService {
178182 }
179183 // Atomically assign the future if no fetch is in progress,
180184 // and clear it when the future completes.
181- _headquarterCountriesFuture ?? =
182- _fetchAndCacheHeadquarterCountries ( nameFilter: nameFilter)
183- .whenComplete (() => _headquarterCountriesFuture = null );
185+ _headquarterCountriesFuture ?? = _fetchAndCacheHeadquarterCountries (
186+ nameFilter: nameFilter,
187+ ) .whenComplete (() => _headquarterCountriesFuture = null );
184188 return _headquarterCountriesFuture! ;
185189 }
186190
@@ -287,11 +291,9 @@ class CountryService {
287291
288292 // Add name filter if provided
289293 if (nameFilter != null && nameFilter.isNotEmpty) {
290- pipeline.add (
291- < String , Object > {
292- r'$match' : < String , Object > {'$fieldName .name' : nameFilter},
293- },
294- );
294+ pipeline.add (< String , Object > {
295+ r'$match' : < String , Object > {'$fieldName .name' : nameFilter},
296+ });
295297 }
296298
297299 pipeline.addAll ([
0 commit comments