@hed-hog/contact 0.0.305 → 0.0.309

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
1
  import { Type } from 'class-transformer';
2
2
  import {
3
- IsArray,
4
- IsEmail,
5
- IsIn,
6
- IsInt,
7
- IsNumber,
8
- IsOptional,
9
- IsString,
10
- MaxLength,
11
- ValidateNested,
3
+ IsArray,
4
+ IsEmail,
5
+ IsIn,
6
+ IsInt,
7
+ IsNumber,
8
+ IsOptional,
9
+ IsString,
10
+ MaxLength,
11
+ ValidateNested,
12
12
  } from 'class-validator';
13
13
  import { PersonStatus } from './create.dto';
14
14
  import {
15
- UpdateAllAddressDTO,
16
- UpdateAllContactDTO,
17
- UpdateAllDocumentDTO,
15
+ UpdateAllAddressDTO,
16
+ UpdateAllContactDTO,
17
+ UpdateAllDocumentDTO,
18
18
  } from './update.dto';
19
19
 
20
20
  export const ACCOUNT_LIFECYCLE_STAGES = [
@@ -126,6 +126,10 @@ export class CreateAccountDTO {
126
126
  @ValidateNested({ each: true })
127
127
  @Type(() => UpdateAllDocumentDTO)
128
128
  documents?: UpdateAllDocumentDTO[];
129
+
130
+ @IsOptional()
131
+ @IsInt()
132
+ avatar_id?: number | null;
129
133
  }
130
134
 
131
135
  export class UpdateAccountDTO extends CreateAccountDTO {}
@@ -126,6 +126,7 @@ type AccountListItem = {
126
126
  state: string | null;
127
127
  created_at: string;
128
128
  last_interaction_at: string | null;
129
+ avatar_id: number | null;
129
130
  };
130
131
 
131
132
  type CrmActivityListParams = Omit<PaginationDTO, 'sortField' | 'sortOrder'> &
@@ -1348,6 +1349,7 @@ export class PersonService {
1348
1349
  name: normalizedName,
1349
1350
  type: 'company',
1350
1351
  status: data.status,
1352
+ avatar_id: data.avatar_id ?? null,
1351
1353
  },
1352
1354
  });
1353
1355
 
@@ -1391,6 +1393,7 @@ export class PersonService {
1391
1393
  name: nextName,
1392
1394
  type: 'company',
1393
1395
  status: data.status ?? person.status,
1396
+ avatar_id: data.avatar_id === undefined ? person.avatar_id : data.avatar_id,
1394
1397
  },
1395
1398
  });
1396
1399
 
@@ -4365,6 +4368,7 @@ export class PersonService {
4365
4368
  name: true,
4366
4369
  status: true,
4367
4370
  type: true,
4371
+ avatar_id: true,
4368
4372
  },
4369
4373
  });
4370
4374
 
@@ -4426,6 +4430,7 @@ export class PersonService {
4426
4430
  created_at: person.created_at?.toISOString?.() ?? String(person.created_at),
4427
4431
  last_interaction_at:
4428
4432
  this.normalizeDateTimeOrNull(person.last_interaction_at) ?? null,
4433
+ avatar_id: person.avatar_id ?? null,
4429
4434
  };
4430
4435
  }
4431
4436