buildKey method
Builds a fully isolated cache key partitioned by tenant, host, locale, and currency.
Implementation
String buildKey({
required String tenantId,
required String host,
required String path,
String locale = 'en',
String currency = 'USD',
Map<String, String> queryParameters = const {},
}) {
final cleanPath = path.isEmpty ? '/' : path;
final sortedQuery = queryParameters.entries.toList()
..sort((a, b) => a.key.compareTo(b.key));
final queryStr = sortedQuery.map((e) => '${e.key}=${e.value}').join('&');
return 'tenant:$tenantId:host:$host:loc:$locale:cur:$currency:path:$cleanPath?$queryStr';
}