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
@@ -8,59 +8,59 @@ import {
|
||||
Param,
|
||||
Query,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { WikiService } from './wiki.service';
|
||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
} from "@nestjs/common";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { WikiService } from "./wiki.service";
|
||||
import { JwtAuthGuard } from "../auth/jwt-auth.guard";
|
||||
import {
|
||||
ApiTags,
|
||||
ApiBearerAuth,
|
||||
ApiOperation,
|
||||
ApiQuery,
|
||||
} from '@nestjs/swagger';
|
||||
} from "@nestjs/swagger";
|
||||
|
||||
import { PaginationDto } from '../common/dto/pagination.dto';
|
||||
import { PaginationDto } from "../common/dto/pagination.dto";
|
||||
|
||||
import { RolesGuard } from '../common/guards/roles.guard';
|
||||
import { Roles } from '../common/decorators/roles.decorator';
|
||||
import { RolesGuard } from "../common/guards/roles.guard";
|
||||
import { Roles } from "../common/decorators/roles.decorator";
|
||||
|
||||
@ApiTags('Admin - مدیریت دانشنامه (اصطلاحات علمی)')
|
||||
@ApiTags("Admin - مدیریت دانشنامه (اصطلاحات علمی)")
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin', 'SUPER_ADMIN')
|
||||
@Controller('admin/wiki')
|
||||
@Roles("Admin", "SUPER_ADMIN")
|
||||
@Controller("admin/wiki")
|
||||
export class WikiController {
|
||||
constructor(private readonly wikiService: WikiService) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'لیست اصطلاحات دانشنامه' })
|
||||
@ApiQuery({ name: 'page', required: false, description: 'شماره صفحه' })
|
||||
@ApiQuery({ name: 'limit', required: false, description: 'تعداد آیتمها' })
|
||||
@ApiQuery({ name: 'search', required: false, description: 'جستجو' })
|
||||
@ApiOperation({ summary: "لیست اصطلاحات دانشنامه" })
|
||||
@ApiQuery({ name: "page", required: false, description: "شماره صفحه" })
|
||||
@ApiQuery({ name: "limit", required: false, description: "تعداد آیتمها" })
|
||||
@ApiQuery({ name: "search", required: false, description: "جستجو" })
|
||||
async getTerms(@Query() query: PaginationDto) {
|
||||
return this.wikiService.getTerms(query);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'ایجاد اصطلاح جدید' })
|
||||
@ApiOperation({ summary: "ایجاد اصطلاح جدید" })
|
||||
async createTerm(@Body() body: Prisma.ScientificTermCreateInput) {
|
||||
const data = await this.wikiService.createTerm(body);
|
||||
return { success: true, data };
|
||||
}
|
||||
|
||||
@Put(':key')
|
||||
@ApiOperation({ summary: 'ویرایش اصطلاح' })
|
||||
@Put(":key")
|
||||
@ApiOperation({ summary: "ویرایش اصطلاح" })
|
||||
async updateTerm(
|
||||
@Param('key') key: string,
|
||||
@Param("key") key: string,
|
||||
@Body() body: Prisma.ScientificTermUpdateInput,
|
||||
) {
|
||||
const data = await this.wikiService.updateTerm(key, body);
|
||||
return { success: true, data };
|
||||
}
|
||||
|
||||
@Delete(':key')
|
||||
@ApiOperation({ summary: 'حذف اصطلاح' })
|
||||
async deleteTerm(@Param('key') key: string) {
|
||||
@Delete(":key")
|
||||
@ApiOperation({ summary: "حذف اصطلاح" })
|
||||
async deleteTerm(@Param("key") key: string) {
|
||||
await this.wikiService.deleteTerm(key);
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user