Skip to content

Commit

Permalink
feat: more length -> min, max
Browse files Browse the repository at this point in the history
  • Loading branch information
Nat Dean-Lewis committed Jan 15, 2025
1 parent 171b5bf commit d90ff82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/modules/customers/dto/company-registration-number.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, Length } from 'class-validator';
import { IsNotEmpty, IsString, MaxLength, MinLength } from 'class-validator';

export class CompanyRegistrationNumberDto {
@ApiProperty({
Expand All @@ -9,6 +9,7 @@ export class CompanyRegistrationNumberDto {
})
@IsString()
@IsNotEmpty()
@Length(8, 10)
@MinLength(8)
@MaxLength(10)
companyRegistrationNumber: string;
}
5 changes: 3 additions & 2 deletions src/modules/customers/dto/dtfs-customer.dto.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ApiProperty } from '@nestjs/swagger';

Check failure on line 1 in src/modules/customers/dto/dtfs-customer.dto.ts

View workflow job for this annotation

GitHub Actions / Scanning 🎨

Run autofix to sort these imports!
import { IsNotEmpty, IsString, Length } from 'class-validator';
import { IsNotEmpty, IsString, MinLength, MaxLength } from 'class-validator';

export class DTFSCustomerDto {
@ApiProperty({ description: 'Company Registration Number', minLength: 8, maxLength: 10 })
@IsString()
@IsNotEmpty()
@Length(8, 10)
@MinLength(8)
@MaxLength(10)
companyRegistrationNumber: string;

@ApiProperty({ description: 'Company Name' })
Expand Down

0 comments on commit d90ff82

Please sign in to comment.