TorbatYar/frontend/lib/business-bundles.ts
2026-07-28 20:39:10 +03:30

263 lines
7.5 KiB
TypeScript

/**
* DEPRECATED for Commercial Runtime Wave-2.
* Do not use as product/bundle source of truth.
* Use `@/modules/commercial/adapters` (registry / Core discovery).
* Kept temporarily for any legacy imports outside commercial path.
*/
/** @deprecated Commercial Wave-2 — use commercial adapters */
export type BusinessIntentId =
| "restaurant"
| "clinic"
| "beauty"
| "sports"
| "retail"
| "delivery_company"
| "corporate_crm"
| "education";
export interface RecommendedService {
appId: string;
href: string;
label: string;
reason: string;
required: boolean;
}
export interface CommercialBundle {
id: string;
intent: BusinessIntentId;
name: string;
tagline: string;
monthlyHint: string;
services: RecommendedService[];
}
export const BUSINESS_INTENTS: {
id: BusinessIntentId;
label: string;
description: string;
icon: string;
}[] = [
{
id: "restaurant",
label: "رستوران / کافه",
description: "منو، سفارش، پیک، پرداخت و وفاداری",
icon: "🍽️",
},
{
id: "clinic",
label: "کلینیک / مطب",
description: "سایت، نوبت، پیامک یادآوری، حسابداری",
icon: "🏥",
},
{
id: "beauty",
label: "سالن زیبایی",
description: "نوبت، خدمات، CRM و پرداخت",
icon: "💅",
},
{
id: "sports",
label: "مرکز ورزشی",
description: "عضویت، تمرین، صندوق و وفاداری",
icon: "🏋️",
},
{
id: "retail",
label: "فروشگاه",
description: "سایت، پرداخت، پیک و امتیاز",
icon: "🛍️",
},
{
id: "delivery_company",
label: "شرکت پخش / پیک",
description: "ناوگان، دیسپچ، تسویه و پیامک",
icon: "🚚",
},
{
id: "corporate_crm",
label: "سازمان / فروش B2B",
description: "CRM، حسابداری و ارتباطات",
icon: "🤝",
},
{
id: "education",
label: "آموزشگاه",
description: "سایت، CRM، پیامک و حسابداری",
icon: "📚",
},
];
const S = {
hospitality: {
appId: "hospitality",
href: "/hospitality/hub",
label: "تربت فود",
reason: "منو، شعبه، سفارش و عملیات رستوران",
required: true,
},
experience: {
appId: "experience",
href: "/experience/hub",
label: "تربت پیجز",
reason: "سایت و صفحه عمومی کسب‌وکار",
required: true,
},
payment: {
appId: "payment",
href: "/payment/hub",
label: "تربت‌پی",
reason: "دریافت آنلاین وجه و درگاه",
required: true,
},
delivery: {
appId: "delivery",
href: "/delivery/hub",
label: "تربت درایور",
reason: "پیک، دیسپچ و تسویه",
required: false,
},
loyalty: {
appId: "loyalty",
href: "/loyalty/hub",
label: "تربت وفاداری",
reason: "امتیاز، کیف پول و کمپین",
required: false,
},
communication: {
appId: "communication",
href: "/communication",
label: "تربت ارتباط",
reason: "پیامک، قالب و اطلاع‌رسانی",
required: true,
},
accounting: {
appId: "accounting",
href: "/accounting",
label: "حسابداری",
reason: "فاکتور، قرارداد و ثبت مالی",
required: true,
},
crm: {
appId: "crm",
href: "/crm/hub",
label: "CRM",
reason: "سرنخ، مشتری و فروش",
required: false,
},
healthcare: {
appId: "healthcare",
href: "/healthcare/hub",
label: "تربت هلث",
reason: "کلینیک، پزشک و نوبت",
required: true,
},
beauty: {
appId: "beauty",
href: "/beauty/hub",
label: "تربت بیوتی",
reason: "سالن، خدمات و نوبت زیبایی",
required: true,
},
sports: {
appId: "sports_center",
href: "/sports-center/hub",
label: "مرکز ورزشی",
reason: "عضویت، تمرین و صندوق",
required: true,
},
} as const;
export const COMMERCIAL_BUNDLES: CommercialBundle[] = [
{
id: "restaurant_starter",
intent: "restaurant",
name: "Restaurant Starter",
tagline: "منو + سایت + پرداخت برای شروع",
monthlyHint: "پایه — فعال‌سازی سرویس‌های موجود",
services: [S.hospitality, S.experience, S.payment, S.communication, S.accounting],
},
{
id: "restaurant_pro",
intent: "restaurant",
name: "Restaurant Professional",
tagline: "پیک، وفاداری و CRM روی استارتر",
monthlyHint: "حرفه‌ای — همان سرویس‌ها + پیک و وفاداری",
services: [
S.hospitality,
S.experience,
S.payment,
S.delivery,
S.loyalty,
S.communication,
S.accounting,
S.crm,
],
},
{
id: "medical_clinic",
intent: "clinic",
name: "Medical Clinic",
tagline: "هلث + سایت + پیامک + حسابداری",
monthlyHint: "کلینیک — بدون سرویس Booking جدا (آینده)",
services: [S.healthcare, S.experience, S.payment, S.communication, S.accounting, S.crm],
},
{
id: "beauty_salon",
intent: "beauty",
name: "Beauty Salon",
tagline: "بیوتی + سایت + پرداخت + وفاداری",
monthlyHint: "سالن زیبایی",
services: [S.beauty, S.experience, S.payment, S.loyalty, S.communication, S.accounting],
},
{
id: "sports_center",
intent: "sports",
name: "Sports Center",
tagline: "مرکز ورزشی + پرداخت + وفاداری",
monthlyHint: "باشگاه و مرکز ورزشی",
services: [S.sports, S.experience, S.payment, S.loyalty, S.communication, S.accounting],
},
{
id: "retail_shop",
intent: "retail",
name: "Retail Shop",
tagline: "سایت + پرداخت + پیک + وفاداری",
monthlyHint: "فروشگاه — Ecommerce جدا هنوز foundation نیست",
services: [S.experience, S.payment, S.delivery, S.loyalty, S.communication, S.accounting, S.crm],
},
{
id: "delivery_company",
intent: "delivery_company",
name: "Delivery Company",
tagline: "ناوگان، دیسپچ و تسویه",
monthlyHint: "شرکت پخش",
services: [S.delivery, S.payment, S.communication, S.accounting, S.crm],
},
{
id: "corporate_crm",
intent: "corporate_crm",
name: "Corporate CRM",
tagline: "فروش سازمانی + حسابداری + پیامک",
monthlyHint: "سازمان / B2B",
services: [S.crm, S.accounting, S.communication, S.experience, S.payment],
},
{
id: "education_center",
intent: "education",
name: "Educational Center",
tagline: "سایت + CRM + پیامک + حسابداری",
monthlyHint: "آموزشگاه — Academy foundation آینده است",
services: [S.experience, S.crm, S.communication, S.accounting, S.payment],
},
];
export function bundlesForIntent(intent: BusinessIntentId): CommercialBundle[] {
return COMMERCIAL_BUNDLES.filter((b) => b.intent === intent);
}
export function primaryBundle(intent: BusinessIntentId): CommercialBundle {
return bundlesForIntent(intent)[0]!;
}