Add three-layer feature gating for AI Catalog Price Check
Adds platform-level, plan-level (Enterprise only), and per-company toggles for the AI Catalog Price Check feature. Includes: - Company.AiCatalogPriceCheckEnabled per-company flag - SubscriptionPlanConfig.AllowAiCatalogPriceCheck plan-level flag - PlatformSetting 'AiCatalogPriceCheckEnabled' global kill switch - IPlatformSettingsService.GetBoolAsync helper - ISubscriptionService.CanUseAiCatalogPriceCheckAsync - UI controls in Companies/Edit, PlatformSubscription/Edit+Index, and SubscriptionManagement/Manage - Migration AddAiCatalogPriceCheckGating applied Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,8 @@ public class Company : BaseEntity
|
||||
public bool AiPhotoQuotesEnabled { get; set; } = true;
|
||||
/// <summary>Enables/disables the AI Inventory Assist lookup for this company.</summary>
|
||||
public bool AiInventoryAssistEnabled { get; set; } = true;
|
||||
/// <summary>Enables/disables the AI Catalog Price Check for this company.</summary>
|
||||
public bool AiCatalogPriceCheckEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Stores the billing period the customer selected at registration (or last changed on the Billing page).
|
||||
|
||||
@@ -14,4 +14,5 @@ public static class PlatformSettingKeys
|
||||
public const string StripeWebhookRetentionDays = "StripeWebhookRetentionDays";
|
||||
public const string MaxTenants = "MaxTenants";
|
||||
public const string SmsEnabled = "SmsEnabled";
|
||||
public const string AiCatalogPriceCheckEnabled = "AiCatalogPriceCheckEnabled";
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ public class SubscriptionPlanConfig : BaseEntity
|
||||
/// <summary>When true, companies on this plan can use the AI Inventory Assist lookup feature.</summary>
|
||||
public bool AllowAiInventoryAssist { get; set; } = false;
|
||||
|
||||
/// <summary>When true, companies on this plan can run the AI Catalog Price Check (Enterprise only).</summary>
|
||||
public bool AllowAiCatalogPriceCheck { get; set; } = false;
|
||||
|
||||
public bool IsActive { get; set; } = true;
|
||||
public int SortOrder { get; set; }
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ public interface ISubscriptionService
|
||||
Task<bool> CanUseAiPhotoQuoteAsync(int companyId);
|
||||
/// <summary>Returns (used this month, monthly max). Max = -1 means unlimited.</summary>
|
||||
Task<(int Used, int Max)> GetAiPhotoQuoteUsageAsync(int companyId);
|
||||
/// <summary>Returns true if the AI Catalog Price Check is enabled for this company (plan gate + per-company flag).</summary>
|
||||
Task<bool> CanUseAiCatalogPriceCheckAsync(int companyId);
|
||||
|
||||
/// <summary>
|
||||
/// Returns days until expiry (negative = days past expiry). Returns null if no end date set.
|
||||
|
||||
Reference in New Issue
Block a user