From d90ff829a48c46e7e0796b38b346abf1eac00b74 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Wed, 15 Jan 2025 16:38:17 +0000 Subject: [PATCH] feat: more length -> min, max --- src/modules/customers/dto/company-registration-number.dto.ts | 5 +++-- src/modules/customers/dto/dtfs-customer.dto.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/customers/dto/company-registration-number.dto.ts b/src/modules/customers/dto/company-registration-number.dto.ts index c7f513a9..ca986bd4 100644 --- a/src/modules/customers/dto/company-registration-number.dto.ts +++ b/src/modules/customers/dto/company-registration-number.dto.ts @@ -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({ @@ -9,6 +9,7 @@ export class CompanyRegistrationNumberDto { }) @IsString() @IsNotEmpty() - @Length(8, 10) + @MinLength(8) + @MaxLength(10) companyRegistrationNumber: string; } diff --git a/src/modules/customers/dto/dtfs-customer.dto.ts b/src/modules/customers/dto/dtfs-customer.dto.ts index 54fc5220..71e53b50 100644 --- a/src/modules/customers/dto/dtfs-customer.dto.ts +++ b/src/modules/customers/dto/dtfs-customer.dto.ts @@ -1,11 +1,12 @@ import { ApiProperty } from '@nestjs/swagger'; -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' })