Add stackable add-ons with compounding integer features

- Add is_stackable field to AddOnProduct model for add-ons that can be
  purchased multiple times
- Add quantity field to SubscriptionAddOn for tracking purchase count
- Update EntitlementService to ADD integer add-on values to base plan
  (instead of max) and multiply by quantity for stackable add-ons
- Add feature selection to AddOnEditorModal using FeaturePicker component
- Add AddOnFeatureSerializer for nested feature CRUD on add-ons
- Fix Create Add-on button styling to use solid blue (was muted outline)
- Widen billing sidebar from 320px to 384px to prevent text wrapping

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-12 03:10:53 -05:00
parent 6afa3d7415
commit a8c271b5e3
18 changed files with 4715 additions and 36 deletions

View File

@@ -175,6 +175,20 @@ export interface PlanCreate {
max_custom_domains?: number;
}
export interface AddOnFeature {
id: number;
feature: Feature;
bool_value: boolean | null;
int_value: number | null;
value: boolean | number | null;
}
export interface AddOnFeatureWrite {
feature_code: string;
bool_value?: boolean | null;
int_value?: number | null;
}
export interface AddOnProduct {
id: number;
code: string;
@@ -184,7 +198,9 @@ export interface AddOnProduct {
price_one_time_cents: number;
stripe_product_id: string;
stripe_price_id: string;
is_stackable: boolean;
is_active: boolean;
features: AddOnFeature[];
}
export interface AddOnProductCreate {
@@ -195,7 +211,9 @@ export interface AddOnProductCreate {
price_one_time_cents?: number;
stripe_product_id?: string;
stripe_price_id?: string;
is_stackable?: boolean;
is_active?: boolean;
features?: AddOnFeatureWrite[];
}
// Grandfathering response when updating a version with subscribers