Ship loyalty club and form builder so production pull gets the new screens.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-06 13:50:05 +03:30
co-authored by Cursor
parent 175f1fa440
commit 820c0780d8
21 changed files with 3658 additions and 893 deletions
+117 -2
View File
@@ -817,18 +817,34 @@ export interface NotificationsListDto {
unreadCount: number;
}
export type LeadFormFieldType = "text" | "email" | "phone" | "textarea";
export const LEAD_FORM_FIELD_TYPES = [
"text",
"textarea",
"email",
"phone",
"select",
"radio",
"checkbox",
"date",
"number",
"file",
"rating",
"heading",
] as const;
export type LeadFormFieldType = (typeof LEAD_FORM_FIELD_TYPES)[number];
export type LeadFormMapTo =
| "person.firstName"
| "person.lastName"
| "person.fullName"
| "person.email"
| "person.mobile"
| "person.phone"
| "person.position"
| "deal.title"
| "deal.notes"
| "notes";
| "notes"
| "custom";
export interface LeadFormFieldDto {
id: string;
@@ -838,11 +854,14 @@ export interface LeadFormFieldDto {
required: boolean;
mapTo: LeadFormMapTo | string;
position: number;
placeholder: string | null;
options: string[];
}
export interface LeadFormDto {
id: string;
name: string;
description: string | null;
publicToken: string;
isActive: boolean;
createPerson: boolean;
@@ -852,7 +871,11 @@ export interface LeadFormDto {
thankYouMessage: string | null;
redirectUrl: string | null;
assigneeIds: string[];
submitLabel: string;
submitColor: string;
hasCover: boolean;
fields: LeadFormFieldDto[];
submissionCount?: number;
publicPath: string;
createdAt: string;
updatedAt: string;
@@ -865,10 +888,13 @@ export interface LeadFormFieldInput {
required?: boolean;
mapTo: LeadFormMapTo | string;
position?: number;
placeholder?: string | null;
options?: string[];
}
export interface CreateLeadFormRequest {
name: string;
description?: string | null;
createPerson?: boolean;
createDeal?: boolean;
pipelineId?: string | null;
@@ -876,11 +902,14 @@ export interface CreateLeadFormRequest {
thankYouMessage?: string | null;
redirectUrl?: string | null;
assigneeIds?: string[];
submitLabel?: string;
submitColor?: string;
fields?: LeadFormFieldInput[];
}
export interface UpdateLeadFormRequest {
name?: string;
description?: string | null;
isActive?: boolean;
createPerson?: boolean;
createDeal?: boolean;
@@ -889,20 +918,36 @@ export interface UpdateLeadFormRequest {
thankYouMessage?: string | null;
redirectUrl?: string | null;
assigneeIds?: string[];
submitLabel?: string;
submitColor?: string;
fields?: LeadFormFieldInput[];
}
export interface PublicLeadFormDto {
name: string;
description: string | null;
thankYouMessage: string | null;
submitLabel: string;
submitColor: string;
hasCover: boolean;
coverPath: string | null;
fields: Array<{
key: string;
label: string;
fieldType: LeadFormFieldType | string;
required: boolean;
placeholder: string | null;
options: string[];
}>;
}
export interface LeadFormSubmissionDto {
id: string;
values: Record<string, string>;
personId: string | null;
createdAt: string;
}
export interface SubmitLeadFormRequest {
values: Record<string, string>;
}
@@ -1604,6 +1649,76 @@ export interface LoyaltyMemberDto {
loyaltyPoints: number;
loyaltyTier: LoyaltyTierSummaryDto | null;
company: CompanySummaryDto | null;
lastActivityAt: string | null;
}
export interface LoyaltyStatsDto {
memberCount: number;
memberDeltaPct: number | null;
pointsIssued: number;
pointsIssuedDeltaPct: number | null;
rewardsUsed: number;
rewardsUsedDeltaPct: number | null;
retentionRate: number;
retentionDeltaPct: number | null;
}
export interface LoyaltySettingsDto {
enabled: boolean;
welcomePoints: number;
notifyOnAdjust: boolean;
}
export type UpdateLoyaltySettingsRequest = Partial<LoyaltySettingsDto>;
export interface LoyaltyRewardDto {
id: string;
name: string;
description: string | null;
pointsCost: number;
isActive: boolean;
position: number;
color: string | null;
redemptionCount?: number;
}
export interface CreateLoyaltyRewardRequest {
name: string;
description?: string | null;
pointsCost: number;
isActive?: boolean;
color?: string | null;
}
export type UpdateLoyaltyRewardRequest = Partial<CreateLoyaltyRewardRequest>;
export interface LoyaltyLedgerDto {
id: string;
delta: number;
reason: string | null;
source: string;
createdAt: string;
}
export interface BulkAdjustLoyaltyRequest {
personIds: string[];
delta: number;
reason?: string;
}
export interface LoyaltyMessageRequest {
personIds: string[];
text: string;
}
export interface LoyaltyMessageResult {
sent: number;
skipped: number;
failed: number;
}
export interface RedeemLoyaltyRewardRequest {
personId: string;
}
/** اتوماسیون اگر/آنگاه */