feat(subscription): gate insurance pages behind "insurance" plan feature
Wrap InsurancePricingPage and ClaimsPage in <FeatureGate feature="insurance"> so direct-URL access is blocked without an active subscription that enables the feature. Add feature: "insurance" to the sidebar links (doctor/clinic/ secretary sections) so the menu items hide when the plan lacks it. Make AdminSubscriptionPage feature controls dynamic: derive the plan feature checkboxes from FEATURE_LABELS (now including "insurance") and switch the Zod schema to z.record, so adding a feature only touches the label map. No backend/migration change: plan.features is free-form JSON; existing plans default to insurance:false and admins enable it per plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -197,11 +197,13 @@ function buildSections(
|
||||
to: "/admin/insurance-pricing",
|
||||
icon: ShieldCheckIcon,
|
||||
label: "قیمتگذاری بیمه",
|
||||
feature: "insurance",
|
||||
},
|
||||
{
|
||||
to: "/admin/claims",
|
||||
icon: DocumentTextIcon,
|
||||
label: "مطالبات بیمه",
|
||||
feature: "insurance",
|
||||
},
|
||||
{ to: "/admin/staff", icon: UserPlusIcon, label: "پرسنل" },
|
||||
{
|
||||
@@ -276,11 +278,13 @@ function buildSections(
|
||||
to: "/admin/insurance-pricing",
|
||||
icon: ShieldCheckIcon,
|
||||
label: "قیمتگذاری بیمه",
|
||||
feature: "insurance",
|
||||
},
|
||||
{
|
||||
to: "/admin/claims",
|
||||
icon: DocumentTextIcon,
|
||||
label: "مطالبات بیمه",
|
||||
feature: "insurance",
|
||||
},
|
||||
{ to: "/admin/staff", icon: UserPlusIcon, label: "پرسنل" },
|
||||
{
|
||||
@@ -345,11 +349,13 @@ function buildSections(
|
||||
to: "/admin/insurance-pricing",
|
||||
icon: ShieldCheckIcon,
|
||||
label: "قیمتگذاری بیمه",
|
||||
feature: "insurance",
|
||||
},
|
||||
{
|
||||
to: "/admin/claims",
|
||||
icon: DocumentTextIcon,
|
||||
label: "مطالبات بیمه",
|
||||
feature: "insurance",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user