Add internal org chat (phase 1) with DM, groups, and org settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-29 10:34:01 +03:30
co-authored by Cursor
parent 589c763ef8
commit a1655432fc
21 changed files with 1912 additions and 8 deletions
+71 -3
View File
@@ -125,7 +125,8 @@ export type OrgModuleKey =
| "woocommerce"
| "voip"
| "reservations"
| "leads";
| "leads"
| "conversations";
export const ORG_MODULE_KEYS: OrgModuleKey[] = [
"customers",
@@ -161,6 +162,7 @@ export const ORG_MODULE_KEYS: OrgModuleKey[] = [
"woocommerce",
"voip",
"reservations",
"conversations",
];
export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
@@ -197,6 +199,7 @@ export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
woocommerce: "ووکامرس",
voip: "تلفن سازمانی",
reservations: "رزرو و نوبت‌دهی",
conversations: "گفتگوی درون‌سازمانی",
};
export const ORG_MODULE_GROUPS: Array<{
@@ -217,7 +220,7 @@ export const ORG_MODULE_GROUPS: Array<{
],
},
{ title: "فعالیت‌ها", keys: ["activities", "notes"] },
{ title: "پشتیبانی", keys: ["tickets", "faq"] },
{ title: "پشتیبانی", keys: ["tickets", "faq", "conversations"] },
{
title: "اتوماسیون",
keys: [
@@ -339,7 +342,9 @@ export type RolePermissionKey =
| "activities"
| "notes"
| "reports"
| "audit";
| "audit"
| "conversations"
| "conversations_groups";
export const ROLE_PERMISSION_ITEMS: Array<{
key: RolePermissionKey;
@@ -353,6 +358,8 @@ export const ROLE_PERMISSION_ITEMS: Array<{
{ key: "notes", label: "یادداشت‌ها" },
{ key: "reports", label: "گزارش‌ها" },
{ key: "audit", label: "لاگ فعالیت کاربران" },
{ key: "conversations", label: "گفتگوی درون‌سازمانی" },
{ key: "conversations_groups", label: "ساخت گروه گفتگو" },
];
export interface OrgRoleMemberDto {
@@ -3920,3 +3927,64 @@ export interface LeadBoardColumnDto {
stage: LeadStageDto;
leads: LeadDto[];
}
export interface ConversationSettingsDto {
chatHost: string;
uploadUrl: string;
downloadUrl: string;
apiKeySet: boolean;
updatedAt: string;
}
export interface UpdateConversationSettingsRequest {
chatHost: string;
apiKey?: string;
uploadUrl?: string;
downloadUrl?: string;
}
export interface ConversationAccessDto {
canUse: boolean;
canCreateGroup: boolean;
}
export interface ConversationSessionDto {
chatUserId: string;
wsUrl: string;
messagesBaseUrl: string;
uploadUrl: string;
downloadUrl: string;
}
export interface ConversationPeerDto {
id: string;
fullName: string;
hasAvatar: boolean;
chatUserId: string;
}
export interface ConversationRoomDto {
id: string;
externalRoomId: string;
kind: "dm" | "group";
name: string;
unreadCount: number;
lastMessagePreview: string | null;
lastMessageAt: string | null;
peerUserId: string | null;
}
export interface CreateConversationDmRequest {
peerUserId: string;
}
export interface CreateConversationGroupRequest {
name: string;
memberUserIds: string[];
}
export interface PlatformConversationStatsDto {
organizationsWithChat: number;
totalConfiguredOrgs: number;
totalRoomsTracked: number;
}