33 lines
1.7 KiB
TypeScript
33 lines
1.7 KiB
TypeScript
/**
|
|
* Feature gates per billing plan. "free" = no active subscription.
|
|
* Keep in sync with the App Store listing and shopify.server.ts billing config.
|
|
*/
|
|
export interface Features {
|
|
maxLocations: number;
|
|
monthlyBookings: number | null;
|
|
productRules: boolean;
|
|
inventoryAware: boolean;
|
|
peakDays: boolean;
|
|
waitlist: boolean;
|
|
freshness: boolean;
|
|
smsWhatsapp: boolean;
|
|
runSheets: boolean;
|
|
drivingDistance: boolean;
|
|
}
|
|
|
|
const PLANS: Record<string, Features> = {
|
|
free: { maxLocations: 1, monthlyBookings: 50, productRules: true, inventoryAware: false, peakDays: false, waitlist: false, freshness: false, smsWhatsapp: false, runSheets: false, drivingDistance: false },
|
|
Growth: { maxLocations: 3, monthlyBookings: null, productRules: true, inventoryAware: true, peakDays: true, waitlist: true, freshness: true, smsWhatsapp: false, runSheets: true, drivingDistance: false },
|
|
Pro: { maxLocations: 50, monthlyBookings: null, productRules: true, inventoryAware: true, peakDays: true, waitlist: true, freshness: true, smsWhatsapp: true, runSheets: true, drivingDistance: true },
|
|
};
|
|
|
|
export function features(plan: string): Features {
|
|
return PLANS[plan] ?? PLANS.free;
|
|
}
|
|
|
|
export const PLAN_COPY = [
|
|
{ id: "free", name: "Starter", price: "Free", points: ["1 location", "50 scheduled orders a month", "Capacity holds and cutoffs", "Email reminders"] },
|
|
{ id: "Growth", name: "Growth", price: "$19/month", points: ["Up to 3 locations", "Unlimited orders", "Festival rush control and waitlist", "Fresh-stock windows", "Driver run sheets"] },
|
|
{ id: "Pro", name: "Pro", price: "$49/month", points: ["Up to 50 locations", "SMS and WhatsApp reminders", "Driving-distance zones", "Everything in Growth"] },
|
|
];
|