Track person import source and previous names; add source report and edit UX.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-04 12:01:21 +03:30
co-authored by Cursor
parent e144b2277a
commit 8b37525f2f
15 changed files with 632 additions and 25 deletions
+54 -1
View File
@@ -13,7 +13,7 @@ import {
MinLength,
ValidateIf,
} from 'class-validator';
import { PERSON_MOODS } from '@mento/shared';
import { PERSON_IMPORT_SOURCES, PERSON_MOODS } from '@mento/shared';
export class ListQueryDto {
@IsOptional()
@@ -40,6 +40,12 @@ export class ListQueryDto {
@IsOptional()
@IsIn(['name', 'newest'])
sort?: 'name' | 'newest';
/** فیلتر منبع ورود شخص */
@IsOptional()
@IsString()
@MaxLength(40)
importSource?: string;
}
export class CreateCompanyDto {
@@ -156,6 +162,30 @@ export class CreatePersonDto {
@MaxLength(80)
lastName?: string;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsString()
@MaxLength(80)
previousFirstName?: string | null;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsString()
@MaxLength(80)
previousLastName?: string | null;
@IsOptional()
@IsString()
@MaxLength(40)
@IsIn([...PERSON_IMPORT_SOURCES])
importSource?: (typeof PERSON_IMPORT_SOURCES)[number];
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsString()
@MaxLength(120)
sourceRef?: string | null;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsEmail()
@@ -241,6 +271,29 @@ export class UpdatePersonDto {
@MaxLength(80)
lastName?: string;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsString()
@MaxLength(80)
previousFirstName?: string | null;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsString()
@MaxLength(80)
previousLastName?: string | null;
@IsOptional()
@IsString()
@MaxLength(40)
importSource?: string;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsString()
@MaxLength(120)
sourceRef?: string | null;
@IsOptional()
@ValidateIf((_, v) => v !== '' && v != null)
@IsEmail()