diff --git a/src/modules/users/dto/update-user-address.dto.ts b/src/modules/users/dto/update-user-address.dto.ts index e82330c..efa901f 100644 --- a/src/modules/users/dto/update-user-address.dto.ts +++ b/src/modules/users/dto/update-user-address.dto.ts @@ -1,5 +1,5 @@ import { IsString, IsOptional, IsNumber, IsBoolean, Min, Max } from 'class-validator'; -import { ApiPropertyOptional } from '@nestjs/swagger'; +import { ApiPropertyOptional,ApiProperty } from '@nestjs/swagger'; /** * DTO for updating a user address. @@ -15,15 +15,13 @@ export class UpdateUserAddressDto { @IsString() address?: string; - @ApiPropertyOptional({ description: 'City name', example: 'Tehran' }) - @IsOptional() + @ApiProperty({ description: 'City name', example: 'Tehran' }) @IsString() - city?: string; + city: string; - @ApiPropertyOptional({ description: 'Province', example: 'Tehran Province' }) - @IsOptional() + @ApiProperty({ description: 'Province', example: 'Tehran Province' }) @IsString() - province?: string; + province: string; @ApiPropertyOptional({ description: 'Postal/ZIP code', example: '12345-6789' }) @IsOptional() diff --git a/src/modules/users/entities/user-address.entity.ts b/src/modules/users/entities/user-address.entity.ts index d2ae78c..1629869 100644 --- a/src/modules/users/entities/user-address.entity.ts +++ b/src/modules/users/entities/user-address.entity.ts @@ -14,10 +14,10 @@ export class UserAddress extends BaseEntity { address!: string; @Property() - city!: string; + city: string; - @Property({ nullable: true }) - province?: string; + @Property() + province: string; @Property({ nullable: true }) postalCode?: string | null = null;