feat(db): mesh data model — meshes, members, invites, audit log
- pgSchema "mesh" with 4 tables isolating the peer mesh domain - Enums: visibility, transport, tier, role - audit_log is metadata-only (E2E encryption enforced at broker/client) - Cascade on mesh delete, soft-delete via archivedAt/revokedAt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
45
packages/billing/src/config/features.ts
Normal file
45
packages/billing/src/config/features.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { PricingPlanType } from "../types";
|
||||
|
||||
const FREE_FEATURES = {
|
||||
SYNC: "SYNC",
|
||||
BASIC_SUPPORT: "BASIC_SUPPORT",
|
||||
LIMITED_STORAGE: "LIMITED_STORAGE",
|
||||
EMAIL_NOTIFICATIONS: "EMAIL_NOTIFICATIONS",
|
||||
BASIC_REPORTS: "BASIC_REPORTS",
|
||||
} as const;
|
||||
|
||||
const PREMIUM_FEATURES = {
|
||||
...FREE_FEATURES,
|
||||
ADVANCED_SYNC: "ADVANCED_SYNC",
|
||||
PRIORITY_SUPPORT: "PRIORITY_SUPPORT",
|
||||
MORE_STORAGE: "MORE_STORAGE",
|
||||
TEAM_COLLABORATION: "TEAM_COLLABORATION",
|
||||
SMS_NOTIFICATIONS: "SMS_NOTIFICATIONS",
|
||||
ADVANCED_REPORTS: "ADVANCED_REPORTS",
|
||||
} as const;
|
||||
|
||||
const ENTERPRISE_FEATURES = {
|
||||
...PREMIUM_FEATURES,
|
||||
UNLIMITED_STORAGE: "UNLIMITED_STORAGE",
|
||||
CUSTOM_BRANDING: "CUSTOM_BRANDING",
|
||||
DEDICATED_SUPPORT: "DEDICATED_SUPPORT",
|
||||
API_ACCESS: "API_ACCESS",
|
||||
USER_ROLES: "USER_ROLES",
|
||||
AUDIT_LOGS: "AUDIT_LOGS",
|
||||
SINGLE_SIGN_ON: "SINGLE_SIGN_ON",
|
||||
ADVANCED_ANALYTICS: "ADVANCED_ANALYTICS",
|
||||
} as const;
|
||||
|
||||
export const FEATURES = {
|
||||
[PricingPlanType.FREE]: FREE_FEATURES,
|
||||
[PricingPlanType.PREMIUM]: PREMIUM_FEATURES,
|
||||
[PricingPlanType.ENTERPRISE]: ENTERPRISE_FEATURES,
|
||||
} as const;
|
||||
|
||||
export type FreeFeature = (typeof FREE_FEATURES)[keyof typeof FREE_FEATURES];
|
||||
export type PremiumFeature =
|
||||
(typeof PREMIUM_FEATURES)[keyof typeof PREMIUM_FEATURES];
|
||||
export type EnterpriseFeature =
|
||||
(typeof ENTERPRISE_FEATURES)[keyof typeof ENTERPRISE_FEATURES];
|
||||
|
||||
export type Feature = FreeFeature | PremiumFeature | EnterpriseFeature;
|
||||
Reference in New Issue
Block a user