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.
This commit is contained in:
1 parent
1e73715169
commit
ddbf1ca026
439 files changed
+32911
-6107
No files matched your search
@@ -1,15 +1,15 @@
|
||||
import { IsEmail, IsNotEmpty, IsString, MinLength } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEmail, IsNotEmpty, IsString, MinLength } from "class-validator";
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
|
||||
export class AdminLoginDto {
|
||||
@ApiProperty({ description: 'ایمیل ادمین', example: 'admin@canina.ir' })
|
||||
@IsEmail({}, { message: 'فرمت ایمیل وارد شده معتبر نمیباشد.' })
|
||||
@IsNotEmpty({ message: 'ایمیل الزامی است.' })
|
||||
@ApiProperty({ description: "ایمیل ادمین", example: "admin@canina.ir" })
|
||||
@IsEmail({}, { message: "فرمت ایمیل وارد شده معتبر نمیباشد." })
|
||||
@IsNotEmpty({ message: "ایمیل الزامی است." })
|
||||
email!: string;
|
||||
|
||||
@ApiProperty({ description: 'رمز عبور ادمین', example: 'admin123' })
|
||||
@IsString({ message: 'رمز عبور باید رشته متنی باشد.' })
|
||||
@MinLength(6, { message: 'رمز عبور باید حداقل ۶ کاراکتر باشد.' })
|
||||
@IsNotEmpty({ message: 'رمز عبور الزامی است.' })
|
||||
@ApiProperty({ description: "رمز عبور ادمین", example: "admin123" })
|
||||
@IsString({ message: "رمز عبور باید رشته متنی باشد." })
|
||||
@MinLength(6, { message: "رمز عبور باید حداقل ۶ کاراکتر باشد." })
|
||||
@IsNotEmpty({ message: "رمز عبور الزامی است." })
|
||||
password!: string;
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
import { IsNotEmpty, IsString, MinLength } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, MinLength } from "class-validator";
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
|
||||
export class LoginDto {
|
||||
@ApiProperty({ description: 'شماره موبایل', example: '09123456789' })
|
||||
@IsNotEmpty({ message: 'شماره موبایل الزامی است' })
|
||||
@ApiProperty({ description: "شماره موبایل", example: "09123456789" })
|
||||
@IsNotEmpty({ message: "شماره موبایل الزامی است" })
|
||||
@IsString()
|
||||
mobile: string;
|
||||
|
||||
@ApiProperty({ description: 'رمز عبور', example: 'password123' })
|
||||
@IsNotEmpty({ message: 'رمز عبور الزامی است' })
|
||||
@MinLength(6, { message: 'رمز عبور باید حداقل ۶ کاراکتر باشد' })
|
||||
@ApiProperty({ description: "رمز عبور", example: "password123" })
|
||||
@IsNotEmpty({ message: "رمز عبور الزامی است" })
|
||||
@MinLength(6, { message: "رمز عبور باید حداقل ۶ کاراکتر باشد" })
|
||||
password: string;
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString } from "class-validator";
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
|
||||
export class RefreshTokenDto {
|
||||
@ApiProperty({
|
||||
description: 'توکن تازهسازی (Refresh Token)',
|
||||
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
|
||||
description: "توکن تازهسازی (Refresh Token)",
|
||||
example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
||||
})
|
||||
@IsNotEmpty({ message: 'ارسال توکن تازهسازی الزامی است' })
|
||||
@IsString({ message: 'توکن تازهسازی باید رشته متنی باشد' })
|
||||
@IsNotEmpty({ message: "ارسال توکن تازهسازی الزامی است" })
|
||||
@IsString({ message: "توکن تازهسازی باید رشته متنی باشد" })
|
||||
refreshToken: string;
|
||||
}
|
||||
@@ -4,35 +4,35 @@ import {
|
||||
IsOptional,
|
||||
IsString,
|
||||
MinLength,
|
||||
} from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
} from "class-validator";
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
|
||||
export class RegisterDto {
|
||||
@ApiProperty({ description: 'نام', example: 'علی' })
|
||||
@IsNotEmpty({ message: 'نام الزامی است' })
|
||||
@ApiProperty({ description: "نام", example: "علی" })
|
||||
@IsNotEmpty({ message: "نام الزامی است" })
|
||||
@IsString()
|
||||
firstName: string;
|
||||
|
||||
@ApiProperty({ description: 'نام خانوادگی', example: 'رضایی' })
|
||||
@IsNotEmpty({ message: 'نام خانوادگی الزامی است' })
|
||||
@ApiProperty({ description: "نام خانوادگی", example: "رضایی" })
|
||||
@IsNotEmpty({ message: "نام خانوادگی الزامی است" })
|
||||
@IsString()
|
||||
lastName: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description: 'ایمیل (اختیاری)',
|
||||
example: 'ali@example.com',
|
||||
description: "ایمیل (اختیاری)",
|
||||
example: "ali@example.com",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsEmail({}, { message: 'ایمیل نامعتبر است' })
|
||||
@IsEmail({}, { message: "ایمیل نامعتبر است" })
|
||||
email?: string;
|
||||
|
||||
@ApiProperty({ description: 'شماره موبایل', example: '09123456789' })
|
||||
@IsNotEmpty({ message: 'شماره موبایل الزامی است' })
|
||||
@ApiProperty({ description: "شماره موبایل", example: "09123456789" })
|
||||
@IsNotEmpty({ message: "شماره موبایل الزامی است" })
|
||||
@IsString()
|
||||
mobile: string;
|
||||
|
||||
@ApiProperty({ description: 'رمز عبور', example: 'password123' })
|
||||
@IsNotEmpty({ message: 'رمز عبور الزامی است' })
|
||||
@MinLength(6, { message: 'رمز عبور باید حداقل ۶ کاراکتر باشد' })
|
||||
@ApiProperty({ description: "رمز عبور", example: "password123" })
|
||||
@IsNotEmpty({ message: "رمز عبور الزامی است" })
|
||||
@MinLength(6, { message: "رمز عبور باید حداقل ۶ کاراکتر باشد" })
|
||||
password: string;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, Matches } from 'class-validator';
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsNotEmpty, IsString, Matches } from "class-validator";
|
||||
|
||||
export class SendOtpDto {
|
||||
@ApiProperty({ description: 'شماره موبایل کاربر', example: '09123456789' })
|
||||
@ApiProperty({ description: "شماره موبایل کاربر", example: "09123456789" })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@Matches(/^09\d{9}$/, { message: 'شماره موبایل نامعتبر است' })
|
||||
@Matches(/^09\d{9}$/, { message: "شماره موبایل نامعتبر است" })
|
||||
phoneNumber: string;
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, Length, Matches } from 'class-validator';
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsNotEmpty, IsString, Length, Matches } from "class-validator";
|
||||
|
||||
export class VerifyOtpDto {
|
||||
@ApiProperty({ description: 'شماره موبایل کاربر', example: '09123456789' })
|
||||
@ApiProperty({ description: "شماره موبایل کاربر", example: "09123456789" })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@Matches(/^09\d{9}$/, { message: 'شماره موبایل نامعتبر است' })
|
||||
@Matches(/^09\d{9}$/, { message: "شماره موبایل نامعتبر است" })
|
||||
phoneNumber: string;
|
||||
|
||||
@ApiProperty({ description: 'کد تایید پیامک شده', example: '12345' })
|
||||
@ApiProperty({ description: "کد تایید پیامک شده", example: "12345" })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@Length(5, 5, { message: 'کد تایید باید ۵ رقم باشد' })
|
||||
@Length(5, 5, { message: "کد تایید باید ۵ رقم باشد" })
|
||||
code: string;
|
||||
}
|
||||
Reference in new issue
Block a user