feat: add brand library management features
- Introduced BrandLibrarySummary type to encapsulate brand library limits and usage. - Updated Brand interface to include keyword_count and question_count fields. - Implemented brand library limits in the backend, including max brands, keywords, and questions per keyword. - Added API endpoint to retrieve brand library summary. - Enhanced BrandsView.vue to display brand library usage and limits. - Implemented computed properties to manage brand, keyword, and question limits in the UI. - Updated mutation handlers to invalidate relevant queries upon creating/updating brands, keywords, and questions. - Added visual indicators for brand, keyword, and question limits in the UI. - Enhanced error handling for exceeding brand and keyword limits during creation.
This commit is contained in:
@@ -75,6 +75,10 @@ func brandListCacheKey(tenantID int64) string {
|
||||
return fmt.Sprintf("brand:list:%d", tenantID)
|
||||
}
|
||||
|
||||
func brandLibrarySummaryCacheKey(tenantID int64) string {
|
||||
return fmt.Sprintf("brand:library_summary:%d", tenantID)
|
||||
}
|
||||
|
||||
func brandDetailCacheKey(tenantID, brandID int64) string {
|
||||
return fmt.Sprintf("brand:detail:%d:%d", tenantID, brandID)
|
||||
}
|
||||
@@ -121,6 +125,7 @@ func invalidateBrandCaches(ctx context.Context, c sharedcache.Cache, tenantID, b
|
||||
deleteCachePrefix(ctx, c, brandQuestionsCachePrefix(tenantID, brandID))
|
||||
deleteCachePrefix(ctx, c, brandCompetitorsCachePrefix(tenantID, brandID))
|
||||
deleteCacheKey(ctx, c, brandListCacheKey(tenantID))
|
||||
deleteCacheKey(ctx, c, brandLibrarySummaryCacheKey(tenantID))
|
||||
deleteCachePrefix(ctx, c, scheduleTaskListCachePrefix(tenantID))
|
||||
deleteCachePrefix(ctx, c, scheduleTaskDetailCachePrefix(tenantID))
|
||||
invalidateWorkspaceCaches(ctx, c, tenantID)
|
||||
|
||||
Reference in New Issue
Block a user