feat: SMS campaigns for people or leads with filters and batching

Add audience tabs, province/city filters, select-all ids, dynamic SMS tokens, and 50-sized create/send chunks.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-17 20:54:32 +03:30
co-authored by Cursor
parent 32c722f42a
commit d62e004e90
10 changed files with 1040 additions and 131 deletions
+22 -2
View File
@@ -755,6 +755,8 @@ export interface HealthResponse {
export interface CompanySummaryDto {
id: string;
name: string;
province?: string | null;
city?: string | null;
}
export interface CompanyDto {
@@ -4321,15 +4323,33 @@ export interface SmsCampaignDto {
updatedAt: string;
}
/** حداکثر گیرنده در هر درخواست ساخت/افزودن کمپین پیامک */
export const SMS_CAMPAIGN_CHUNK_SIZE = 50;
/** سقف شناسه‌های قابل دریافت از /people/ids و /leads/ids */
export const FILTERED_IDS_MAX = 50_000;
export interface FilteredIdsResponse {
ids: string[];
total: number;
}
export interface CreateSmsCampaignRequest {
name: string;
body: string;
personIds: string[];
/** دقیقاً یکی از personIds یا leadIds */
personIds?: string[];
leadIds?: string[];
scheduledAt?: string | null;
/** اگر true باشد بلافاصله صف می‌شود */
/** اگر true باشد بلافاصله صف می‌شود (فقط وقتی همه گیرنده‌ها در همین درخواست باشند یا بعد از افزودن تکه‌ها جداگانه queue شود) */
queueNow?: boolean;
}
export interface AddSmsCampaignRecipientsRequest {
personIds?: string[];
leadIds?: string[];
}
export interface SmsCampaignListResponse {
items: SmsCampaignDto[];
total: number;