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:
@@ -11,11 +11,12 @@ import {
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { LEAD_FORM_FIELD_TYPES } from '@mento/shared';
|
||||
|
||||
const FIELD_TYPES = ['text', 'email', 'phone', 'textarea'] as const;
|
||||
const MAP_TO = [
|
||||
'person.firstName',
|
||||
'person.lastName',
|
||||
'person.fullName',
|
||||
'person.email',
|
||||
'person.mobile',
|
||||
'person.phone',
|
||||
@@ -23,6 +24,7 @@ const MAP_TO = [
|
||||
'deal.title',
|
||||
'deal.notes',
|
||||
'notes',
|
||||
'custom',
|
||||
] as const;
|
||||
|
||||
export class LeadFormFieldInputDto {
|
||||
@@ -36,8 +38,8 @@ export class LeadFormFieldInputDto {
|
||||
@MaxLength(120)
|
||||
label!: string;
|
||||
|
||||
@IsIn(FIELD_TYPES)
|
||||
fieldType!: (typeof FIELD_TYPES)[number];
|
||||
@IsIn([...LEAD_FORM_FIELD_TYPES])
|
||||
fieldType!: (typeof LEAD_FORM_FIELD_TYPES)[number];
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@@ -48,6 +50,17 @@ export class LeadFormFieldInputDto {
|
||||
|
||||
@IsOptional()
|
||||
position?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(160)
|
||||
placeholder?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
@ArrayMaxSize(40)
|
||||
options?: string[];
|
||||
}
|
||||
|
||||
export class CreateLeadFormDto {
|
||||
@@ -56,6 +69,11 @@ export class CreateLeadFormDto {
|
||||
@MaxLength(120)
|
||||
name!: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(400)
|
||||
description?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
createPerson?: boolean;
|
||||
@@ -89,11 +107,21 @@ export class CreateLeadFormDto {
|
||||
@ArrayMaxSize(50)
|
||||
assigneeIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(80)
|
||||
submitLabel?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(20)
|
||||
submitColor?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => LeadFormFieldInputDto)
|
||||
@ArrayMaxSize(30)
|
||||
@ArrayMaxSize(40)
|
||||
fields?: LeadFormFieldInputDto[];
|
||||
}
|
||||
|
||||
@@ -104,6 +132,11 @@ export class UpdateLeadFormDto {
|
||||
@MaxLength(120)
|
||||
name?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(400)
|
||||
description?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
isActive?: boolean;
|
||||
@@ -141,11 +174,21 @@ export class UpdateLeadFormDto {
|
||||
@ArrayMaxSize(50)
|
||||
assigneeIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(80)
|
||||
submitLabel?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(20)
|
||||
submitColor?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => LeadFormFieldInputDto)
|
||||
@ArrayMaxSize(30)
|
||||
@ArrayMaxSize(40)
|
||||
fields?: LeadFormFieldInputDto[];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user