33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
export const productIds = [
|
|
"report_center",
|
|
"rectification",
|
|
"compatibility",
|
|
"prashna",
|
|
"muhurta",
|
|
"annual_report",
|
|
] as const;
|
|
|
|
export type ProductId = typeof productIds[number];
|
|
|
|
export type ProductDefinition = Readonly<{
|
|
id: ProductId;
|
|
featureFlagKey: `product.${ProductId}`;
|
|
defaultEnabled: boolean;
|
|
surface: "global" | "case" | "dual_profile" | "question_chart" | "electional" | "annual_report";
|
|
}>;
|
|
|
|
export const productRegistry = [
|
|
{ id: "report_center", featureFlagKey: "product.report_center", defaultEnabled: true, surface: "global" },
|
|
{ id: "rectification", featureFlagKey: "product.rectification", defaultEnabled: true, surface: "case" },
|
|
{ id: "compatibility", featureFlagKey: "product.compatibility", defaultEnabled: true, surface: "dual_profile" },
|
|
{ id: "prashna", featureFlagKey: "product.prashna", defaultEnabled: false, surface: "question_chart" },
|
|
{ id: "muhurta", featureFlagKey: "product.muhurta", defaultEnabled: false, surface: "electional" },
|
|
{ id: "annual_report", featureFlagKey: "product.annual_report", defaultEnabled: false, surface: "annual_report" },
|
|
] as const satisfies readonly ProductDefinition[];
|
|
|
|
export function productDefinition(product: ProductId): ProductDefinition {
|
|
const definition = productRegistry.find((item) => item.id === product);
|
|
if (!definition) throw new Error("product_registry_incomplete");
|
|
return definition;
|
|
}
|