Add lead company logos and refine Leads stats cards.
Leads can upload/change/remove a logo shown in the list; stats use fixed stage labels with accurate non-archived counts.
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Lead" ADD COLUMN IF NOT EXISTS "logoStorageKey" TEXT;
|
||||||
@@ -1967,6 +1967,8 @@ model Lead {
|
|||||||
trade String?
|
trade String?
|
||||||
source String?
|
source String?
|
||||||
notes String?
|
notes String?
|
||||||
|
/// لوگوی فروشگاه / شرکت
|
||||||
|
logoStorageKey String?
|
||||||
estimatedValue Decimal? @db.Decimal(18, 2)
|
estimatedValue Decimal? @db.Decimal(18, 2)
|
||||||
stageId String
|
stageId String
|
||||||
stage LeadStage @relation(fields: [stageId], references: [id], onDelete: Restrict)
|
stage LeadStage @relation(fields: [stageId], references: [id], onDelete: Restrict)
|
||||||
|
|||||||
@@ -9,15 +9,11 @@ const DEFAULT_STAGES: Array<{
|
|||||||
isLost?: boolean;
|
isLost?: boolean;
|
||||||
isUnqualified?: boolean;
|
isUnqualified?: boolean;
|
||||||
}> = [
|
}> = [
|
||||||
{ name: 'جدید', color: 'sky' },
|
{ name: 'جدید', color: 'amber' },
|
||||||
{ name: 'تماس اولیه', color: 'teal' },
|
{ name: 'در حال پیگیری', color: 'peach' },
|
||||||
{ name: 'عدم پاسخ', color: 'amber' },
|
{ name: 'عدم پاسخ', color: 'rose' },
|
||||||
{ name: 'پیگیری مجدد', color: 'amber' },
|
{ name: 'مذاکره', color: 'mint' },
|
||||||
{ name: 'تماس موفق', color: 'mint' },
|
{ name: 'آماده خرید', color: 'violet' },
|
||||||
{ name: 'علاقهمند', color: 'violet' },
|
|
||||||
{ name: 'واجد شرایط', color: 'violet' },
|
|
||||||
{ name: 'مذاکره', color: 'peach' },
|
|
||||||
{ name: 'آماده خرید', color: 'rose' },
|
|
||||||
{ name: 'تبدیلشده', color: 'teal', isConverted: true },
|
{ name: 'تبدیلشده', color: 'teal', isConverted: true },
|
||||||
{ name: 'از دست رفته', color: 'rose', isLost: true },
|
{ name: 'از دست رفته', color: 'rose', isLost: true },
|
||||||
{ name: 'نامرتبط', color: 'amber', isUnqualified: true },
|
{ name: 'نامرتبط', color: 'amber', isUnqualified: true },
|
||||||
@@ -51,7 +47,13 @@ export class LeadStagesService {
|
|||||||
const rows = await this.prisma.leadStage.findMany({
|
const rows = await this.prisma.leadStage.findMany({
|
||||||
where: { organizationId },
|
where: { organizationId },
|
||||||
orderBy: { position: 'asc' },
|
orderBy: { position: 'asc' },
|
||||||
include: { _count: { select: { leads: true } } },
|
include: {
|
||||||
|
_count: {
|
||||||
|
select: {
|
||||||
|
leads: { where: { archivedAt: null } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
return rows.map((r) => this.toDto(r));
|
return rows.map((r) => this.toDto(r));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { FileInterceptor } from '@nestjs/platform-express';
|
import { FileInterceptor } from '@nestjs/platform-express';
|
||||||
|
import { memoryStorage } from 'multer';
|
||||||
import type { Response } from 'express';
|
import type { Response } from 'express';
|
||||||
import ExcelJS from 'exceljs';
|
import ExcelJS from 'exceljs';
|
||||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||||
@@ -295,6 +296,32 @@ export class LeadsController {
|
|||||||
return this.leads.get(user, id);
|
return this.leads.get(user, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get(':id/logo')
|
||||||
|
async logo(@CurrentUser() user: Actor, @Param('id') id: string) {
|
||||||
|
const file = await this.leads.openLogo(user, id);
|
||||||
|
return new StreamableFile(file.stream, { type: file.mimeType });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post(':id/logo')
|
||||||
|
@UseInterceptors(
|
||||||
|
FileInterceptor('file', {
|
||||||
|
storage: memoryStorage(),
|
||||||
|
limits: { fileSize: 2 * 1024 * 1024 },
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
uploadLogo(
|
||||||
|
@CurrentUser() user: Actor,
|
||||||
|
@Param('id') id: string,
|
||||||
|
@UploadedFile() file: Express.Multer.File,
|
||||||
|
) {
|
||||||
|
return this.leads.saveLogo(user, id, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Delete(':id/logo')
|
||||||
|
removeLogo(@CurrentUser() user: Actor, @Param('id') id: string) {
|
||||||
|
return this.leads.removeLogo(user, id);
|
||||||
|
}
|
||||||
|
|
||||||
@Patch(':id')
|
@Patch(':id')
|
||||||
update(
|
update(
|
||||||
@CurrentUser() user: Actor,
|
@CurrentUser() user: Actor,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
NotFoundException,
|
NotFoundException,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { Prisma } from '@prisma/client';
|
import { Prisma } from '@prisma/client';
|
||||||
|
import * as path from 'node:path';
|
||||||
import type {
|
import type {
|
||||||
ConvertLeadResult,
|
ConvertLeadResult,
|
||||||
LeadBoardColumnDto,
|
LeadBoardColumnDto,
|
||||||
@@ -20,8 +21,18 @@ import {
|
|||||||
elevated,
|
elevated,
|
||||||
} from '../common/record-scope';
|
} from '../common/record-scope';
|
||||||
import { emptyToNull, normalizePhone } from '../contacts/normalize';
|
import { emptyToNull, normalizePhone } from '../contacts/normalize';
|
||||||
|
import { LocalFileStorage } from '../storage/local-file.storage';
|
||||||
import { LeadStagesService } from './lead-stages.service';
|
import { LeadStagesService } from './lead-stages.service';
|
||||||
|
|
||||||
|
const LOGO_MAX_BYTES = 2 * 1024 * 1024;
|
||||||
|
const LOGO_EXT: Record<string, string> = {
|
||||||
|
'image/jpeg': 'jpg',
|
||||||
|
'image/jpg': 'jpg',
|
||||||
|
'image/png': 'png',
|
||||||
|
'image/webp': 'webp',
|
||||||
|
'image/gif': 'gif',
|
||||||
|
};
|
||||||
|
|
||||||
function mobileKey(raw: string | null | undefined): string | null {
|
function mobileKey(raw: string | null | undefined): string | null {
|
||||||
const n = normalizePhone(raw);
|
const n = normalizePhone(raw);
|
||||||
if (!n) return null;
|
if (!n) return null;
|
||||||
@@ -57,6 +68,7 @@ export class LeadsService {
|
|||||||
constructor(
|
constructor(
|
||||||
private readonly prisma: PrismaService,
|
private readonly prisma: PrismaService,
|
||||||
private readonly stages: LeadStagesService,
|
private readonly stages: LeadStagesService,
|
||||||
|
private readonly files: LocalFileStorage,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async list(
|
async list(
|
||||||
@@ -994,8 +1006,72 @@ export class LeadsService {
|
|||||||
convertedAt: row.convertedAt?.toISOString() ?? null,
|
convertedAt: row.convertedAt?.toISOString() ?? null,
|
||||||
archivedAt: row.archivedAt?.toISOString() ?? null,
|
archivedAt: row.archivedAt?.toISOString() ?? null,
|
||||||
daysInStage,
|
daysInStage,
|
||||||
|
hasLogo: Boolean(row.logoStorageKey),
|
||||||
createdAt: row.createdAt.toISOString(),
|
createdAt: row.createdAt.toISOString(),
|
||||||
updatedAt: row.updatedAt.toISOString(),
|
updatedAt: row.updatedAt.toISOString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async saveLogo(
|
||||||
|
actor: Actor,
|
||||||
|
id: string,
|
||||||
|
file: Express.Multer.File | undefined,
|
||||||
|
): Promise<LeadDto> {
|
||||||
|
if (!file?.buffer?.length) {
|
||||||
|
throw new BadRequestException('فایل تصویر ارسال نشده');
|
||||||
|
}
|
||||||
|
if (file.size > LOGO_MAX_BYTES) {
|
||||||
|
throw new BadRequestException('حجم تصویر باید کمتر از ۲ مگابایت باشد');
|
||||||
|
}
|
||||||
|
const mime = (file.mimetype || '').toLowerCase();
|
||||||
|
const ext = LOGO_EXT[mime];
|
||||||
|
if (!ext) {
|
||||||
|
throw new BadRequestException('فقط تصویر JPG، PNG، WebP یا GIF مجاز است');
|
||||||
|
}
|
||||||
|
const existing = await this.findAccessible(actor, id);
|
||||||
|
const prevKey = existing.logoStorageKey;
|
||||||
|
const storageKey = path
|
||||||
|
.join(actor.organizationId, 'leads', id, `logo.${ext}`)
|
||||||
|
.replace(/\\/g, '/');
|
||||||
|
await this.files.save(storageKey, file.buffer);
|
||||||
|
if (prevKey && prevKey !== storageKey) {
|
||||||
|
await this.files.remove(prevKey);
|
||||||
|
}
|
||||||
|
const row = await this.prisma.lead.update({
|
||||||
|
where: { id },
|
||||||
|
data: { logoStorageKey: storageKey },
|
||||||
|
include: leadInclude,
|
||||||
|
});
|
||||||
|
await this.addEvent(actor, id, 'note', 'لوگو بهروز شد', null);
|
||||||
|
return this.toDto(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
async removeLogo(actor: Actor, id: string): Promise<LeadDto> {
|
||||||
|
const existing = await this.findAccessible(actor, id);
|
||||||
|
if (existing.logoStorageKey) {
|
||||||
|
await this.files.remove(existing.logoStorageKey);
|
||||||
|
}
|
||||||
|
const row = await this.prisma.lead.update({
|
||||||
|
where: { id },
|
||||||
|
data: { logoStorageKey: null },
|
||||||
|
include: leadInclude,
|
||||||
|
});
|
||||||
|
return this.toDto(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
async openLogo(actor: Actor, id: string) {
|
||||||
|
const existing = await this.findAccessible(actor, id);
|
||||||
|
if (!existing.logoStorageKey) {
|
||||||
|
throw new NotFoundException('لوگو تنظیم نشده');
|
||||||
|
}
|
||||||
|
const storageKey = existing.logoStorageKey;
|
||||||
|
const ext = path.extname(storageKey).slice(1).toLowerCase();
|
||||||
|
const mime =
|
||||||
|
Object.entries(LOGO_EXT).find(([, value]) => value === ext)?.[0] ??
|
||||||
|
'image/jpeg';
|
||||||
|
return {
|
||||||
|
stream: this.files.openReadStream(storageKey),
|
||||||
|
mimeType: mime,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,56 @@ type SortKey = 'updated' | 'newest' | 'follow_up' | 'last_contact';
|
|||||||
type StageTint = 'mint' | 'amber' | 'peach' | 'sky' | 'violet' | 'rose' | 'teal';
|
type StageTint = 'mint' | 'amber' | 'peach' | 'sky' | 'violet' | 'rose' | 'teal';
|
||||||
type RowIcon = 'building' | 'bag' | 'briefcase' | 'users' | 'target';
|
type RowIcon = 'building' | 'bag' | 'briefcase' | 'users' | 'target';
|
||||||
|
|
||||||
|
/** ردیف آمار صفحه لیدها — ترتیب و نامها مطابق طرح */
|
||||||
|
const LEAD_STAT_DEFS: Array<{
|
||||||
|
label: string;
|
||||||
|
/** نام وضعیتهای متناظر در دیتابیس */
|
||||||
|
match: string[];
|
||||||
|
tint: StageTint;
|
||||||
|
slot: 'pair' | 'solo';
|
||||||
|
}> = [
|
||||||
|
{
|
||||||
|
label: 'جدید',
|
||||||
|
match: ['جدید'],
|
||||||
|
tint: 'amber',
|
||||||
|
slot: 'pair',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'در حال پیگیری',
|
||||||
|
match: ['در حال پیگیری', 'پیگیری مجدد', 'تماس اولیه', 'تماس موفق'],
|
||||||
|
tint: 'peach',
|
||||||
|
slot: 'pair',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'مذاکره',
|
||||||
|
match: ['مذاکره'],
|
||||||
|
tint: 'mint',
|
||||||
|
slot: 'solo',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'آماده خرید',
|
||||||
|
match: ['آماده خرید'],
|
||||||
|
tint: 'violet',
|
||||||
|
slot: 'solo',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'عدم پاسخ',
|
||||||
|
match: ['عدم پاسخ'],
|
||||||
|
tint: 'rose',
|
||||||
|
slot: 'solo',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
type LeadStatCard = {
|
||||||
|
key: string;
|
||||||
|
label: string;
|
||||||
|
tint: StageTint;
|
||||||
|
count: number;
|
||||||
|
/** مرحله اصلی برای فیلتر */
|
||||||
|
stageId: string;
|
||||||
|
slot: 'pair' | 'solo';
|
||||||
|
};
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const auth = useAuthStore();
|
const auth = useAuthStore();
|
||||||
@@ -61,6 +111,11 @@ const sourceOptions = ref<string[]>([]);
|
|||||||
const selected = ref<Set<string>>(new Set());
|
const selected = ref<Set<string>>(new Set());
|
||||||
const sortOpen = ref(false);
|
const sortOpen = ref(false);
|
||||||
const rowMenuId = ref<string | null>(null);
|
const rowMenuId = ref<string | null>(null);
|
||||||
|
const logoMenuId = ref<string | null>(null);
|
||||||
|
const logoUrls = ref<Record<string, string>>({});
|
||||||
|
const logoBusyId = ref<string | null>(null);
|
||||||
|
const logoFileInput = ref<HTMLInputElement | null>(null);
|
||||||
|
const logoTargetId = ref<string | null>(null);
|
||||||
const assignOpen = ref(false);
|
const assignOpen = ref(false);
|
||||||
const stageOpen = ref(false);
|
const stageOpen = ref(false);
|
||||||
const assignUserId = ref('');
|
const assignUserId = ref('');
|
||||||
@@ -141,19 +196,51 @@ const sortLabels: Record<SortKey, string> = {
|
|||||||
last_contact: 'آخرین تماس',
|
last_contact: 'آخرین تماس',
|
||||||
};
|
};
|
||||||
|
|
||||||
const stageCards = computed(() => {
|
const stageCards = computed((): LeadStatCard[] => {
|
||||||
const board = stages.value.filter(
|
return LEAD_STAT_DEFS.map((def) => {
|
||||||
(s) => s.showOnBoard && !s.isConverted && !s.isLost && !s.isUnqualified,
|
const matched = stages.value.filter((s) =>
|
||||||
);
|
def.match.some((name) => s.name.trim() === name),
|
||||||
return board.slice(0, 5);
|
);
|
||||||
|
const count = matched.reduce((sum, s) => sum + (s.leadCount ?? 0), 0);
|
||||||
|
const primary =
|
||||||
|
matched.find((s) => s.name.trim() === def.match[0]) ?? matched[0];
|
||||||
|
return {
|
||||||
|
key: def.label,
|
||||||
|
label: def.label,
|
||||||
|
tint: def.tint,
|
||||||
|
count,
|
||||||
|
stageId: primary?.id ?? '',
|
||||||
|
slot: def.slot,
|
||||||
|
};
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const pairStages = computed(() =>
|
const pairStatCards = computed(() => stageCards.value.filter((c) => c.slot === 'pair'));
|
||||||
stageCards.value.length >= 2 ? stageCards.value.slice(0, 2) : [],
|
const soloStatCards = computed(() => stageCards.value.filter((c) => c.slot === 'solo'));
|
||||||
);
|
|
||||||
const soloStages = computed(() =>
|
const totalLeadsCount = computed(() => {
|
||||||
stageCards.value.length >= 2 ? stageCards.value.slice(2) : stageCards.value,
|
if (stats.value?.total != null) return stats.value.total;
|
||||||
);
|
return stages.value.reduce((sum, s) => sum + (s.leadCount ?? 0), 0) || total.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
function isStatActive(card: LeadStatCard) {
|
||||||
|
if (!card.stageId || !stageId.value) return false;
|
||||||
|
if (stageId.value === card.stageId) return true;
|
||||||
|
const def = LEAD_STAT_DEFS.find((d) => d.label === card.label);
|
||||||
|
if (!def) return false;
|
||||||
|
const matchedIds = stages.value
|
||||||
|
.filter((s) => def.match.some((name) => s.name.trim() === name))
|
||||||
|
.map((s) => s.id);
|
||||||
|
return matchedIds.includes(stageId.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectStatCard(card: LeadStatCard) {
|
||||||
|
if (!card.stageId) {
|
||||||
|
setStageFilter('');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setStageFilter(isStatActive(card) ? '' : card.stageId);
|
||||||
|
}
|
||||||
|
|
||||||
const pageNumbers = computed(() => {
|
const pageNumbers = computed(() => {
|
||||||
const totalPages = pageCount.value;
|
const totalPages = pageCount.value;
|
||||||
@@ -251,10 +338,119 @@ function lastActivity(lead: LeadDto) {
|
|||||||
function closePopups() {
|
function closePopups() {
|
||||||
sortOpen.value = false;
|
sortOpen.value = false;
|
||||||
rowMenuId.value = null;
|
rowMenuId.value = null;
|
||||||
|
logoMenuId.value = null;
|
||||||
assignOpen.value = false;
|
assignOpen.value = false;
|
||||||
stageOpen.value = false;
|
stageOpen.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revokeLogoUrls(except?: Set<string>) {
|
||||||
|
const next: Record<string, string> = {};
|
||||||
|
for (const [id, url] of Object.entries(logoUrls.value)) {
|
||||||
|
if (except?.has(id)) {
|
||||||
|
next[id] = url;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
logoUrls.value = next;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadLogos(items: LeadDto[]) {
|
||||||
|
const keep = new Set(items.filter((l) => l.hasLogo).map((l) => l.id));
|
||||||
|
revokeLogoUrls(keep);
|
||||||
|
const pending = items.filter((l) => l.hasLogo && !logoUrls.value[l.id]);
|
||||||
|
await Promise.all(
|
||||||
|
pending.map(async (lead) => {
|
||||||
|
try {
|
||||||
|
const { data } = await api.get<Blob>(`/leads/${lead.id}/logo`, {
|
||||||
|
responseType: 'blob',
|
||||||
|
});
|
||||||
|
const url = URL.createObjectURL(data);
|
||||||
|
logoUrls.value = { ...logoUrls.value, [lead.id]: url };
|
||||||
|
} catch {
|
||||||
|
/* بدون لوگو */
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function openLogoPicker(leadId: string) {
|
||||||
|
logoMenuId.value = null;
|
||||||
|
logoTargetId.value = leadId;
|
||||||
|
logoFileInput.value?.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onLogoFile(ev: Event) {
|
||||||
|
const input = ev.target as HTMLInputElement;
|
||||||
|
const file = input.files?.[0];
|
||||||
|
const leadId = logoTargetId.value;
|
||||||
|
input.value = '';
|
||||||
|
logoTargetId.value = null;
|
||||||
|
if (!file || !leadId) return;
|
||||||
|
logoBusyId.value = leadId;
|
||||||
|
error.value = '';
|
||||||
|
try {
|
||||||
|
const form = new FormData();
|
||||||
|
form.append('file', file);
|
||||||
|
const { data: updated } = await api.post<LeadDto>(`/leads/${leadId}/logo`, form, {
|
||||||
|
headers: { 'Content-Type': 'multipart/form-data' },
|
||||||
|
});
|
||||||
|
if (data.value) {
|
||||||
|
data.value = {
|
||||||
|
...data.value,
|
||||||
|
items: data.value.items.map((l) => (l.id === leadId ? { ...l, hasLogo: true } : l)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const prev = logoUrls.value[leadId];
|
||||||
|
if (prev) URL.revokeObjectURL(prev);
|
||||||
|
const { data: blob } = await api.get<Blob>(`/leads/${leadId}/logo`, {
|
||||||
|
responseType: 'blob',
|
||||||
|
});
|
||||||
|
logoUrls.value = { ...logoUrls.value, [leadId]: URL.createObjectURL(blob) };
|
||||||
|
okMsg.value = `لوگوی «${updated.title}» ذخیره شد.`;
|
||||||
|
} catch (e) {
|
||||||
|
error.value = axios.isAxiosError(e)
|
||||||
|
? apiErrorMessage(e, 'آپلود لوگو ناموفق بود.')
|
||||||
|
: 'آپلود لوگو ناموفق بود.';
|
||||||
|
} finally {
|
||||||
|
logoBusyId.value = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function apiErrorMessage(e: unknown, fallback: string) {
|
||||||
|
if (axios.isAxiosError(e)) {
|
||||||
|
const msg = (e.response?.data as { message?: string | string[] })?.message;
|
||||||
|
return Array.isArray(msg) ? msg.join('، ') : (msg ?? fallback);
|
||||||
|
}
|
||||||
|
return fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeLeadLogo(leadId: string) {
|
||||||
|
logoMenuId.value = null;
|
||||||
|
if (!confirm('لوگوی این لید حذف شود؟')) return;
|
||||||
|
logoBusyId.value = leadId;
|
||||||
|
error.value = '';
|
||||||
|
try {
|
||||||
|
await api.delete(`/leads/${leadId}/logo`);
|
||||||
|
const prev = logoUrls.value[leadId];
|
||||||
|
if (prev) URL.revokeObjectURL(prev);
|
||||||
|
const next = { ...logoUrls.value };
|
||||||
|
delete next[leadId];
|
||||||
|
logoUrls.value = next;
|
||||||
|
if (data.value) {
|
||||||
|
data.value = {
|
||||||
|
...data.value,
|
||||||
|
items: data.value.items.map((l) => (l.id === leadId ? { ...l, hasLogo: false } : l)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
okMsg.value = 'لوگو حذف شد.';
|
||||||
|
} catch {
|
||||||
|
error.value = 'حذف لوگو ناموفق بود.';
|
||||||
|
} finally {
|
||||||
|
logoBusyId.value = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function patchQuery(next: Record<string, string | undefined>) {
|
function patchQuery(next: Record<string, string | undefined>) {
|
||||||
const query = { ...route.query, ...next };
|
const query = { ...route.query, ...next };
|
||||||
for (const key of Object.keys(query)) {
|
for (const key of Object.keys(query)) {
|
||||||
@@ -352,6 +548,7 @@ async function load() {
|
|||||||
selected.value = new Set(
|
selected.value = new Set(
|
||||||
[...selected.value].filter((id) => res.items.some((l) => l.id === id)),
|
[...selected.value].filter((id) => res.items.some((l) => l.id === id)),
|
||||||
);
|
);
|
||||||
|
void loadLogos(res.items);
|
||||||
const { data: nextStats } = await api
|
const { data: nextStats } = await api
|
||||||
.get<LeadStatsDto>('/leads/stats')
|
.get<LeadStatsDto>('/leads/stats')
|
||||||
.catch(() => ({ data: stats.value }));
|
.catch(() => ({ data: stats.value }));
|
||||||
@@ -762,7 +959,10 @@ onMounted(async () => {
|
|||||||
if (jobId) startImportPoll(jobId);
|
if (jobId) startImportPoll(jobId);
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(stopImportPoll);
|
onBeforeUnmount(() => {
|
||||||
|
stopImportPoll();
|
||||||
|
revokeLogoUrls();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -792,6 +992,13 @@ onBeforeUnmount(stopImportPoll);
|
|||||||
hidden
|
hidden
|
||||||
@change="onImportFile"
|
@change="onImportFile"
|
||||||
/>
|
/>
|
||||||
|
<input
|
||||||
|
ref="logoFileInput"
|
||||||
|
type="file"
|
||||||
|
accept="image/jpeg,image/png,image/webp,image/gif,.jpg,.jpeg,.png,.webp,.gif"
|
||||||
|
hidden
|
||||||
|
@change="onLogoFile"
|
||||||
|
/>
|
||||||
<PhoneContactsImport
|
<PhoneContactsImport
|
||||||
target="leads"
|
target="leads"
|
||||||
:disabled="busy"
|
:disabled="busy"
|
||||||
@@ -822,41 +1029,43 @@ onBeforeUnmount(stopImportPoll);
|
|||||||
@click="setStageFilter('')"
|
@click="setStageFilter('')"
|
||||||
>
|
>
|
||||||
<span class="stat-total-ico" aria-hidden="true">
|
<span class="stat-total-ico" aria-hidden="true">
|
||||||
<UiIcon name="users" :size="18" />
|
<UiIcon name="users" :size="20" />
|
||||||
</span>
|
</span>
|
||||||
<span class="stat-total-body">
|
<span class="stat-total-body">
|
||||||
<span class="stat-label">همه لیدها</span>
|
<span class="stat-label">همه لیدها</span>
|
||||||
<strong class="stat-num">{{ formatCount(stats?.total ?? total) }}</strong>
|
<strong class="stat-num">{{ formatCount(totalLeadsCount) }}</strong>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div v-if="pairStages.length" class="stat-pair" role="listitem">
|
<div class="stat-pair" role="group" aria-label="وضعیتهای پیگیری">
|
||||||
<button
|
<button
|
||||||
v-for="s in pairStages"
|
v-for="card in pairStatCards"
|
||||||
:key="s.id"
|
:key="card.key"
|
||||||
type="button"
|
type="button"
|
||||||
class="stat-cell"
|
class="stat-cell"
|
||||||
:class="{ on: stageId === s.id }"
|
:class="{ on: isStatActive(card), wide: card.key === 'در حال پیگیری' }"
|
||||||
@click="setStageFilter(s.id)"
|
:disabled="!card.stageId"
|
||||||
|
@click="selectStatCard(card)"
|
||||||
>
|
>
|
||||||
<i class="stat-dot" :data-tint="stageTint(s.color)" aria-hidden="true" />
|
<i class="stat-dot" :data-tint="card.tint" aria-hidden="true" />
|
||||||
<span class="stat-label">{{ s.name }}</span>
|
<span class="stat-label">{{ card.label }}</span>
|
||||||
<strong class="stat-num">{{ formatCount(s.leadCount ?? 0) }}</strong>
|
<strong class="stat-num">{{ formatCount(card.count) }}</strong>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
v-for="s in soloStages"
|
v-for="card in soloStatCards"
|
||||||
:key="s.id"
|
:key="card.key"
|
||||||
type="button"
|
type="button"
|
||||||
class="stat-cell alone"
|
class="stat-cell alone"
|
||||||
:class="{ on: stageId === s.id }"
|
:class="{ on: isStatActive(card) }"
|
||||||
role="listitem"
|
role="listitem"
|
||||||
@click="setStageFilter(s.id)"
|
:disabled="!card.stageId"
|
||||||
|
@click="selectStatCard(card)"
|
||||||
>
|
>
|
||||||
<i class="stat-dot" :data-tint="stageTint(s.color)" aria-hidden="true" />
|
<i class="stat-dot" :data-tint="card.tint" aria-hidden="true" />
|
||||||
<span class="stat-label">{{ s.name }}</span>
|
<span class="stat-label">{{ card.label }}</span>
|
||||||
<strong class="stat-num">{{ formatCount(s.leadCount ?? 0) }}</strong>
|
<strong class="stat-num">{{ formatCount(card.count) }}</strong>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1010,10 +1219,42 @@ onBeforeUnmount(stopImportPoll);
|
|||||||
class="row-click"
|
class="row-click"
|
||||||
@click="goDetail(lead.id)"
|
@click="goDetail(lead.id)"
|
||||||
>
|
>
|
||||||
<td class="icon-col">
|
<td class="icon-col" @click.stop>
|
||||||
<span class="row-ico" :data-tint="stageTintForLead(lead)">
|
<UiDropdownMenu
|
||||||
<UiIcon :name="rowIcon(lead)" :size="16" />
|
:open="logoMenuId === lead.id"
|
||||||
</span>
|
align="start"
|
||||||
|
@update:open="(v) => (logoMenuId = v ? lead.id : null)"
|
||||||
|
>
|
||||||
|
<template #trigger="{ toggle }">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="row-ico"
|
||||||
|
:class="{ busy: logoBusyId === lead.id }"
|
||||||
|
:data-tint="stageTintForLead(lead)"
|
||||||
|
:title="lead.hasLogo ? 'تغییر لوگو' : 'افزودن لوگو'"
|
||||||
|
@click.stop="toggle"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
v-if="logoUrls[lead.id]"
|
||||||
|
:src="logoUrls[lead.id]"
|
||||||
|
:alt="lead.title"
|
||||||
|
class="row-logo"
|
||||||
|
/>
|
||||||
|
<UiIcon v-else :name="rowIcon(lead)" :size="16" />
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
<button type="button" @click="openLogoPicker(lead.id)">
|
||||||
|
{{ lead.hasLogo ? 'تغییر لوگو' : 'افزودن لوگو' }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="lead.hasLogo"
|
||||||
|
type="button"
|
||||||
|
class="danger-item"
|
||||||
|
@click="removeLeadLogo(lead.id)"
|
||||||
|
>
|
||||||
|
حذف لوگو
|
||||||
|
</button>
|
||||||
|
</UiDropdownMenu>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<strong class="name">{{ lead.title }}</strong>
|
<strong class="name">{{ lead.title }}</strong>
|
||||||
@@ -1313,37 +1554,44 @@ onBeforeUnmount(stopImportPoll);
|
|||||||
|
|
||||||
.stats {
|
.stats {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: nowrap;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
gap: 0.75rem;
|
gap: 0.65rem;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-total {
|
.stat-total {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75rem;
|
gap: 0.7rem;
|
||||||
min-width: 9.5rem;
|
flex: 1.15 1 0;
|
||||||
padding: 0.85rem 1rem;
|
min-width: 8.5rem;
|
||||||
border: 1px solid #bbf7d0;
|
min-height: 5.25rem;
|
||||||
border-radius: 14px;
|
padding: 0.7rem 0.85rem;
|
||||||
|
border: 1px solid #a7f3d0;
|
||||||
|
border-radius: 12px;
|
||||||
background: #ecfdf5;
|
background: #ecfdf5;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
text-align: start;
|
text-align: start;
|
||||||
color: #047857;
|
color: #047857;
|
||||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
box-shadow: none;
|
||||||
transition: box-shadow 0.15s, border-color 0.15s;
|
transition: border-color 0.15s, box-shadow 0.15s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-total:hover,
|
.stat-total:hover,
|
||||||
.stat-total.on {
|
.stat-total.on {
|
||||||
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22);
|
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
|
||||||
border-color: #86efac;
|
border-color: #6ee7b7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-total-ico {
|
.stat-total-ico {
|
||||||
width: 2.4rem;
|
width: 2.5rem;
|
||||||
height: 2.4rem;
|
height: 2.5rem;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
color: #10b981;
|
color: #10b981;
|
||||||
@@ -1351,52 +1599,75 @@ onBeforeUnmount(stopImportPoll);
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
|
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
|
||||||
|
order: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-total-body {
|
.stat-total-body {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.1rem;
|
gap: 0.15rem;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-total .stat-label {
|
.stat-total .stat-label {
|
||||||
color: #059669;
|
color: #059669;
|
||||||
font-size: 0.82rem;
|
font-size: 0.8rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-total .stat-num {
|
.stat-total .stat-num {
|
||||||
color: #047857;
|
color: #047857;
|
||||||
font-size: 1.35rem;
|
font-size: 1.4rem;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
letter-spacing: -0.02em;
|
letter-spacing: -0.02em;
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
line-height: 1.15;
|
line-height: 1.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-pair {
|
.stat-pair {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
flex: 1 1 14rem;
|
flex: 2.2 1 0;
|
||||||
min-width: 12rem;
|
min-width: 14rem;
|
||||||
|
min-height: 5.25rem;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid #e5e7eb;
|
border: 1px solid #e5e7eb;
|
||||||
border-radius: 14px;
|
border-radius: 12px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
isolation: isolate;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-pair .stat-cell {
|
.stat-pair .stat-cell {
|
||||||
flex: 1 1 0;
|
flex: 1 1 0;
|
||||||
border: 0;
|
border: 0 !important;
|
||||||
border-radius: 0;
|
border-radius: 0 !important;
|
||||||
box-shadow: none;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
|
box-shadow: none !important;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-pair .stat-cell.wide {
|
||||||
|
flex: 1.45 1 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-pair .stat-cell + .stat-cell {
|
.stat-pair .stat-cell + .stat-cell {
|
||||||
border-inline-start: 1px solid #e5e7eb;
|
border-inline-start: 1px solid #e5e7eb !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-pair .stat-cell:hover:not(:disabled) {
|
||||||
|
background: #f8fafc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-pair .stat-cell.on {
|
||||||
|
background: color-mix(in srgb, var(--accent-soft) 70%, #fff);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-pair:has(.stat-cell.on) {
|
||||||
|
border-color: color-mix(in srgb, var(--accent) 35%, #e5e7eb);
|
||||||
|
box-shadow: 0 0 0 2px var(--accent-soft);
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-cell {
|
.stat-cell {
|
||||||
@@ -1405,82 +1676,85 @@ onBeforeUnmount(stopImportPoll);
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 0.2rem;
|
gap: 0.12rem;
|
||||||
min-width: 6.5rem;
|
min-width: 5.5rem;
|
||||||
padding: 0.85rem 0.9rem 0.75rem;
|
min-height: 5.25rem;
|
||||||
|
padding: 1.15rem 0.65rem 0.7rem;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid #e5e7eb;
|
border: 1px solid #e5e7eb;
|
||||||
border-radius: 14px;
|
border-radius: 12px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
color: #0f172a;
|
color: #0f172a;
|
||||||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
|
||||||
transition: box-shadow 0.15s, border-color 0.15s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-cell.alone {
|
.stat-cell.alone {
|
||||||
flex: 0 1 7.5rem;
|
flex: 1 1 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-cell:hover,
|
.stat-cell:disabled {
|
||||||
.stat-cell.on {
|
opacity: 0.55;
|
||||||
border-color: color-mix(in srgb, var(--accent) 40%, #e5e7eb);
|
cursor: default;
|
||||||
box-shadow: 0 0 0 2px var(--accent-soft);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-pair:has(.stat-cell.on) {
|
.stat-cell.alone:hover:not(:disabled),
|
||||||
border-color: color-mix(in srgb, var(--accent) 40%, #e5e7eb);
|
.stat-cell.alone.on {
|
||||||
|
border-color: color-mix(in srgb, var(--accent) 35%, #e5e7eb);
|
||||||
box-shadow: 0 0 0 2px var(--accent-soft);
|
box-shadow: 0 0 0 2px var(--accent-soft);
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-dot {
|
.stat-dot {
|
||||||
width: 0.55rem;
|
position: absolute;
|
||||||
height: 0.55rem;
|
top: 0.65rem;
|
||||||
|
left: 0.7rem;
|
||||||
|
width: 0.5rem;
|
||||||
|
height: 0.5rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
margin-bottom: 0.15rem;
|
|
||||||
background: #94a3b8;
|
background: #94a3b8;
|
||||||
box-shadow: 0 0 0 4px color-mix(in srgb, #94a3b8 18%, transparent);
|
box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-dot[data-tint='mint'],
|
.stat-dot[data-tint='mint'],
|
||||||
.stat-dot[data-tint='teal'] {
|
.stat-dot[data-tint='teal'] {
|
||||||
background: #10b981;
|
background: #22c55e;
|
||||||
box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
|
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
|
||||||
}
|
}
|
||||||
.stat-dot[data-tint='amber'] {
|
.stat-dot[data-tint='amber'] {
|
||||||
background: #f59e0b;
|
background: #f59e0b;
|
||||||
box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
|
box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22);
|
||||||
}
|
}
|
||||||
.stat-dot[data-tint='peach'] {
|
.stat-dot[data-tint='peach'] {
|
||||||
background: #f97316;
|
background: #fbbf24;
|
||||||
box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
|
box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.22);
|
||||||
}
|
}
|
||||||
.stat-dot[data-tint='sky'] {
|
.stat-dot[data-tint='sky'] {
|
||||||
background: #0ea5e9;
|
background: #0ea5e9;
|
||||||
box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
|
box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
|
||||||
}
|
}
|
||||||
.stat-dot[data-tint='violet'] {
|
.stat-dot[data-tint='violet'] {
|
||||||
background: #8b5cf6;
|
background: #8b5cf6;
|
||||||
box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18);
|
box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.22);
|
||||||
}
|
}
|
||||||
.stat-dot[data-tint='rose'] {
|
.stat-dot[data-tint='rose'] {
|
||||||
background: #ef4444;
|
background: #ef4444;
|
||||||
box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
|
box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-cell .stat-label {
|
.stat-cell .stat-label {
|
||||||
font-size: 0.8rem;
|
font-size: 0.78rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #64748b;
|
color: #334155;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
line-height: 1.25;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-cell .stat-num {
|
.stat-cell .stat-num {
|
||||||
font-size: 1.25rem;
|
font-size: 1.3rem;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
color: #0f172a;
|
color: #0f172a;
|
||||||
letter-spacing: -0.02em;
|
letter-spacing: -0.02em;
|
||||||
@@ -1488,14 +1762,24 @@ onBeforeUnmount(stopImportPoll);
|
|||||||
line-height: 1.15;
|
line-height: 1.15;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 720px) {
|
@media (max-width: 900px) {
|
||||||
.stat-pair {
|
.stats {
|
||||||
flex: 1 1 100%;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-cell.alone,
|
.stat-total,
|
||||||
.stat-total {
|
.stat-pair,
|
||||||
|
.stat-cell.alone {
|
||||||
flex: 1 1 calc(50% - 0.4rem);
|
flex: 1 1 calc(50% - 0.4rem);
|
||||||
|
min-width: 9rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 520px) {
|
||||||
|
.stat-total,
|
||||||
|
.stat-pair,
|
||||||
|
.stat-cell.alone {
|
||||||
|
flex: 1 1 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1727,14 +2011,36 @@ onBeforeUnmount(stopImportPoll);
|
|||||||
}
|
}
|
||||||
|
|
||||||
.row-ico {
|
.row-ico {
|
||||||
width: 2.1rem;
|
width: 2.35rem;
|
||||||
height: 2.1rem;
|
height: 2.35rem;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
border: 0;
|
||||||
|
padding: 0;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background: #ecfdf5;
|
background: #ecfdf5;
|
||||||
color: #059669;
|
color: #059669;
|
||||||
|
cursor: pointer;
|
||||||
|
overflow: hidden;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-ico.busy {
|
||||||
|
opacity: 0.55;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-logo {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-ico:has(.row-logo) {
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid var(--line, #e5e7eb);
|
||||||
}
|
}
|
||||||
|
|
||||||
.row-ico[data-tint='amber'] {
|
.row-ico[data-tint='amber'] {
|
||||||
|
|||||||
+245
-244
@@ -3,13 +3,13 @@ export type UserRole = "owner" | "admin" | "sales" | "support";
|
|||||||
export const USER_ROLES: UserRole[] = ["owner", "admin", "sales", "support"];
|
export const USER_ROLES: UserRole[] = ["owner", "admin", "sales", "support"];
|
||||||
|
|
||||||
export const USER_ROLE_LABELS: Record<UserRole, string> = {
|
export const USER_ROLE_LABELS: Record<UserRole, string> = {
|
||||||
owner: "مالک",
|
owner: "Ù
اÙÚ©",
|
||||||
admin: "مدیر",
|
admin: "Ù
Ø¯ÛØ±",
|
||||||
sales: "فروش",
|
sales: "ÙØ±ÙØ´",
|
||||||
support: "پشتیبانی",
|
support: "Ù¾Ø´ØªÛØ¨Ø§ÙÛ",
|
||||||
};
|
};
|
||||||
|
|
||||||
/** تنظیمات سازمانی و مدیریت کاربران */
|
/** ØªÙØ¸ÛÙ
ات سازÙ
اÙÛ Ù Ù
Ø¯ÛØ±Ûت کاربرا٠*/
|
||||||
export function canManageSettings(role: UserRole | string | null | undefined): boolean {
|
export function canManageSettings(role: UserRole | string | null | undefined): boolean {
|
||||||
return role === "owner" || role === "admin";
|
return role === "owner" || role === "admin";
|
||||||
}
|
}
|
||||||
@@ -18,12 +18,12 @@ export function canManageUsers(role: UserRole | string | null | undefined): bool
|
|||||||
return role === "owner" || role === "admin";
|
return role === "owner" || role === "admin";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** مشاهده همه پروندههای سازمان (نه فقط مالکیت خود) */
|
/** Ù
Ø´Ø§ÙØ¯Ù ÙÙ
٠پرÙÙØ¯ÙâÙØ§Û سازÙ
ا٠(ÙÙ ÙÙØ· Ù
اÙÚ©ÛØª Ø®ÙØ¯) */
|
||||||
export function canViewAllRecords(role: UserRole | string | null | undefined): boolean {
|
export function canViewAllRecords(role: UserRole | string | null | undefined): boolean {
|
||||||
return role === "owner" || role === "admin";
|
return role === "owner" || role === "admin";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** تغییر مالک پرونده */
|
/** تغÛÛØ± Ù
اÙÚ© پرÙÙØ¯Ù */
|
||||||
export function canReassignRecords(role: UserRole | string | null | undefined): boolean {
|
export function canReassignRecords(role: UserRole | string | null | undefined): boolean {
|
||||||
return role === "owner" || role === "admin";
|
return role === "owner" || role === "admin";
|
||||||
}
|
}
|
||||||
@@ -37,10 +37,10 @@ export interface AuthUserDto {
|
|||||||
organizationId: string;
|
organizationId: string;
|
||||||
organizationName?: string;
|
organizationName?: string;
|
||||||
hasAvatar?: boolean;
|
hasAvatar?: boolean;
|
||||||
/** مالک محیط فعلی — اشتراک متعلق به مالک است نه عضو زیرمجموعه */
|
/** Ù
اÙÚ© Ù
ØÛØ· ÙØ¹ÙÛ â Ø§Ø´ØªØ±Ø§Ú© Ù
تعÙ٠ب٠Ù
اÙÚ© است ÙÙ Ø¹Ø¶Ù Ø²ÛØ±Ù
جÙ
ÙØ¹Ù */
|
||||||
isOrgOwner?: boolean;
|
isOrgOwner?: boolean;
|
||||||
enabledModules?: OrgModuleKey[];
|
enabledModules?: OrgModuleKey[];
|
||||||
/** خلاصه اشتراک مالک محیط (برای اعضا فقط جهت نمایش/گیت ورود) */
|
/** Ø®ÙØ§ØµÙ اشتراک Ù
اÙÚ© Ù
ØÛØ· (Ø¨Ø±Ø§Û Ø§Ø¹Ø¶Ø§ ÙÙØ· Ø¬ÙØª ÙÙ
Ø§ÛØ´/Ú¯ÛØª ÙØ±Ùد) */
|
||||||
subscription?: SubscriptionSummaryDto | null;
|
subscription?: SubscriptionSummaryDto | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,15 +64,15 @@ export const BILLING_PLAN_CODES: BillingPlanCode[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const BILLING_PLAN_LABELS: Record<BillingPlanCode, string> = {
|
export const BILLING_PLAN_LABELS: Record<BillingPlanCode, string> = {
|
||||||
trial: "دمو ۱۵ روزه",
|
trial: "دÙ
Ù Û±Ûµ Ø±ÙØ²Ù",
|
||||||
monthly: "ماهانه",
|
monthly: "Ù
Ø§ÙØ§ÙÙ",
|
||||||
quarterly: "سهماهه",
|
quarterly: "سÙâÙ
اÙÙ",
|
||||||
semiannual: "ششماهه",
|
semiannual: "ششâÙ
اÙÙ",
|
||||||
yearly: "یکساله",
|
yearly: "ÛکساÙÙ",
|
||||||
custom: "سفارشی",
|
custom: "Ø³ÙØ§Ø±Ø´Û",
|
||||||
};
|
};
|
||||||
|
|
||||||
/** مدت پیشفرض پلنها (روز) — custom ندارد */
|
/** Ù
دت Ù¾ÛØ´âÙØ±Ø¶ Ù¾ÙÙâÙØ§ (Ø±ÙØ²) â custom ÙØ¯Ø§Ø±Ø¯ */
|
||||||
export const BILLING_PLAN_DAYS: Record<Exclude<BillingPlanCode, "custom">, number> = {
|
export const BILLING_PLAN_DAYS: Record<Exclude<BillingPlanCode, "custom">, number> = {
|
||||||
trial: 15,
|
trial: 15,
|
||||||
monthly: 30,
|
monthly: 30,
|
||||||
@@ -164,49 +164,49 @@ export const ORG_MODULE_KEYS: OrgModuleKey[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
|
export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
|
||||||
customers: "مشتریان",
|
customers: "Ù
Ø´ØªØ±ÛØ§Ù",
|
||||||
pipeline: "کاریز فروش",
|
pipeline: "Ú©Ø§Ø±ÛØ² ÙØ±ÙØ´",
|
||||||
products: "محصولات",
|
products: "Ù
ØØµÙÙØ§Øª",
|
||||||
invoices: "فاکتورها",
|
invoices: "ÙØ§Ú©ØªÙØ±ÙØ§",
|
||||||
quotes: "پیشفاکتورها",
|
quotes: "Ù¾ÛØ´âÙØ§Ú©ØªÙØ±ÙØ§",
|
||||||
commissions: "پورسانت",
|
commissions: "Ù¾ÙØ±Ø³Ø§Ùت",
|
||||||
sales_forecast: "هدف و پیشبینی",
|
sales_forecast: "ÙØ¯Ù Ù Ù¾ÛØ´âبÛÙÛ",
|
||||||
activities: "فعالیتها",
|
activities: "ÙØ¹Ø§ÙÛØªâÙØ§",
|
||||||
tickets: "تیکتها",
|
tickets: "تÛکتâÙØ§",
|
||||||
workflow_automations: "اتوماسیون گردش کار",
|
workflow_automations: "اتÙÙ
اسÛÙ٠گردش کار",
|
||||||
message_automations: "اتوماسیون پیامک",
|
message_automations: "اتÙÙ
اسÛÙÙ Ù¾ÛØ§Ù
Ú©",
|
||||||
lead_forms: "فرمساز سرنخ",
|
lead_forms: "ÙØ±Ù
âØ³Ø§Ø² Ø³Ø±ÙØ®",
|
||||||
leads: "مدیریت لیدها",
|
leads: "Ù
Ø¯ÛØ±Ûت ÙÛØ¯Ùا",
|
||||||
project_boards: "کاریز پروژه",
|
project_boards: "Ú©Ø§Ø±ÛØ² پرÙÚÙ",
|
||||||
inventory: "انبار",
|
inventory: "Ø§ÙØ¨Ø§Ø±",
|
||||||
cheques: "چکها",
|
cheques: "ÚÚ©âÙØ§",
|
||||||
attachments: "پیوستها",
|
attachments: "Ù¾ÛÙØ³ØªâÙØ§",
|
||||||
loyalty: "باشگاه مشتریان",
|
loyalty: "باشگا٠Ù
Ø´ØªØ±ÛØ§Ù",
|
||||||
reports: "گزارشها",
|
reports: "گزارشâÙØ§",
|
||||||
notes: "یادداشتها",
|
notes: "ÛØ§Ø¯Ø¯Ø§Ø´ØªâÙØ§",
|
||||||
tahesab: "تهحساب",
|
tahesab: "تÙâØØ³Ø§Ø¨",
|
||||||
custom_fields: "فیلدهای سفارشی",
|
custom_fields: "ÙÛÙØ¯ÙØ§Û Ø³ÙØ§Ø±Ø´Û",
|
||||||
currencies: "ارزها",
|
currencies: "Ø§Ø±Ø²ÙØ§",
|
||||||
team_settings: "تیم و تنظیمات سازمان",
|
team_settings: "تÛÙ
Ù ØªÙØ¸ÛÙ
ات سازÙ
اÙ",
|
||||||
faq: "FAQ",
|
faq: "FAQ",
|
||||||
audit_logs: "لاگ فعالیت کاربران",
|
audit_logs: "ÙØ§Ú¯ ÙØ¹Ø§ÙÛØª کاربراÙ",
|
||||||
saved_views: "فیلترهای ذخیرهشده",
|
saved_views: "ÙÛÙØªØ±ÙØ§Û Ø°Ø®ÛØ±ÙâØ´Ø¯Ù",
|
||||||
public_api: "API و وبهوک",
|
public_api: "API Ù ÙØ¨âÙÙÚ©",
|
||||||
sms_campaigns: "پیامک گروهی",
|
sms_campaigns: "Ù¾ÛØ§Ù
Ú© گرÙÙÛ",
|
||||||
teams: "تیمها و سطح دسترسی به پروندهها",
|
teams: "تÛÙ
âÙØ§ Ù Ø³Ø·Ø Ø¯Ø³ØªØ±Ø³Û Ø¨Ù Ù¾Ø±ÙÙØ¯ÙâÙØ§",
|
||||||
woocommerce: "ووکامرس",
|
woocommerce: "ÙÙکاÙ
رس",
|
||||||
voip: "تلفن سازمانی",
|
voip: "تÙÙ٠سازÙ
اÙÛ",
|
||||||
reservations: "رزرو و نوبتدهی",
|
reservations: "رزر٠٠ÙÙØ¨ØªâدÙÛ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ORG_MODULE_GROUPS: Array<{
|
export const ORG_MODULE_GROUPS: Array<{
|
||||||
title: string;
|
title: string;
|
||||||
keys: OrgModuleKey[];
|
keys: OrgModuleKey[];
|
||||||
}> = [
|
}> = [
|
||||||
{ title: "مشتریان", keys: ["customers"] },
|
{ title: "Ù
Ø´ØªØ±ÛØ§Ù", keys: ["customers"] },
|
||||||
{ title: "لیدها", keys: ["leads", "lead_forms"] },
|
{ title: "ÙÛØ¯Ùا", keys: ["leads", "lead_forms"] },
|
||||||
{
|
{
|
||||||
title: "فروش",
|
title: "ÙØ±ÙØ´",
|
||||||
keys: [
|
keys: [
|
||||||
"pipeline",
|
"pipeline",
|
||||||
"products",
|
"products",
|
||||||
@@ -216,10 +216,10 @@ export const ORG_MODULE_GROUPS: Array<{
|
|||||||
"sales_forecast",
|
"sales_forecast",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ title: "فعالیتها", keys: ["activities", "notes"] },
|
{ title: "ÙØ¹Ø§ÙÛØªâÙØ§", keys: ["activities", "notes"] },
|
||||||
{ title: "پشتیبانی", keys: ["tickets", "faq"] },
|
{ title: "Ù¾Ø´ØªÛØ¨Ø§ÙÛ", keys: ["tickets", "faq"] },
|
||||||
{
|
{
|
||||||
title: "اتوماسیون",
|
title: "اتÙÙ
اسÛÙÙ",
|
||||||
keys: [
|
keys: [
|
||||||
"workflow_automations",
|
"workflow_automations",
|
||||||
"message_automations",
|
"message_automations",
|
||||||
@@ -227,7 +227,7 @@ export const ORG_MODULE_GROUPS: Array<{
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "ابزارها",
|
title: "Ø§Ø¨Ø²Ø§Ø±ÙØ§",
|
||||||
keys: [
|
keys: [
|
||||||
"project_boards",
|
"project_boards",
|
||||||
"inventory",
|
"inventory",
|
||||||
@@ -242,7 +242,7 @@ export const ORG_MODULE_GROUPS: Array<{
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "تنظیمات",
|
title: "ØªÙØ¸ÛÙ
ات",
|
||||||
keys: [
|
keys: [
|
||||||
"team_settings",
|
"team_settings",
|
||||||
"teams",
|
"teams",
|
||||||
@@ -312,7 +312,7 @@ export interface OrgUserDto {
|
|||||||
lastLoginAt?: string | null;
|
lastLoginAt?: string | null;
|
||||||
hasAvatar?: boolean;
|
hasAvatar?: boolean;
|
||||||
commissionPercent?: number;
|
commissionPercent?: number;
|
||||||
/** own = فقط خود | team = همتیمیها | org = کل سازمان */
|
/** own = ÙÙØ· Ø®ÙØ¯ | team = ÙÙ
âØªÛÙ
ÛâÙØ§ | org = ک٠سازÙ
ا٠*/
|
||||||
dataVisibility?: DataVisibility;
|
dataVisibility?: DataVisibility;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
@@ -322,9 +322,9 @@ export type DataVisibility = "own" | "team" | "org";
|
|||||||
export const DATA_VISIBILITIES: DataVisibility[] = ["own", "team", "org"];
|
export const DATA_VISIBILITIES: DataVisibility[] = ["own", "team", "org"];
|
||||||
|
|
||||||
export const DATA_VISIBILITY_LABELS: Record<DataVisibility, string> = {
|
export const DATA_VISIBILITY_LABELS: Record<DataVisibility, string> = {
|
||||||
own: "فقط پروندههای خود",
|
own: "ÙÙØ· پرÙÙØ¯ÙâÙØ§Û Ø®ÙØ¯",
|
||||||
team: "تیمهای عضو",
|
team: "تÛÙ
âÙØ§Û عضÙ",
|
||||||
org: "کل سازمان",
|
org: "ک٠سازÙ
اÙ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface UpdateUserVisibilityRequest {
|
export interface UpdateUserVisibilityRequest {
|
||||||
@@ -345,14 +345,14 @@ export const ROLE_PERMISSION_ITEMS: Array<{
|
|||||||
key: RolePermissionKey;
|
key: RolePermissionKey;
|
||||||
label: string;
|
label: string;
|
||||||
}> = [
|
}> = [
|
||||||
{ key: "customers", label: "مشتریان" },
|
{ key: "customers", label: "Ù
Ø´ØªØ±ÛØ§Ù" },
|
||||||
{ key: "sales", label: "فروش و معاملات" },
|
{ key: "sales", label: "ÙØ±ÙØ´ Ù Ù
عاÙ
ÙØ§Øª" },
|
||||||
{ key: "billing", label: "پیشفاکتورها و فاکتورها" },
|
{ key: "billing", label: "Ù¾ÛØ´âÙØ§Ú©ØªÙØ±ÙØ§ Ù ÙØ§Ú©ØªÙØ±ÙØ§" },
|
||||||
{ key: "products", label: "محصولات و خدمات" },
|
{ key: "products", label: "Ù
ØØµÙÙØ§Øª ٠خدÙ
ات" },
|
||||||
{ key: "activities", label: "فعالیتها" },
|
{ key: "activities", label: "ÙØ¹Ø§ÙÛØªâÙØ§" },
|
||||||
{ key: "notes", label: "یادداشتها" },
|
{ key: "notes", label: "ÛØ§Ø¯Ø¯Ø§Ø´ØªâÙØ§" },
|
||||||
{ key: "reports", label: "گزارشها" },
|
{ key: "reports", label: "گزارشâÙØ§" },
|
||||||
{ key: "audit", label: "لاگ فعالیت کاربران" },
|
{ key: "audit", label: "ÙØ§Ú¯ ÙØ¹Ø§ÙÛØª کاربراÙ" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export interface OrgRoleMemberDto {
|
export interface OrgRoleMemberDto {
|
||||||
@@ -422,7 +422,7 @@ export interface ApiErrorBody {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface LoginRequest {
|
export interface LoginRequest {
|
||||||
/** ایمیل یا شماره موبایل */
|
/** اÛÙ
ÛÙ ÛØ§ Ø´Ù
ار٠Ù
ÙØ¨Ø§ÛÙ */
|
||||||
identifier: string;
|
identifier: string;
|
||||||
password: string;
|
password: string;
|
||||||
}
|
}
|
||||||
@@ -444,7 +444,7 @@ export interface LoginChallengeResponse {
|
|||||||
channel: 'email' | 'mobile';
|
channel: 'email' | 'mobile';
|
||||||
expiresInSeconds: number;
|
expiresInSeconds: number;
|
||||||
maskedDestination?: string;
|
maskedDestination?: string;
|
||||||
/** فقط در محیط توسعه / AUTH_RETURN_OTP */
|
/** ÙÙØ· در Ù
ØÛØ· ØªÙØ³Ø¹Ù / AUTH_RETURN_OTP */
|
||||||
devCode?: string;
|
devCode?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,7 +453,7 @@ export interface RegisterChallengeResponse {
|
|||||||
expiresInSeconds: number;
|
expiresInSeconds: number;
|
||||||
maskedEmail?: string;
|
maskedEmail?: string;
|
||||||
maskedMobile?: string;
|
maskedMobile?: string;
|
||||||
/** وقتی سرویس ایمیل خاموش است false — فقط OTP موبایل لازم است */
|
/** ÙÙØªÛ سرÙÛØ³ اÛÙ
Û٠خاÙ
ÙØ´ است false â ÙÙØ· OTP Ù
ÙØ¨Ø§ÛÙ ÙØ§Ø²Ù
است */
|
||||||
emailOtpRequired?: boolean;
|
emailOtpRequired?: boolean;
|
||||||
devEmailCode?: string;
|
devEmailCode?: string;
|
||||||
devMobileCode?: string;
|
devMobileCode?: string;
|
||||||
@@ -531,7 +531,7 @@ export interface UpdateOrganizationRequest {
|
|||||||
businessField?: BusinessField;
|
businessField?: BusinessField;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** زمینه فعالیت سازمان — همتراز صنایع دیدار */
|
/** زÙ
ÛÙÙ ÙØ¹Ø§ÙÛØª سازÙ
ا٠â ÙÙ
âØªØ±Ø§Ø² ØµÙØ§Ûع Ø¯ÛØ¯Ø§Ø± */
|
||||||
export const BUSINESS_FIELDS = [
|
export const BUSINESS_FIELDS = [
|
||||||
"education",
|
"education",
|
||||||
"beauty",
|
"beauty",
|
||||||
@@ -558,26 +558,26 @@ export const BUSINESS_FIELDS = [
|
|||||||
export type BusinessField = (typeof BUSINESS_FIELDS)[number];
|
export type BusinessField = (typeof BUSINESS_FIELDS)[number];
|
||||||
|
|
||||||
export const BUSINESS_FIELD_LABELS: Record<BusinessField, string> = {
|
export const BUSINESS_FIELD_LABELS: Record<BusinessField, string> = {
|
||||||
education: "آموزشگاه و مؤسسات آموزشی",
|
education: "Ø¢Ù
ÙØ²Ø´Ú¯Ø§Ù Ù Ù
ؤسسات Ø¢Ù
ÙØ²Ø´Û",
|
||||||
beauty: "کلینیک زیبایی و آرایشگاه",
|
beauty: "Ú©ÙÛÙÛÚ© Ø²ÛØ¨Ø§ÛÛ Ù Ø¢Ø±Ø§ÛØ´Ú¯Ø§Ù",
|
||||||
real_estate: "املاک و مشاورین مسکن",
|
real_estate: "اÙ
ÙØ§Ú© Ù Ù
Ø´Ø§ÙØ±ÛÙ Ù
سکÙ",
|
||||||
construction: "صنعت ساختمان",
|
construction: "ØµÙØ¹Øª ساختÙ
اÙ",
|
||||||
advertising: "تبلیغات و مشاوره کسبوکار",
|
advertising: "تبÙÛØºØ§Øª Ù Ù
Ø´Ø§ÙØ±Ù کسبâÙکار",
|
||||||
insurance: "بیمه",
|
insurance: "بÛÙ
Ù",
|
||||||
consulting: "شرکتهای مشاور",
|
consulting: "شرکتâÙØ§Û Ù
Ø´Ø§ÙØ±",
|
||||||
startup: "استارتاپ و کسبوکار آنلاین",
|
startup: "استارتاپ ٠کسبâÙکار Ø¢ÙÙØ§ÛÙ",
|
||||||
medical_devices: "تجهیزات پزشکی",
|
medical_devices: "تجÙÛØ²Ø§Øª پزشکÛ",
|
||||||
travel: "گردشگری و مهاجرت",
|
travel: "Ú¯Ø±Ø¯Ø´Ú¯Ø±Û Ù Ù
ÙØ§Ø¬Ø±Øª",
|
||||||
contractor: "پیمانکاری و پروژهای",
|
contractor: "Ù¾ÛÙ
اÙÚ©Ø§Ø±Û Ù Ù¾Ø±ÙÚÙâØ§Û",
|
||||||
trading: "بازرگانی",
|
trading: "بازرگاÙÛ",
|
||||||
manufacturing: "تولیدی و صنعتی",
|
manufacturing: "تÙÙÛØ¯Û Ù ØµÙØ¹ØªÛ",
|
||||||
personal: "کسبوکار شخصی و خانگی",
|
personal: "کسبâÙکار Ø´Ø®ØµÛ Ù Ø®Ø§ÙÚ¯Û",
|
||||||
tech: "نرمافزار و سختافزار",
|
tech: "ÙØ±Ù
âØ§ÙØ²Ø§Ø± Ù Ø³Ø®ØªâØ§ÙØ²Ø§Ø±",
|
||||||
legal: "وکلا و مشاورین حقوقی",
|
legal: "ÙÚ©ÙØ§ Ù Ù
Ø´Ø§ÙØ±ÛÙ ØÙÙÙÛ",
|
||||||
repair: "خدمات و تعمیرات",
|
repair: "خدÙ
ات ٠تعÙ
ÛØ±Ø§Øª",
|
||||||
retail: "خردهفروشی",
|
retail: "خردÙâÙØ±ÙØ´Û",
|
||||||
jewelry: "طلا و جواهر",
|
jewelry: "Ø·ÙØ§ Ù Ø¬ÙØ§Ùر",
|
||||||
other: "سایر",
|
other: "Ø³Ø§ÛØ±",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function isBusinessField(value: string): value is BusinessField {
|
export function isBusinessField(value: string): value is BusinessField {
|
||||||
@@ -593,7 +593,7 @@ export interface ExchangeRateDto {
|
|||||||
export interface UpdateOrgCurrenciesRequest {
|
export interface UpdateOrgCurrenciesRequest {
|
||||||
baseCurrency?: string;
|
baseCurrency?: string;
|
||||||
enabledCurrencies?: string[];
|
enabledCurrencies?: string[];
|
||||||
/** نرخها نسبت به ارز پایه؛ ارز پایه نیازی به نرخ ندارد */
|
/** ÙØ±Ø®âÙØ§ ÙØ³Ø¨Øª ب٠ارز پاÛÙØ ارز پاÛÙ ÙÛØ§Ø²Û Ø¨Ù ÙØ±Ø® ÙØ¯Ø§Ø±Ø¯ */
|
||||||
rates?: Array<{ currency: string; rateToBase: number }>;
|
rates?: Array<{ currency: string; rateToBase: number }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,12 +602,12 @@ export const CURRENCY_CATALOG: Array<{
|
|||||||
labelFa: string;
|
labelFa: string;
|
||||||
suffix: string;
|
suffix: string;
|
||||||
}> = [
|
}> = [
|
||||||
{ code: "IRR", labelFa: "ریال ایران", suffix: "ریال" },
|
{ code: "IRR", labelFa: "Ø±ÛØ§Ù Ø§ÛØ±Ø§Ù", suffix: "Ø±ÛØ§Ù" },
|
||||||
{ code: "USD", labelFa: "دلار آمریکا", suffix: "دلار" },
|
{ code: "USD", labelFa: "Ø¯ÙØ§Ø± Ø¢Ù
رÛکا", suffix: "Ø¯ÙØ§Ø±" },
|
||||||
{ code: "EUR", labelFa: "یورو", suffix: "یورو" },
|
{ code: "EUR", labelFa: "ÛÙØ±Ù", suffix: "ÛÙØ±Ù" },
|
||||||
{ code: "AED", labelFa: "درهم امارات", suffix: "درهم" },
|
{ code: "AED", labelFa: "درÙÙ
اÙ
ارات", suffix: "درÙÙ
" },
|
||||||
{ code: "TRY", labelFa: "لیر ترکیه", suffix: "لیر" },
|
{ code: "TRY", labelFa: "ÙÛØ± ترکÛÙ", suffix: "ÙÛØ±" },
|
||||||
{ code: "GBP", labelFa: "پوند انگلیس", suffix: "پوند" },
|
{ code: "GBP", labelFa: "Ù¾ÙÙØ¯ اÙÚ¯ÙÛØ³", suffix: "Ù¾ÙÙØ¯" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export function currencySuffix(code: string): string {
|
export function currencySuffix(code: string): string {
|
||||||
@@ -677,10 +677,10 @@ export const PERSON_MOODS = ["newcomer", "happy", "unhappy", "special"] as const
|
|||||||
export type PersonMood = (typeof PERSON_MOODS)[number];
|
export type PersonMood = (typeof PERSON_MOODS)[number];
|
||||||
|
|
||||||
export const PERSON_MOOD_LABELS: Record<PersonMood, string> = {
|
export const PERSON_MOOD_LABELS: Record<PersonMood, string> = {
|
||||||
newcomer: "مشتری تازه وارد",
|
newcomer: "Ù
Ø´ØªØ±Û ØªØ§Ø²Ù ÙØ§Ø±Ø¯",
|
||||||
happy: "مشتری خوشحال",
|
happy: "Ù
Ø´ØªØ±Û Ø®ÙØ´ØØ§Ù",
|
||||||
unhappy: "مشتری ناراضی",
|
unhappy: "Ù
Ø´ØªØ±Û ÙØ§Ø±Ø§Ø¶Û",
|
||||||
special: "مشتری خاص",
|
special: "Ù
Ø´ØªØ±Û Ø®Ø§Øµ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface PersonDto {
|
export interface PersonDto {
|
||||||
@@ -777,7 +777,7 @@ export interface DealDto {
|
|||||||
person: PersonSummaryDto | null;
|
person: PersonSummaryDto | null;
|
||||||
company: CompanySummaryDto | null;
|
company: CompanySummaryDto | null;
|
||||||
owner: UserSummaryDto | null;
|
owner: UserSummaryDto | null;
|
||||||
/** مسئولان مشترک معامله (علاوه بر مالک اصلی) */
|
/** Ù
سئÙÙØ§Ù Ù
شترک Ù
عاÙ
ÙÙ (Ø¹ÙØ§Ù٠بر Ù
اÙÚ© اصÙÛ) */
|
||||||
assignees: UserSummaryDto[];
|
assignees: UserSummaryDto[];
|
||||||
lineItems: DealLineItemDto[];
|
lineItems: DealLineItemDto[];
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
@@ -849,7 +849,7 @@ export interface UpdateDealRequest {
|
|||||||
lineItems?: DealLineItemInput[];
|
lineItems?: DealLineItemInput[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** فیلتر ذخیرهشدهٔ لیست اشخاص */
|
/** ÙÛÙØªØ± Ø°Ø®ÛØ±ÙâØ´Ø¯ÙÙ ÙÛØ³Øª اشخاص */
|
||||||
export interface PeopleViewFilters {
|
export interface PeopleViewFilters {
|
||||||
q?: string;
|
q?: string;
|
||||||
sort?: string;
|
sort?: string;
|
||||||
@@ -857,7 +857,7 @@ export interface PeopleViewFilters {
|
|||||||
page?: number;
|
page?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** فیلتر ذخیرهشدهٔ کاریز / معاملات */
|
/** ÙÛÙØªØ± Ø°Ø®ÛØ±ÙâØ´Ø¯ÙÙ Ú©Ø§Ø±ÛØ² / Ù
عاÙ
ÙØ§Øª */
|
||||||
export interface DealsViewFilters {
|
export interface DealsViewFilters {
|
||||||
q?: string;
|
q?: string;
|
||||||
amountMin?: string;
|
amountMin?: string;
|
||||||
@@ -1014,7 +1014,7 @@ export interface NoteDto {
|
|||||||
title: string | null;
|
title: string | null;
|
||||||
body: string;
|
body: string;
|
||||||
noteType: NoteType | string;
|
noteType: NoteType | string;
|
||||||
/** team = تیمی | personal = فقط نویسنده */
|
/** team = تÛÙ
Û | personal = ÙÙØ· ÙÙÛØ³Ùد٠*/
|
||||||
visibility: NoteVisibility;
|
visibility: NoteVisibility;
|
||||||
pinned: boolean;
|
pinned: boolean;
|
||||||
color: string | null;
|
color: string | null;
|
||||||
@@ -1029,7 +1029,7 @@ export interface NoteDto {
|
|||||||
activity: { id: string; title: string } | null;
|
activity: { id: string; title: string } | null;
|
||||||
author: UserSummaryDto | null;
|
author: UserSummaryDto | null;
|
||||||
attachments: NoteAttachmentDto[];
|
attachments: NoteAttachmentDto[];
|
||||||
/** تعداد نسخههای قبلی (برای نمایش دکمه تاریخچه) */
|
/** تعداد ÙØ³Ø®ÙâÙØ§Û ÙØ¨ÙÛ (Ø¨Ø±Ø§Û ÙÙ
Ø§ÛØ´ دکÙ
Ù ØªØ§Ø±ÛØ®ÚÙ) */
|
||||||
revisionCount?: number;
|
revisionCount?: number;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
@@ -1040,8 +1040,8 @@ export type NoteVisibility = "team" | "personal";
|
|||||||
export const NOTE_VISIBILITIES: NoteVisibility[] = ["team", "personal"];
|
export const NOTE_VISIBILITIES: NoteVisibility[] = ["team", "personal"];
|
||||||
|
|
||||||
export const NOTE_VISIBILITY_LABELS: Record<NoteVisibility, string> = {
|
export const NOTE_VISIBILITY_LABELS: Record<NoteVisibility, string> = {
|
||||||
team: "تیمی",
|
team: "تÛÙ
Û",
|
||||||
personal: "شخصی (فقط من)",
|
personal: "Ø´Ø®ØµÛ (ÙÙØ· Ù
Ù)",
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface NoteRevisionDto {
|
export interface NoteRevisionDto {
|
||||||
@@ -1865,7 +1865,7 @@ export interface CreateSalesGoalRequest {
|
|||||||
probability?: number | null;
|
probability?: number | null;
|
||||||
currency?: string;
|
currency?: string;
|
||||||
notes?: string;
|
notes?: string;
|
||||||
/** فقط مالک/مدیر؛ در غیر این صورت هدف برای خود کاربر */
|
/** ÙÙØ· Ù
اÙÚ©/Ù
Ø¯ÛØ±Ø در ØºÛØ± اÛÙ ØµÙØ±Øª ÙØ¯Ù Ø¨Ø±Ø§Û Ø®ÙØ¯ کاربر */
|
||||||
userId?: string | null;
|
userId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1896,13 +1896,13 @@ export interface SalesForecastDto {
|
|||||||
periodStart: string;
|
periodStart: string;
|
||||||
periodEnd: string;
|
periodEnd: string;
|
||||||
currency: string;
|
currency: string;
|
||||||
/** مجموع اهداف همپوشان با بازه */
|
/** Ù
جÙ
ÙØ¹ Ø§ÙØ¯Ø§Ù ÙÙ
âÙ¾ÙØ´Ø§Ù با باز٠*/
|
||||||
targetAmount: number;
|
targetAmount: number;
|
||||||
/** معاملات برندهشده در بازه */
|
/** Ù
عاÙ
ÙØ§Øª Ø¨Ø±ÙØ¯ÙâØ´Ø¯Ù Ø¯Ø± باز٠*/
|
||||||
wonAmount: number;
|
wonAmount: number;
|
||||||
/** معاملات باز فعلی */
|
/** Ù
عاÙ
ÙØ§Øª باز ÙØ¹ÙÛ */
|
||||||
openPipelineAmount: number;
|
openPipelineAmount: number;
|
||||||
/** پیشبینی: تحقق + کاریز باز × میانگین احتمال */
|
/** Ù¾ÛØ´âبÛÙÛ: تØÙÙ + Ú©Ø§Ø±ÛØ² باز à Ù
ÛØ§ÙÚ¯ÛÙ Ø§ØØªÙ
ا٠*/
|
||||||
forecastAmount: number;
|
forecastAmount: number;
|
||||||
progressPercent: number | null;
|
progressPercent: number | null;
|
||||||
openDealsCount: number;
|
openDealsCount: number;
|
||||||
@@ -1910,7 +1910,7 @@ export interface SalesForecastDto {
|
|||||||
goals: SalesGoalDto[];
|
goals: SalesGoalDto[];
|
||||||
kpis: SalesForecastKpiDto[];
|
kpis: SalesForecastKpiDto[];
|
||||||
newCustomersCount: number;
|
newCustomersCount: number;
|
||||||
/** معاملات ایجادشده در بازه */
|
/** Ù
عاÙ
ÙØ§Øª Ø§ÛØ¬Ø§Ø¯Ø´Ø¯Ù در باز٠*/
|
||||||
newDealsCount: number;
|
newDealsCount: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2011,7 +2011,7 @@ export interface UpdateFaqArticleRequest {
|
|||||||
position?: number;
|
position?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ساعات مهلت پاسخ اول بر اساس اولویت */
|
/** ساعات Ù
ÙÙØª پاسخ اÙ٠بر اساس اÙÙÙÛØª */
|
||||||
export const TICKET_SLA_HOURS: Record<TicketPriority, number> = {
|
export const TICKET_SLA_HOURS: Record<TicketPriority, number> = {
|
||||||
urgent: 4,
|
urgent: 4,
|
||||||
high: 8,
|
high: 8,
|
||||||
@@ -2019,7 +2019,7 @@ export const TICKET_SLA_HOURS: Record<TicketPriority, number> = {
|
|||||||
low: 48,
|
low: 48,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ——— پرتال مشتری (OTP) ——— */
|
/* âââ پرتا٠Ù
Ø´ØªØ±Û (OTP) âââ */
|
||||||
|
|
||||||
export interface PortalOrgInfoDto {
|
export interface PortalOrgInfoDto {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -2032,7 +2032,7 @@ export interface PortalRequestOtpRequest {
|
|||||||
|
|
||||||
export interface PortalRequestOtpResponse {
|
export interface PortalRequestOtpResponse {
|
||||||
ok: true;
|
ok: true;
|
||||||
/** فقط در حالت توسعه / دمو وقتی SMS واقعی وصل نیست */
|
/** ÙÙØ· در ØØ§Ùت ØªÙØ³Ø¹Ù / دÙ
Ù ÙÙØªÛ SMS ÙØ§ÙØ¹Û ÙØµÙ ÙÛØ³Øª */
|
||||||
devCode?: string;
|
devCode?: string;
|
||||||
expiresInSeconds: number;
|
expiresInSeconds: number;
|
||||||
}
|
}
|
||||||
@@ -2089,7 +2089,7 @@ export interface PortalTicketDto {
|
|||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ——— گزارشات و داشبورد ——— */
|
/* âââ گزارشات Ù Ø¯Ø§Ø´Ø¨ÙØ±Ø¯ âââ */
|
||||||
|
|
||||||
export interface ReportsKpiDto {
|
export interface ReportsKpiDto {
|
||||||
key: string;
|
key: string;
|
||||||
@@ -2127,7 +2127,7 @@ export interface ReportsTeamRowDto {
|
|||||||
activitiesDone: number;
|
activitiesDone: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** گونههای drill-down گزارش عمیق (فاز ۱ BI) */
|
/** Ú¯ÙÙÙâÙØ§Û drill-down گزارش عÙ
ÛÙ (ÙØ§Ø² Û± BI) */
|
||||||
export type ReportsDrillKind =
|
export type ReportsDrillKind =
|
||||||
| "stage_open"
|
| "stage_open"
|
||||||
| "team_won"
|
| "team_won"
|
||||||
@@ -2152,25 +2152,25 @@ export interface ReportsFunnelStageDto {
|
|||||||
pipelineName: string;
|
pipelineName: string;
|
||||||
count: number;
|
count: number;
|
||||||
amount: number;
|
amount: number;
|
||||||
/** درصد تبدیل نسبت به مرحله قبل همان کاریز؛ null برای اولین مرحله */
|
/** درصد تبدÛÙ ÙØ³Ø¨Øª ب٠Ù
رØÙÙ ÙØ¨Ù ÙÙ
Ø§Ù Ú©Ø§Ø±ÛØ²Ø null Ø¨Ø±Ø§Û Ø§ÙÙÛÙ Ù
رØÙÙ */
|
||||||
conversionFromPrevPercent: number | null;
|
conversionFromPrevPercent: number | null;
|
||||||
/** سهم از کل معاملات باز همان کاریز */
|
/** سÙÙ
از Ú©Ù Ù
عاÙ
ÙØ§Øª باز ÙÙ
Ø§Ù Ú©Ø§Ø±ÛØ² */
|
||||||
shareOfPipelinePercent: number;
|
shareOfPipelinePercent: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** یک ردیف نرخ تبدیل (ورودی → موفق) مثل دیدار */
|
/** ÛÚ© ردÛÙ ÙØ±Ø® تبدÛÙ (ÙØ±ÙØ¯Û â Ù
ÙÙÙ) Ù
Ø«Ù Ø¯ÛØ¯Ø§Ø± */
|
||||||
export interface ReportsConversionRateRowDto {
|
export interface ReportsConversionRateRowDto {
|
||||||
key: string;
|
key: string;
|
||||||
label: string;
|
label: string;
|
||||||
incomingCount: number;
|
incomingCount: number;
|
||||||
wonCount: number;
|
wonCount: number;
|
||||||
/** درصد؛ اگر ورودی صفر باشد ۰ */
|
/** Ø¯Ø±ØµØ¯Ø Ø§Ú¯Ø± ÙØ±ÙØ¯Û ØµÙØ± باشد Û° */
|
||||||
conversionPercent: number;
|
conversionPercent: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* نرخ تبدیل به سبک دیدار:
|
* ÙØ±Ø® تبدÛ٠ب٠سبک Ø¯ÛØ¯Ø§Ø±:
|
||||||
* از معاملات تازهساختهشده در بازه، چند درصد الان برنده شدهاند.
|
* از Ù
عاÙ
ÙØ§Øª تازÙâØ³Ø§Ø®ØªÙâØ´Ø¯Ù Ø¯Ø± Ø¨Ø§Ø²ÙØ ÚÙØ¯ درصد Ø§ÙØ§Ù Ø¨Ø±ÙØ¯Ù شدÙâØ§ÙØ¯.
|
||||||
*/
|
*/
|
||||||
export interface ReportsConversionRateDto {
|
export interface ReportsConversionRateDto {
|
||||||
incomingCount: number;
|
incomingCount: number;
|
||||||
@@ -2192,7 +2192,7 @@ export interface ReportsPeriodCompareRowDto {
|
|||||||
current: number;
|
current: number;
|
||||||
previous: number;
|
previous: number;
|
||||||
changePercent: number | null;
|
changePercent: number | null;
|
||||||
/** اگر قابل کلیک برای لیست پرونده باشد */
|
/** اگر ÙØ§Ø¨Ù Ú©ÙÛÚ© Ø¨Ø±Ø§Û ÙÛØ³Øª پرÙÙØ¯Ù باشد */
|
||||||
drillKind?: ReportsDrillKind;
|
drillKind?: ReportsDrillKind;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2249,9 +2249,9 @@ export interface ReportsDashboardDto {
|
|||||||
winRate: number;
|
winRate: number;
|
||||||
};
|
};
|
||||||
funnel: ReportsFunnelStageDto[];
|
funnel: ReportsFunnelStageDto[];
|
||||||
/** نرخ تبدیل ورودی→موفق (سبک دیدار) */
|
/** ÙØ±Ø® تبدÛÙ ÙØ±ÙدÛâÙ
ÙÙÙ (سبک Ø¯ÛØ¯Ø§Ø±) */
|
||||||
conversionRate: ReportsConversionRateDto;
|
conversionRate: ReportsConversionRateDto;
|
||||||
/** مقایسه صریح بازه فعلی با دوره قبل همطول */
|
/** Ù
ÙØ§ÛØ³Ù ØµØ±ÛØ Ø¨Ø§Ø²Ù ÙØ¹ÙÛ Ø¨Ø§ Ø¯ÙØ±Ù ÙØ¨Ù ÙÙ
âØ·ÙÙ */
|
||||||
periodCompare: ReportsPeriodCompareRowDto[];
|
periodCompare: ReportsPeriodCompareRowDto[];
|
||||||
tickets: {
|
tickets: {
|
||||||
open: number;
|
open: number;
|
||||||
@@ -2309,7 +2309,7 @@ export interface HomeDashboardDto {
|
|||||||
topCustomers: HomeDashboardTopCustomerDto[];
|
topCustomers: HomeDashboardTopCustomerDto[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** برد پروژه / کاریز کارت */
|
/** برد پرÙÚÙ / Ú©Ø§Ø±ÛØ² کارت */
|
||||||
export interface ProjectBoardStageDto {
|
export interface ProjectBoardStageDto {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -2373,7 +2373,7 @@ export interface MoveProjectCardRequest {
|
|||||||
position?: number;
|
position?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** باشگاه مشتریان */
|
/** باشگا٠Ù
Ø´ØªØ±ÛØ§Ù */
|
||||||
export interface LoyaltyTierDto {
|
export interface LoyaltyTierDto {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -2476,7 +2476,7 @@ export interface RedeemLoyaltyRewardRequest {
|
|||||||
personId: string;
|
personId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** اتوماسیون اگر/آنگاه */
|
/** اتÙÙ
اسÛÙ٠اگر/Ø¢Ùگا٠*/
|
||||||
export type AutomationTrigger =
|
export type AutomationTrigger =
|
||||||
| "person_created"
|
| "person_created"
|
||||||
| "lead_submitted"
|
| "lead_submitted"
|
||||||
@@ -2495,23 +2495,23 @@ export type AutomationAction =
|
|||||||
| "add_loyalty_points";
|
| "add_loyalty_points";
|
||||||
|
|
||||||
export const AUTOMATION_TRIGGER_LABELS: Record<AutomationTrigger, string> = {
|
export const AUTOMATION_TRIGGER_LABELS: Record<AutomationTrigger, string> = {
|
||||||
person_created: "مخاطب جدید ساخته شد",
|
person_created: "Ù
خاطب Ø¬Ø¯ÛØ¯ ساخت٠شد",
|
||||||
lead_submitted: "فرم سرنخ ارسال شد",
|
lead_submitted: "ÙØ±Ù
Ø³Ø±ÙØ® ارسا٠شد",
|
||||||
deal_created: "معامله جدید ساخته شد",
|
deal_created: "Ù
عاÙ
ÙÙ Ø¬Ø¯ÛØ¯ ساخت٠شد",
|
||||||
deal_stage_changed: "مرحله معامله عوض شد",
|
deal_stage_changed: "Ù
رØÙÙ Ù
عاÙ
ÙÙ Ø¹ÙØ¶ شد",
|
||||||
deal_won: "معامله برنده شد",
|
deal_won: "Ù
عاÙ
ÙÙ Ø¨Ø±ÙØ¯Ù شد",
|
||||||
deal_lost: "معامله باخت",
|
deal_lost: "Ù
عاÙ
Ù٠باخت",
|
||||||
ticket_created: "تیکت جدید ساخته شد",
|
ticket_created: "تÛکت Ø¬Ø¯ÛØ¯ ساخت٠شد",
|
||||||
ticket_resolved: "تیکت حل شد",
|
ticket_resolved: "تÛکت ØÙ شد",
|
||||||
invoice_issued: "فاکتور صادر شد",
|
invoice_issued: "ÙØ§Ú©ØªÙر صادر شد",
|
||||||
invoice_paid: "پرداخت روی فاکتور ثبت شد",
|
invoice_paid: "پرداخت رÙÛ ÙØ§Ú©ØªÙر ثبت شد",
|
||||||
activity_done: "فعالیت تمام شد",
|
activity_done: "ÙØ¹Ø§ÙÛØª تÙ
اÙ
شد",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AUTOMATION_ACTION_LABELS: Record<AutomationAction, string> = {
|
export const AUTOMATION_ACTION_LABELS: Record<AutomationAction, string> = {
|
||||||
create_activity: "ساخت فعالیت",
|
create_activity: "ساخت ÙØ¹Ø§ÙÛØª",
|
||||||
create_notification: "ارسال اعلان",
|
create_notification: "Ø§Ø±Ø³Ø§Ù Ø§Ø¹ÙØ§Ù",
|
||||||
add_loyalty_points: "افزودن امتیاز باشگاه",
|
add_loyalty_points: "Ø§ÙØ²Ùد٠اÙ
ØªÛØ§Ø² باشگاÙ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MAX_AUTOMATION_STEPS = 8;
|
export const MAX_AUTOMATION_STEPS = 8;
|
||||||
@@ -2540,14 +2540,14 @@ export const AUTOMATION_TRIGGER_GROUPS: {
|
|||||||
label: string;
|
label: string;
|
||||||
items: AutomationTrigger[];
|
items: AutomationTrigger[];
|
||||||
}[] = [
|
}[] = [
|
||||||
{ label: "مخاطب", items: ["person_created", "lead_submitted"] },
|
{ label: "Ù
خاطب", items: ["person_created", "lead_submitted"] },
|
||||||
{
|
{
|
||||||
label: "معامله",
|
label: "Ù
عاÙ
ÙÙ",
|
||||||
items: ["deal_created", "deal_stage_changed", "deal_won", "deal_lost"],
|
items: ["deal_created", "deal_stage_changed", "deal_won", "deal_lost"],
|
||||||
},
|
},
|
||||||
{ label: "تیکت", items: ["ticket_created", "ticket_resolved"] },
|
{ label: "تÛکت", items: ["ticket_created", "ticket_resolved"] },
|
||||||
{ label: "فعالیت", items: ["activity_done"] },
|
{ label: "ÙØ¹Ø§ÙÛØª", items: ["activity_done"] },
|
||||||
{ label: "مالی", items: ["invoice_issued", "invoice_paid"] },
|
{ label: "Ù
اÙÛ", items: ["invoice_issued", "invoice_paid"] },
|
||||||
];
|
];
|
||||||
|
|
||||||
export type AutomationStepKind = "action" | "condition";
|
export type AutomationStepKind = "action" | "condition";
|
||||||
@@ -2573,31 +2573,31 @@ export const AUTOMATION_CONDITION_FIELD_LABELS: Record<
|
|||||||
AutomationConditionField,
|
AutomationConditionField,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
deal_amount: "مبلغ معامله",
|
deal_amount: "Ù
Ø¨ÙØº Ù
عاÙ
ÙÙ",
|
||||||
has_person: "مخاطب دارد",
|
has_person: "Ù
خاطب دارد",
|
||||||
has_company: "شرکت دارد",
|
has_company: "شرکت دارد",
|
||||||
ticket_priority: "اولویت تیکت",
|
ticket_priority: "اÙÙÙÛØª تÛکت",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AUTOMATION_CONDITION_OP_LABELS: Record<
|
export const AUTOMATION_CONDITION_OP_LABELS: Record<
|
||||||
AutomationConditionOp,
|
AutomationConditionOp,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
gte: "بزرگتر یا مساوی",
|
gte: "Ø¨Ø²Ø±Ú¯âØªØ± ÛØ§ Ù
ساÙÛ",
|
||||||
lte: "کوچکتر یا مساوی",
|
lte: "Ú©ÙÚÚ©âØªØ± ÛØ§ Ù
ساÙÛ",
|
||||||
eq: "مساوی",
|
eq: "Ù
ساÙÛ",
|
||||||
neq: "نامساوی",
|
neq: "ÙØ§Ù
ساÙÛ",
|
||||||
is_set: "دارد",
|
is_set: "دارد",
|
||||||
is_empty: "ندارد",
|
is_empty: "ÙØ¯Ø§Ø±Ø¯",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AUTOMATION_NOTIFY_CHANNEL_LABELS: Record<
|
export const AUTOMATION_NOTIFY_CHANNEL_LABELS: Record<
|
||||||
AutomationNotifyChannel,
|
AutomationNotifyChannel,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
app: "ناتیفیکیشن داخلی",
|
app: "ÙØ§ØªÛÙÛÚ©ÛØ´Ù داخÙÛ",
|
||||||
sms: "پیامک",
|
sms: "Ù¾ÛØ§Ù
Ú©",
|
||||||
both: "هر دو",
|
both: "ÙØ± دÙ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AUTOMATION_NOTIFY_CHANNELS = [
|
export const AUTOMATION_NOTIFY_CHANNELS = [
|
||||||
@@ -2660,7 +2660,7 @@ export interface AutomationRuleConfig {
|
|||||||
notifyTarget?: AutomationNotifyTarget;
|
notifyTarget?: AutomationNotifyTarget;
|
||||||
activityType?: "call" | "meeting" | "task" | "note";
|
activityType?: "call" | "meeting" | "task" | "note";
|
||||||
points?: number;
|
points?: number;
|
||||||
/** زنجیرهٔ اعمال؛ اگر خالی باشد همان action تکی استفاده میشود */
|
/** Ø²ÙØ¬ÛرÙ٠اعÙ
Ø§ÙØ اگر خاÙÛ Ø¨Ø§Ø´Ø¯ ÙÙ
ا٠action ØªÚ©Û Ø§Ø³ØªÙØ§Ø¯Ù Ù
ÛâØ´ÙØ¯ */
|
||||||
steps?: AutomationStep[];
|
steps?: AutomationStep[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2756,7 +2756,7 @@ export function automationStepToConfig(step: AutomationStep): AutomationRuleConf
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// —— تهحساب / حسابداری ——
|
// ââ ØªÙâØØ³Ø§Ø¨ / ØØ³Ø§Ø¨Ø¯Ø§Ø±Û ââ
|
||||||
|
|
||||||
export const TAHSAB_SANAD_TYPES = [
|
export const TAHSAB_SANAD_TYPES = [
|
||||||
"buy_sale_gold",
|
"buy_sale_gold",
|
||||||
@@ -2769,11 +2769,11 @@ export const TAHSAB_SANAD_TYPES = [
|
|||||||
export type TahesabSanadType = (typeof TAHSAB_SANAD_TYPES)[number];
|
export type TahesabSanadType = (typeof TAHSAB_SANAD_TYPES)[number];
|
||||||
|
|
||||||
export const TAHSAB_SANAD_LABELS: Record<TahesabSanadType, string> = {
|
export const TAHSAB_SANAD_LABELS: Record<TahesabSanadType, string> = {
|
||||||
buy_sale_gold: "خرید/فروش آبشده",
|
buy_sale_gold: "Ø®Ø±ÛØ¯/ÙØ±ÙØ´ آبشدÙ",
|
||||||
buy_sale_sekeh: "خرید/فروش سکه",
|
buy_sale_sekeh: "Ø®Ø±ÛØ¯/ÙØ±ÙØ´ سکÙ",
|
||||||
talab_bedehi: "طلب/بدهی",
|
talab_bedehi: "Ø·ÙØ¨/بدÙÛ",
|
||||||
vkh_gold: "واریز/خروج طلا",
|
vkh_gold: "ÙØ§Ø±Ûز/Ø®Ø±ÙØ¬ Ø·ÙØ§",
|
||||||
vkh_bank: "واریز/خروج بانکی",
|
vkh_bank: "ÙØ§Ø±Ûز/Ø®Ø±ÙØ¬ باÙÚ©Û",
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface TahesabConnectionDto {
|
export interface TahesabConnectionDto {
|
||||||
@@ -2822,7 +2822,7 @@ export interface PersonAccountingLinkDto {
|
|||||||
export interface MandehValueDto {
|
export interface MandehValueDto {
|
||||||
amount: string | number;
|
amount: string | number;
|
||||||
unit: string;
|
unit: string;
|
||||||
status: "بس" | "بد";
|
status: "بس" | "بد";
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MandehDetailItemDto {
|
export interface MandehDetailItemDto {
|
||||||
@@ -2843,7 +2843,7 @@ export interface PersonAssetsDto {
|
|||||||
fetchedAt: string;
|
fetchedAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// —— پیام خودکار (جدا از اتوماسیون گردش کار) ——
|
// ââ Ù¾ÛØ§Ù
Ø®ÙØ¯Ú©Ø§Ø± (جدا از اتÙÙ
اسÛÙ٠گردش کار) ââ
|
||||||
|
|
||||||
export type MessageAutomationTrigger =
|
export type MessageAutomationTrigger =
|
||||||
| "person_created"
|
| "person_created"
|
||||||
@@ -2887,37 +2887,37 @@ export const MESSAGE_AUTOMATION_TRIGGER_LABELS: Record<
|
|||||||
MessageAutomationTrigger,
|
MessageAutomationTrigger,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
person_created: "مخاطب جدید ساخته شد",
|
person_created: "Ù
خاطب Ø¬Ø¯ÛØ¯ ساخت٠شد",
|
||||||
lead_submitted: "فرم سرنخ ارسال شد",
|
lead_submitted: "ÙØ±Ù
Ø³Ø±ÙØ® ارسا٠شد",
|
||||||
deal_created: "معامله جدید ساخته شد",
|
deal_created: "Ù
عاÙ
ÙÙ Ø¬Ø¯ÛØ¯ ساخت٠شد",
|
||||||
deal_stage_changed: "مرحله معامله عوض شد",
|
deal_stage_changed: "Ù
رØÙÙ Ù
عاÙ
ÙÙ Ø¹ÙØ¶ شد",
|
||||||
deal_won: "معامله برنده شد",
|
deal_won: "Ù
عاÙ
ÙÙ Ø¨Ø±ÙØ¯Ù شد",
|
||||||
deal_lost: "معامله باخت",
|
deal_lost: "Ù
عاÙ
Ù٠باخت",
|
||||||
ticket_created: "تیکت جدید ساخته شد",
|
ticket_created: "تÛکت Ø¬Ø¯ÛØ¯ ساخت٠شد",
|
||||||
ticket_resolved: "تیکت حل شد",
|
ticket_resolved: "تÛکت ØÙ شد",
|
||||||
invoice_issued: "فاکتور صادر شد",
|
invoice_issued: "ÙØ§Ú©ØªÙر صادر شد",
|
||||||
invoice_paid: "پرداخت روی فاکتور ثبت شد",
|
invoice_paid: "پرداخت رÙÛ ÙØ§Ú©ØªÙر ثبت شد",
|
||||||
activity_created: "فعالیت ثبت شد",
|
activity_created: "ÙØ¹Ø§ÙÛØª ثبت شد",
|
||||||
activity_done: "فعالیت تمام شد",
|
activity_done: "ÙØ¹Ø§ÙÛØª تÙ
اÙ
شد",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MESSAGE_AUTOMATION_UNIT_LABELS: Record<
|
export const MESSAGE_AUTOMATION_UNIT_LABELS: Record<
|
||||||
MessageAutomationDelayUnit,
|
MessageAutomationDelayUnit,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
minutes: "دقیقه",
|
minutes: "دÙÛÙÙ",
|
||||||
hours: "ساعت",
|
hours: "ساعت",
|
||||||
days: "روز",
|
days: "Ø±ÙØ²",
|
||||||
weeks: "هفته",
|
weeks: "ÙÙØªÙ",
|
||||||
months: "ماه",
|
months: "Ù
اÙ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MESSAGE_AUTOMATION_FIELDS = [
|
export const MESSAGE_AUTOMATION_FIELDS = [
|
||||||
{ token: "{نام}", label: "نام مشتری" },
|
{ token: "{ÙØ§Ù
}", label: "ÙØ§Ù
Ù
شترÛ" },
|
||||||
{ token: "{شماره}", label: "شماره موبایل" },
|
{ token: "{Ø´Ù
ارÙ}", label: "Ø´Ù
ار٠Ù
ÙØ¨Ø§ÛÙ" },
|
||||||
{ token: "{تاریخ}", label: "تاریخ ارسال" },
|
{ token: "{ØªØ§Ø±ÛØ®}", label: "ØªØ§Ø±ÛØ® ارساÙ" },
|
||||||
{ token: "{عنوان}", label: "عنوان رکورد" },
|
{ token: "{عÙÙØ§Ù}", label: "عÙÙØ§Ù Ø±Ú©ÙØ±Ø¯" },
|
||||||
{ token: "{شرکت}", label: "نام شرکت" },
|
{ token: "{شرکت}", label: "ÙØ§Ù
شرکت" },
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const MESSAGE_AUTOMATION_SMS_SEGMENT = 70;
|
export const MESSAGE_AUTOMATION_SMS_SEGMENT = 70;
|
||||||
@@ -2926,18 +2926,18 @@ export const MESSAGE_AUTOMATION_CHANNEL_LABELS: Record<
|
|||||||
MessageAutomationChannel,
|
MessageAutomationChannel,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
app: "ناتیف داخل برنامه",
|
app: "ÙØ§ØªÛÙ Ø¯Ø§Ø®Ù Ø¨Ø±ÙØ§Ù
Ù",
|
||||||
sms: "پیامک",
|
sms: "Ù¾ÛØ§Ù
Ú©",
|
||||||
both: "پیامک و ناتیف",
|
both: "Ù¾ÛØ§Ù
Ú© Ù ÙØ§ØªÛÙ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MESSAGE_AUTOMATION_TARGET_LABELS: Record<
|
export const MESSAGE_AUTOMATION_TARGET_LABELS: Record<
|
||||||
MessageAutomationTarget,
|
MessageAutomationTarget,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
staff: "مسئول پرونده",
|
staff: "Ù
سئÙ٠پرÙÙØ¯Ù",
|
||||||
person: "مشتری",
|
person: "Ù
شترÛ",
|
||||||
both: "مشتری و مسئول",
|
both: "Ù
Ø´ØªØ±Û Ù Ù
سئÙÙ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface MessageAutomationRuleDto {
|
export interface MessageAutomationRuleDto {
|
||||||
@@ -3064,7 +3064,7 @@ export interface PlatformUserDto {
|
|||||||
lastLoginAt?: string | null;
|
lastLoginAt?: string | null;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
memberships: PlatformUserMembershipDto[];
|
memberships: PlatformUserMembershipDto[];
|
||||||
/** فقط اگر حداقل یک عضویت مالک فعال دارد */
|
/** ÙÙØ· اگر ØØ¯Ø§ÙÙ ÛÚ© عضÙÛØª Ù
اÙÚ© ÙØ¹Ø§Ù دارد */
|
||||||
isBillingOwner?: boolean;
|
isBillingOwner?: boolean;
|
||||||
billing?: BillingAccountDto | null;
|
billing?: BillingAccountDto | null;
|
||||||
}
|
}
|
||||||
@@ -3101,7 +3101,7 @@ export { brand, APP_NAME, APP_NAME_FA, brandSuggestionFa } from "./brand";
|
|||||||
export type { Brand } from "./brand";
|
export type { Brand } from "./brand";
|
||||||
export const API_PREFIX = "api";
|
export const API_PREFIX = "api";
|
||||||
|
|
||||||
/* ——— لاگ فعالیت کاربران ——— */
|
/* âââ ÙØ§Ú¯ ÙØ¹Ø§ÙÛØª کاربرا٠âââ */
|
||||||
|
|
||||||
export interface AuditLogDto {
|
export interface AuditLogDto {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -3123,7 +3123,7 @@ export interface AuditLogListResponse {
|
|||||||
limit: number;
|
limit: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ——— فیلترهای ذخیرهشده ——— */
|
/* âââ ÙÛÙØªØ±ÙØ§Û Ø°Ø®ÛØ±ÙâØ´Ø¯Ù âââ */
|
||||||
|
|
||||||
export type SavedViewScope =
|
export type SavedViewScope =
|
||||||
| "deals"
|
| "deals"
|
||||||
@@ -3142,7 +3142,7 @@ export const SAVED_VIEW_SCOPES: SavedViewScope[] = [
|
|||||||
"reports",
|
"reports",
|
||||||
];
|
];
|
||||||
|
|
||||||
/** فیلترهای ذخیرهشدهٔ صفحه گزارشات */
|
/** ÙÛÙØªØ±ÙØ§Û Ø°Ø®ÛØ±ÙâØ´Ø¯ÙÙ ØµÙØÙ Ú¯Ø²Ø§Ø±Ø´Ø§Øª */
|
||||||
export interface ReportsViewFilters {
|
export interface ReportsViewFilters {
|
||||||
/** today | week | month | quarter | year | custom */
|
/** today | week | month | quarter | year | custom */
|
||||||
period: string;
|
period: string;
|
||||||
@@ -3158,7 +3158,7 @@ export interface ReportsViewFilters {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** متریکهای گزارشساز ساده */
|
/** Ù
ترÛÚ©âÙØ§Û Ú¯Ø²Ø§Ø±Ø´âØ³Ø§Ø² ساد٠*/
|
||||||
export type ReportsBuilderMetric =
|
export type ReportsBuilderMetric =
|
||||||
| "won_amount"
|
| "won_amount"
|
||||||
| "won_count"
|
| "won_count"
|
||||||
@@ -3186,18 +3186,18 @@ export const REPORTS_BUILDER_METRIC_LABELS: Record<
|
|||||||
ReportsBuilderMetric,
|
ReportsBuilderMetric,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
won_amount: "مبلغ معاملات برنده",
|
won_amount: "Ù
Ø¨ÙØº Ù
عاÙ
ÙØ§Øª Ø¨Ø±ÙØ¯Ù",
|
||||||
won_count: "تعداد معاملات برنده",
|
won_count: "تعداد Ù
عاÙ
ÙØ§Øª Ø¨Ø±ÙØ¯Ù",
|
||||||
lost_count: "تعداد معاملات باخته",
|
lost_count: "تعداد Ù
عاÙ
ÙØ§Øª باختÙ",
|
||||||
open_count: "تعداد معاملات باز",
|
open_count: "تعداد Ù
عاÙ
ÙØ§Øª باز",
|
||||||
open_amount: "مبلغ معاملات باز",
|
open_amount: "Ù
Ø¨ÙØº Ù
عاÙ
ÙØ§Øª باز",
|
||||||
activities_done: "فعالیت انجامشده",
|
activities_done: "ÙØ¹Ø§ÙÛØª Ø§ÙØ¬Ø§Ù
âØ´Ø¯Ù",
|
||||||
people_created: "مشتریان جدید",
|
people_created: "Ù
Ø´ØªØ±ÛØ§Ù Ø¬Ø¯ÛØ¯",
|
||||||
invoice_amount: "مبلغ فاکتور",
|
invoice_amount: "Ù
Ø¨ÙØº ÙØ§Ú©ØªÙر",
|
||||||
invoice_count: "تعداد فاکتور",
|
invoice_count: "تعداد ÙØ§Ú©ØªÙر",
|
||||||
};
|
};
|
||||||
|
|
||||||
/** ابعاد گروهبندی گزارشساز */
|
/** ابعاد گرÙÙâØ¨ÙØ¯Û Ú¯Ø²Ø§Ø±Ø´âØ³Ø§Ø² */
|
||||||
export type ReportsBuilderDimension =
|
export type ReportsBuilderDimension =
|
||||||
| "none"
|
| "none"
|
||||||
| "owner"
|
| "owner"
|
||||||
@@ -3221,13 +3221,13 @@ export const REPORTS_BUILDER_DIMENSION_LABELS: Record<
|
|||||||
ReportsBuilderDimension,
|
ReportsBuilderDimension,
|
||||||
string
|
string
|
||||||
> = {
|
> = {
|
||||||
none: "بدون گروهبندی (جمع کل)",
|
none: "بدÙ٠گرÙÙâØ¨ÙØ¯Û (جÙ
ع Ú©Ù)",
|
||||||
owner: "کاربر / مسئول",
|
owner: "کاربر / Ù
سئÙÙ",
|
||||||
team: "تیم",
|
team: "تÛÙ
",
|
||||||
source: "منبع",
|
source: "Ù
ÙØ¨Ø¹",
|
||||||
stage: "مرحله کاریز",
|
stage: "Ù
رØÙÙ Ú©Ø§Ø±ÛØ²",
|
||||||
month: "ماه",
|
month: "Ù
اÙ",
|
||||||
status: "وضعیت معامله",
|
status: "ÙØ¶Ø¹Ûت Ù
عاÙ
ÙÙ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ReportsBuilderQuery {
|
export interface ReportsBuilderQuery {
|
||||||
@@ -3278,7 +3278,7 @@ export interface CreateSavedViewRequest {
|
|||||||
|
|
||||||
export type UpdateSavedViewRequest = Partial<CreateSavedViewRequest>;
|
export type UpdateSavedViewRequest = Partial<CreateSavedViewRequest>;
|
||||||
|
|
||||||
/* ——— API عمومی و وبهوک ——— */
|
/* âââ API عÙ
ÙÙ
Û Ù ÙØ¨âÙÙÚ© âââ */
|
||||||
|
|
||||||
export const WEBHOOK_EVENTS = [
|
export const WEBHOOK_EVENTS = [
|
||||||
"person.created",
|
"person.created",
|
||||||
@@ -3307,7 +3307,7 @@ export interface CreateOrganizationApiKeyRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateOrganizationApiKeyResponse extends OrganizationApiKeyDto {
|
export interface CreateOrganizationApiKeyResponse extends OrganizationApiKeyDto {
|
||||||
/** فقط یکبار هنگام ساخت برگردانده میشود */
|
/** ÙÙØ· ÛÚ©âØ¨Ø§Ø± ÙÙگاÙ
ساخت Ø¨Ø±Ú¯Ø±Ø¯Ø§ÙØ¯Ù Ù
ÛâØ´ÙØ¯ */
|
||||||
rawKey: string;
|
rawKey: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3329,7 +3329,7 @@ export interface CreateWebhookEndpointRequest {
|
|||||||
isActive?: boolean;
|
isActive?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** فقط هنگام ساخت؛ secret دوباره برنمیگردد */
|
/** ÙÙØ· ÙÙگاÙ
Ø³Ø§Ø®ØªØ secret Ø¯ÙØ¨Ø§Ø±Ù برÙÙ
Ûâگردد */
|
||||||
export interface CreateWebhookEndpointResponse extends WebhookEndpointDto {
|
export interface CreateWebhookEndpointResponse extends WebhookEndpointDto {
|
||||||
secret: string;
|
secret: string;
|
||||||
}
|
}
|
||||||
@@ -3347,7 +3347,7 @@ export interface WebhookDeliveryDto {
|
|||||||
deliveredAt: string | null;
|
deliveredAt: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ——— پیامک گروهی ——— */
|
/* âââ Ù¾ÛØ§Ù
Ú© گرÙÙÛ âââ */
|
||||||
|
|
||||||
export type SmsCampaignStatus =
|
export type SmsCampaignStatus =
|
||||||
| "draft"
|
| "draft"
|
||||||
@@ -3375,7 +3375,7 @@ export interface CreateSmsCampaignRequest {
|
|||||||
body: string;
|
body: string;
|
||||||
personIds: string[];
|
personIds: string[];
|
||||||
scheduledAt?: string | null;
|
scheduledAt?: string | null;
|
||||||
/** اگر true باشد بلافاصله صف میشود */
|
/** اگر true باشد Ø¨ÙØ§ÙاصÙ٠ص٠Ù
ÛâØ´ÙØ¯ */
|
||||||
queueNow?: boolean;
|
queueNow?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3384,7 +3384,7 @@ export interface SmsCampaignListResponse {
|
|||||||
total: number;
|
total: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ——— تیمها و سطح دسترسی به پروندهها ——— */
|
/* âââ ØªÛÙ
âÙØ§ Ù Ø³Ø·Ø Ø¯Ø³ØªØ±Ø³Û Ø¨Ù Ù¾Ø±ÙÙØ¯ÙâÙØ§ âââ */
|
||||||
|
|
||||||
export type TeamMemberRole = "member" | "manager";
|
export type TeamMemberRole = "member" | "manager";
|
||||||
|
|
||||||
@@ -3421,7 +3421,7 @@ export interface SetTeamMembersRequest {
|
|||||||
members: Array<{ userId: string; role: TeamMemberRole }>;
|
members: Array<{ userId: string; role: TeamMemberRole }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ——— ووکامرس ——— */
|
/* âââ ÙÙکاÙ
رس âââ */
|
||||||
|
|
||||||
export interface WooCommerceConnectionDto {
|
export interface WooCommerceConnectionDto {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -3477,7 +3477,7 @@ export interface WooCommerceOrderLinkDto {
|
|||||||
syncedAt: string;
|
syncedAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ——— تلفن سازمانی / VoIP ——— */
|
/* âââ ØªÙÙ٠سازÙ
اÙÛ / VoIP âââ */
|
||||||
|
|
||||||
export type VoipCallDirection = "inbound" | "outbound";
|
export type VoipCallDirection = "inbound" | "outbound";
|
||||||
|
|
||||||
@@ -3493,7 +3493,7 @@ export interface VoipConnectionDto {
|
|||||||
label: string;
|
label: string;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
webhookSecretSet: boolean;
|
webhookSecretSet: boolean;
|
||||||
/** قالب URL برای شروع تماس؛ {number} جایگزین میشود */
|
/** ÙØ§Ùب URL Ø¨Ø±Ø§Û Ø´Ø±ÙØ¹ تÙ
Ø§Ø³Ø {number} جاÛگزÛÙ Ù
ÛâØ´ÙØ¯ */
|
||||||
clickToCallUrl: string | null;
|
clickToCallUrl: string | null;
|
||||||
lastEventAt: string | null;
|
lastEventAt: string | null;
|
||||||
lastError: string | null;
|
lastError: string | null;
|
||||||
@@ -3550,7 +3550,7 @@ export interface VoipClickToCallRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface VoipWebhookEvent {
|
export interface VoipWebhookEvent {
|
||||||
/** شناسه یکتای تماس در سانترال */
|
/** Ø´ÙØ§Ø³Ù ÛÚ©ØªØ§Û ØªÙ
اس در Ø³Ø§ÙØªØ±Ø§Ù */
|
||||||
callId: string;
|
callId: string;
|
||||||
direction: VoipCallDirection;
|
direction: VoipCallDirection;
|
||||||
status: VoipCallStatus | string;
|
status: VoipCallStatus | string;
|
||||||
@@ -3559,16 +3559,16 @@ export interface VoipWebhookEvent {
|
|||||||
startedAt?: string;
|
startedAt?: string;
|
||||||
endedAt?: string;
|
endedAt?: string;
|
||||||
durationSec?: number;
|
durationSec?: number;
|
||||||
/** لینک فایل ضبط (برای خلاصه خودکار) */
|
/** ÙÛÙÚ© ÙØ§Û٠ضبط (Ø¨Ø±Ø§Û Ø®ÙØ§ØµÙ Ø®ÙØ¯Ú©Ø§Ø±) */
|
||||||
recordingUrl?: string;
|
recordingUrl?: string;
|
||||||
/** متن آمادهٔ تماس؛ اگر باشد STT رد میشود */
|
/** Ù
ت٠آÙ
ادÙ٠تÙ
Ø§Ø³Ø Ø§Ú¯Ø± باشد STT رد Ù
ÛâØ´ÙØ¯ */
|
||||||
transcript?: string;
|
transcript?: string;
|
||||||
/** برای سازگاری با فیلدهای رایج دیگر */
|
/** Ø¨Ø±Ø§Û Ø³Ø§Ø²Ú¯Ø§Ø±Û Ø¨Ø§ ÙÛÙØ¯ÙØ§Û Ø±Ø§ÛØ¬ دÛگر */
|
||||||
caller?: string;
|
caller?: string;
|
||||||
callee?: string;
|
callee?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ——— رزرو و نوبتدهی ——— */
|
/* âââ Ø±Ø²Ø±Ù Ù ÙÙØ¨ØªâدÙÛ âââ */
|
||||||
|
|
||||||
export type ReservationStatus =
|
export type ReservationStatus =
|
||||||
| "pending"
|
| "pending"
|
||||||
@@ -3584,10 +3584,10 @@ export const RESERVATION_STATUSES: ReservationStatus[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const RESERVATION_STATUS_LABELS: Record<ReservationStatus, string> = {
|
export const RESERVATION_STATUS_LABELS: Record<ReservationStatus, string> = {
|
||||||
pending: "در انتظار",
|
pending: "در Ø§ÙØªØ¸Ø§Ø±",
|
||||||
confirmed: "تأیید شده",
|
confirmed: "تأÛÛØ¯ شدÙ",
|
||||||
canceled: "لغو شده",
|
canceled: "ÙØºÙ شدÙ",
|
||||||
done: "انجام شده",
|
done: "Ø§ÙØ¬Ø§Ù
شدÙ",
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ReservationServiceDto {
|
export interface ReservationServiceDto {
|
||||||
@@ -3595,7 +3595,7 @@ export interface ReservationServiceDto {
|
|||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
durationMinutes: number;
|
durationMinutes: number;
|
||||||
/** روزهای هفته ۰=یکشنبه … ۶=شنبه (JS getDay) */
|
/** Ø±ÙØ²ÙØ§Û ÙÙØªÙ Û°=ÛÚ©Ø´ÙØ¨Ù ⦠۶=Ø´ÙØ¨Ù (JS getDay) */
|
||||||
workDays: number[];
|
workDays: number[];
|
||||||
dayStartHour: number;
|
dayStartHour: number;
|
||||||
dayEndHour: number;
|
dayEndHour: number;
|
||||||
@@ -3663,7 +3663,7 @@ export interface ReservationListResponse {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ——— مدیریت لیدها ——— */
|
/* âââ Ù
Ø¯ÛØ±Ûت ÙÛØ¯Ùا âââ */
|
||||||
|
|
||||||
export type LeadAssignRule = "round_robin" | "equal_split";
|
export type LeadAssignRule = "round_robin" | "equal_split";
|
||||||
|
|
||||||
@@ -3721,6 +3721,7 @@ export interface LeadDto {
|
|||||||
convertedAt: string | null;
|
convertedAt: string | null;
|
||||||
archivedAt: string | null;
|
archivedAt: string | null;
|
||||||
daysInStage: number;
|
daysInStage: number;
|
||||||
|
hasLogo: boolean;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user