feat: separate prior records behind an owner switch and count last-period questions

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-15 10:48:30 +03:30
co-authored by Cursor
parent 3a8a684aa4
commit 6bc5e1bec7
29 changed files with 775 additions and 77 deletions
+14 -2
View File
@@ -42,6 +42,8 @@ export interface AuthUserDto {
enabledModules?: OrgModuleKey[];
/** خلاصه اشتراک مالک محیط (برای اعضا فقط جهت نمایش/گیت ورود) */
subscription?: SubscriptionSummaryDto | null;
/** اگر باشد، این کاربر سوئیچ «بایگانی اطلاعات قبل» را دارد */
priorArchive?: { lens: "current" | "archive" } | null;
}
export type BillingPlanCode =
@@ -141,7 +143,8 @@ export type OrgModuleKey =
| "leads"
| "conversations"
| "routines"
| "gamification";
| "gamification"
| "prior_data_archive";
export const ORG_MODULE_KEYS: OrgModuleKey[] = [
"customers",
@@ -182,6 +185,7 @@ export const ORG_MODULE_KEYS: OrgModuleKey[] = [
"conversations",
"routines",
"gamification",
"prior_data_archive",
];
export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
@@ -223,6 +227,7 @@ export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
conversations: "گفتگو",
routines: "کارهای روتین",
gamification: "باشگاه امتیازات",
prior_data_archive: "بایگانی اطلاعات قبل",
};
export const ORG_MODULE_GROUPS: Array<{
@@ -287,7 +292,10 @@ export function isOrgModuleKey(value: string): value is OrgModuleKey {
}
/** ماژول‌هایی که باید صراحتاً توسط سوپرادمین فعال شوند */
export const OPT_IN_ORG_MODULES: OrgModuleKey[] = ["workflow_automations_advanced"];
export const OPT_IN_ORG_MODULES: OrgModuleKey[] = [
"workflow_automations_advanced",
"prior_data_archive",
];
export function defaultEnabledModules(): OrgModuleKey[] {
return ORG_MODULE_KEYS.filter((k) => !OPT_IN_ORG_MODULES.includes(k));
@@ -346,6 +354,8 @@ export interface OrgUserDto {
dataVisibility?: DataVisibility;
/** سطح دسترسی تفکیکی هر بخش (فقط بخش‌هایی که با پیش‌فرض فرق دارند) */
dataVisibilityScopes?: DataVisibilityScopes;
/** تیک مالک: این کاربر سوئیچ بایگانی اطلاعات قبل را ببیند */
priorArchiveEnabled?: boolean;
createdAt: string;
}
@@ -1465,6 +1475,8 @@ export interface ActivityDto {
/** زمان ارسال یادآور (اگر ارسال شده باشد) */
reminderSentAt: string | null;
completedAt: string | null;
/** manual یا didar؛ برای جدا کردن سابقهٔ قبلی */
importSource?: string;
tags: string[];
person: PersonSummaryDto | null;
company: CompanySummaryDto | null;