Implementing a link tracking and user click logging system.Implementing a link tracking and user click logging system.
This commit is contained in:
@@ -2547,7 +2547,8 @@ export type AutomationTrigger =
|
||||
| "ticket_resolved"
|
||||
| "invoice_issued"
|
||||
| "invoice_paid"
|
||||
| "activity_done";
|
||||
| "activity_done"
|
||||
| "sms_link_clicked";
|
||||
export type AutomationAction =
|
||||
| "create_activity"
|
||||
| "create_notification"
|
||||
@@ -2565,6 +2566,7 @@ export const AUTOMATION_TRIGGER_LABELS: Record<AutomationTrigger, string> = {
|
||||
invoice_issued: "فاکتور صادر شد",
|
||||
invoice_paid: "پرداخت روی فاکتور ثبت شد",
|
||||
activity_done: "فعالیت تمام شد",
|
||||
sms_link_clicked: "کلیک روی لینک پیامک",
|
||||
};
|
||||
|
||||
export const AUTOMATION_ACTION_LABELS: Record<AutomationAction, string> = {
|
||||
@@ -2593,6 +2595,7 @@ export const AUTOMATION_TRIGGERS = [
|
||||
"invoice_issued",
|
||||
"invoice_paid",
|
||||
"activity_done",
|
||||
"sms_link_clicked",
|
||||
] as const satisfies readonly AutomationTrigger[];
|
||||
|
||||
export const AUTOMATION_TRIGGER_GROUPS: {
|
||||
@@ -2607,6 +2610,7 @@ export const AUTOMATION_TRIGGER_GROUPS: {
|
||||
{ label: "تیکت", items: ["ticket_created", "ticket_resolved"] },
|
||||
{ label: "فعالیت", items: ["activity_done"] },
|
||||
{ label: "مالی", items: ["invoice_issued", "invoice_paid"] },
|
||||
{ label: "پیامک", items: ["sms_link_clicked"] },
|
||||
];
|
||||
|
||||
export type AutomationStepKind = "action" | "condition";
|
||||
@@ -2719,6 +2723,8 @@ export interface AutomationRuleConfig {
|
||||
notifyTarget?: AutomationNotifyTarget;
|
||||
activityType?: "call" | "meeting" | "task" | "note";
|
||||
points?: number;
|
||||
/** فیلتر اختیاری: فقط برای منبع خاص (مثلاً id کمپین SMS) */
|
||||
sourceId?: string | null;
|
||||
/** زنجیرهٔ اعمال؛ اگر خالی باشد همان action تکی استفاده میشود */
|
||||
steps?: AutomationStep[];
|
||||
}
|
||||
@@ -2917,7 +2923,8 @@ export type MessageAutomationTrigger =
|
||||
| "invoice_issued"
|
||||
| "invoice_paid"
|
||||
| "activity_created"
|
||||
| "activity_done";
|
||||
| "activity_done"
|
||||
| "sms_link_clicked";
|
||||
|
||||
export type MessageAutomationDelayUnit =
|
||||
| "minutes"
|
||||
@@ -2941,6 +2948,7 @@ export const MESSAGE_AUTOMATION_TRIGGERS = [
|
||||
"invoice_paid",
|
||||
"activity_created",
|
||||
"activity_done",
|
||||
"sms_link_clicked",
|
||||
] as const satisfies readonly MessageAutomationTrigger[];
|
||||
|
||||
export const MESSAGE_AUTOMATION_TRIGGER_LABELS: Record<
|
||||
@@ -2959,6 +2967,7 @@ export const MESSAGE_AUTOMATION_TRIGGER_LABELS: Record<
|
||||
invoice_paid: "پرداخت روی فاکتور ثبت شد",
|
||||
activity_created: "فعالیت ثبت شد",
|
||||
activity_done: "فعالیت تمام شد",
|
||||
sms_link_clicked: "کلیک روی لینک پیامک",
|
||||
};
|
||||
|
||||
export const MESSAGE_AUTOMATION_UNIT_LABELS: Record<
|
||||
@@ -3444,6 +3453,33 @@ export interface SmsCampaignListResponse {
|
||||
total: number;
|
||||
}
|
||||
|
||||
export type SmsCampaignContactType = "customer" | "lead";
|
||||
|
||||
export interface SmsCampaignClickerDto {
|
||||
contactType: SmsCampaignContactType;
|
||||
personId: string | null;
|
||||
leadId: string | null;
|
||||
name: string;
|
||||
mobile: string | null;
|
||||
firstClickedAt: string | null;
|
||||
lastClickedAt: string | null;
|
||||
clickCount: number;
|
||||
}
|
||||
|
||||
export interface SmsCampaignReportDto {
|
||||
campaign: SmsCampaignDto;
|
||||
totalCount: number;
|
||||
sentCount: number;
|
||||
failedCount: number;
|
||||
skippedCount: number;
|
||||
uniqueClickers: number;
|
||||
totalClicks: number;
|
||||
/** درصد یکتا نسبت به ارسالشده */
|
||||
clickRate: number;
|
||||
multiClickers: number;
|
||||
clickedUsers: SmsCampaignClickerDto[];
|
||||
}
|
||||
|
||||
/* ——— تیمها و سطح دسترسی به پروندهها ——— */
|
||||
|
||||
export type TeamMemberRole = "member" | "manager";
|
||||
|
||||
Reference in New Issue
Block a user