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,58 +8,58 @@ import {
|
||||
Body,
|
||||
Param,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { BannersService } from './banners.service';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
import { RolesGuard } from '../common/guards/roles.guard';
|
||||
import { Roles } from '../common/decorators/roles.decorator';
|
||||
} from "@nestjs/common";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { BannersService } from "./banners.service";
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from "@nestjs/swagger";
|
||||
import { JwtAuthGuard } from "../auth/jwt-auth.guard";
|
||||
import { RolesGuard } from "../common/guards/roles.guard";
|
||||
import { Roles } from "../common/decorators/roles.decorator";
|
||||
|
||||
@ApiTags('Banners - بنرهای تبلیغاتی و اسلایدر')
|
||||
@Controller('banners')
|
||||
@ApiTags("Banners - بنرهای تبلیغاتی و اسلایدر")
|
||||
@Controller("banners")
|
||||
export class BannersController {
|
||||
constructor(private readonly bannersService: BannersService) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'لیست تمامی بنرها' })
|
||||
@ApiOperation({ summary: "لیست تمامی بنرها" })
|
||||
findAll() {
|
||||
return this.bannersService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@Roles("Admin")
|
||||
@ApiBearerAuth()
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'ایجاد بنر جدید (نیازمند ادمین)' })
|
||||
@ApiOperation({ summary: "ایجاد بنر جدید (نیازمند ادمین)" })
|
||||
create(@Body() body: Prisma.BannerCreateInput) {
|
||||
return this.bannersService.create(body);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@Roles("Admin")
|
||||
@ApiBearerAuth()
|
||||
@Put('reorder')
|
||||
@ApiOperation({ summary: 'تغییر ترتیب نمایش بنرها (نیازمند ادمین)' })
|
||||
@Put("reorder")
|
||||
@ApiOperation({ summary: "تغییر ترتیب نمایش بنرها (نیازمند ادمین)" })
|
||||
reorder(@Body() body: { id: string; order: number }[]) {
|
||||
return this.bannersService.reorder(body);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@Roles("Admin")
|
||||
@ApiBearerAuth()
|
||||
@Patch(':id')
|
||||
@ApiOperation({ summary: 'ویرایش بنر (نیازمند ادمین)' })
|
||||
update(@Param('id') id: string, @Body() body: Prisma.BannerUpdateInput) {
|
||||
@Patch(":id")
|
||||
@ApiOperation({ summary: "ویرایش بنر (نیازمند ادمین)" })
|
||||
update(@Param("id") id: string, @Body() body: Prisma.BannerUpdateInput) {
|
||||
return this.bannersService.update(id, body);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('Admin')
|
||||
@Roles("Admin")
|
||||
@ApiBearerAuth()
|
||||
@Delete(':id')
|
||||
@ApiOperation({ summary: 'حذف بنر (نیازمند ادمین)' })
|
||||
remove(@Param('id') id: string) {
|
||||
@Delete(":id")
|
||||
@ApiOperation({ summary: "حذف بنر (نیازمند ادمین)" })
|
||||
remove(@Param("id") id: string) {
|
||||
return this.bannersService.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user