Skip to content

Commit 171b5bf

Browse files
feat: update create customer dto validation
1 parent e28ece2 commit 171b5bf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/modules/customers/dto/create-customer.dto.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { ApiProperty } from '@nestjs/swagger';
2-
import { IsNotEmpty, IsString, Length } from 'class-validator';
2+
import { IsNotEmpty, IsString, Length, MaxLength, MinLength } from 'class-validator';
33

44
export class CreateCustomerDto {
55
@ApiProperty({ description: 'Account Name' })
66
@IsString()
77
@IsNotEmpty()
88
Name: string;
99

10-
@ApiProperty({ description: 'Party URN' })
10+
@ApiProperty({ description: 'Party URN', maxLength: 10 })
1111
@IsString()
1212
@IsNotEmpty()
13+
@MaxLength(10)
1314
Party_URN__c: string;
1415

1516
@ApiProperty({ description: 'D&B Number', minLength: 9, maxLength: 9 })
@@ -21,6 +22,7 @@ export class CreateCustomerDto {
2122
@ApiProperty({ description: 'Companies House Number', minLength: 8, maxLength: 10 })
2223
@IsString()
2324
@IsNotEmpty()
24-
@Length(8, 10)
25+
@MinLength(8)
26+
@MaxLength(10)
2527
Company_Registration_Number__c: string;
2628
}

0 commit comments

Comments
 (0)