Files
canina/backend/src/admin/dto/user.dto.ts
T
devops ddbf1ca026
Deploy Canina / deploy (push) Successful in 4m1s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 7s
test: comprehensive test suites and quality gates pass across backend, storefront and admin
- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation.
- Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings.
- Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors.
- Fixed unmount lifecycle guards, promise error handling, and component edge cases.
2026-10-13 16:01:00 +00:00

95 lines
2.8 KiB
TypeScript

import {
IsNotEmpty,
IsString,
IsOptional,
IsEmail,
MinLength,
IsNumber,
} from "class-validator";
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
export class CreateUserDto {
@ApiProperty({ description: "نام کاربر", example: "علی" })
@IsNotEmpty({ message: "نام الزامی است" })
@IsString()
firstName!: string;
@ApiProperty({ description: "نام خانوادگی کاربر", example: "محمدی" })
@IsNotEmpty({ message: "نام خانوادگی الزامی است" })
@IsString()
lastName!: string;
@ApiProperty({ description: "شماره موبایل", example: "09123456789" })
@IsNotEmpty({ message: "شماره موبایل الزامی است" })
@IsString()
mobile!: string;
@ApiPropertyOptional({
description: "ایمیل کاربر",
example: "ali@example.com",
})
@IsOptional()
@IsEmail({}, { message: "فرمت ایمیل نامعتبر است" })
email?: string;
@ApiPropertyOptional({ description: "رمز عبور", example: "Password123" })
@IsOptional()
@IsString()
@MinLength(6, { message: "رمز عبور باید حداقل ۶ کاراکتر باشد" })
password?: string;
@ApiPropertyOptional({ description: "نقش کاربر", example: "User_PetOwner" })
@IsOptional()
@IsString()
role?: string;
@ApiPropertyOptional({ description: "موجودی اولیه کیف پول", example: 0 })
@IsOptional()
@IsNumber({}, { message: "موجودی کیف پول باید عدد باشد" })
walletBalance?: number;
}
export class UpdateUserDto {
@ApiPropertyOptional({ description: "نام کاربر", example: "علی" })
@IsOptional()
@IsString()
firstName?: string;
@ApiPropertyOptional({ description: "نام خانوادگی کاربر", example: "محمدی" })
@IsOptional()
@IsString()
lastName?: string;
@ApiPropertyOptional({ description: "شماره موبایل", example: "09123456789" })
@IsOptional()
@IsString()
mobile?: string;
@ApiPropertyOptional({
description: "ایمیل کاربر",
example: "ali@example.com",
})
@IsOptional()
@IsEmail({}, { message: "فرمت ایمیل نامعتبر است" })
email?: string;
@ApiPropertyOptional({
description: "رمز عبور جدید",
example: "NewPassword123",
})
@IsOptional()
@IsString()
@MinLength(6, { message: "رمز عبور باید حداقل ۶ کاراکتر باشد" })
password?: string;
@ApiPropertyOptional({ description: "نقش کاربر", example: "User_PetOwner" })
@IsOptional()
@IsString()
role?: string;
@ApiPropertyOptional({ description: "موجودی کیف پول", example: 500000 })
@IsOptional()
@IsNumber({}, { message: "موجودی کیف پول باید عدد باشد" })
walletBalance?: number;
}