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
@@ -7,107 +7,107 @@ import {
|
||||
Body,
|
||||
Param,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { CmsService } from './cms.service';
|
||||
} from "@nestjs/common";
|
||||
import { CmsService } from "./cms.service";
|
||||
import {
|
||||
CreateHeroBannerDto,
|
||||
CreateVetTestimonialDto,
|
||||
CreateSmartAdvisorRuleDto,
|
||||
} from './dto/cms.dto';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
import { RolesGuard } from '../auth/roles.guard';
|
||||
import { Roles } from '../auth/roles.decorator';
|
||||
} from "./dto/cms.dto";
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from "@nestjs/swagger";
|
||||
import { JwtAuthGuard } from "../auth/jwt-auth.guard";
|
||||
import { RolesGuard } from "../auth/roles.guard";
|
||||
import { Roles } from "../auth/roles.decorator";
|
||||
|
||||
@ApiTags('CMS - مدیریت بنرها، نظرات دامپزشکان و قوانین مشاوره')
|
||||
@Controller('admin/cms')
|
||||
@ApiTags("CMS - مدیریت بنرها، نظرات دامپزشکان و قوانین مشاوره")
|
||||
@Controller("admin/cms")
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('ADMIN')
|
||||
@Roles("ADMIN")
|
||||
@ApiBearerAuth()
|
||||
export class CmsController {
|
||||
constructor(private readonly cmsService: CmsService) {}
|
||||
|
||||
// Hero Banners Admin
|
||||
@Get('hero-banners')
|
||||
@ApiOperation({ summary: 'لیست تمام بنرهای هیرو' })
|
||||
@Get("hero-banners")
|
||||
@ApiOperation({ summary: "لیست تمام بنرهای هیرو" })
|
||||
getHeroBanners() {
|
||||
return this.cmsService.getHeroBanners();
|
||||
}
|
||||
|
||||
@Post('hero-banners')
|
||||
@ApiOperation({ summary: 'ایجاد بنر جدید هیرو' })
|
||||
@Post("hero-banners")
|
||||
@ApiOperation({ summary: "ایجاد بنر جدید هیرو" })
|
||||
createHeroBanner(@Body() dto: CreateHeroBannerDto) {
|
||||
return this.cmsService.createHeroBanner(dto);
|
||||
}
|
||||
|
||||
@Put('hero-banners/:id')
|
||||
@ApiOperation({ summary: 'ویرایش بنر هیرو' })
|
||||
@Put("hero-banners/:id")
|
||||
@ApiOperation({ summary: "ویرایش بنر هیرو" })
|
||||
updateHeroBanner(
|
||||
@Param('id') id: string,
|
||||
@Param("id") id: string,
|
||||
@Body() dto: Partial<CreateHeroBannerDto>,
|
||||
) {
|
||||
return this.cmsService.updateHeroBanner(id, dto);
|
||||
}
|
||||
|
||||
@Delete('hero-banners/:id')
|
||||
@ApiOperation({ summary: 'حذف بنر هیرو' })
|
||||
deleteHeroBanner(@Param('id') id: string) {
|
||||
@Delete("hero-banners/:id")
|
||||
@ApiOperation({ summary: "حذف بنر هیرو" })
|
||||
deleteHeroBanner(@Param("id") id: string) {
|
||||
return this.cmsService.deleteHeroBanner(id);
|
||||
}
|
||||
|
||||
// Vet Testimonials Admin
|
||||
@Get('vet-testimonials')
|
||||
@ApiOperation({ summary: 'لیست تمام نظرات دامپزشکان' })
|
||||
@Get("vet-testimonials")
|
||||
@ApiOperation({ summary: "لیست تمام نظرات دامپزشکان" })
|
||||
getVetTestimonials() {
|
||||
return this.cmsService.getVetTestimonials();
|
||||
}
|
||||
|
||||
@Post('vet-testimonials')
|
||||
@ApiOperation({ summary: 'ایجاد نظر دامپزشک جدید' })
|
||||
@Post("vet-testimonials")
|
||||
@ApiOperation({ summary: "ایجاد نظر دامپزشک جدید" })
|
||||
createVetTestimonial(@Body() dto: CreateVetTestimonialDto) {
|
||||
return this.cmsService.createVetTestimonial(dto);
|
||||
}
|
||||
|
||||
@Put('vet-testimonials/:id')
|
||||
@ApiOperation({ summary: 'ویرایش نظر دامپزشک' })
|
||||
@Put("vet-testimonials/:id")
|
||||
@ApiOperation({ summary: "ویرایش نظر دامپزشک" })
|
||||
updateVetTestimonial(
|
||||
@Param('id') id: string,
|
||||
@Param("id") id: string,
|
||||
@Body() dto: Partial<CreateVetTestimonialDto>,
|
||||
) {
|
||||
return this.cmsService.updateVetTestimonial(id, dto);
|
||||
}
|
||||
|
||||
@Delete('vet-testimonials/:id')
|
||||
@ApiOperation({ summary: 'حذف نظر دامپزشک' })
|
||||
deleteVetTestimonial(@Param('id') id: string) {
|
||||
@Delete("vet-testimonials/:id")
|
||||
@ApiOperation({ summary: "حذف نظر دامپزشک" })
|
||||
deleteVetTestimonial(@Param("id") id: string) {
|
||||
return this.cmsService.deleteVetTestimonial(id);
|
||||
}
|
||||
|
||||
// Smart Advisor Rules Admin
|
||||
@Get('smart-advisor-rules')
|
||||
@ApiOperation({ summary: 'لیست قوانین دستیار هوشمند سلامت' })
|
||||
@Get("smart-advisor-rules")
|
||||
@ApiOperation({ summary: "لیست قوانین دستیار هوشمند سلامت" })
|
||||
getSmartAdvisorRules() {
|
||||
return this.cmsService.getSmartAdvisorRules();
|
||||
}
|
||||
|
||||
@Post('smart-advisor-rules')
|
||||
@ApiOperation({ summary: 'ایجاد قانون مشاوره هوشمند جدید' })
|
||||
@Post("smart-advisor-rules")
|
||||
@ApiOperation({ summary: "ایجاد قانون مشاوره هوشمند جدید" })
|
||||
createSmartAdvisorRule(@Body() dto: CreateSmartAdvisorRuleDto) {
|
||||
return this.cmsService.createSmartAdvisorRule(dto);
|
||||
}
|
||||
|
||||
@Put('smart-advisor-rules/:id')
|
||||
@ApiOperation({ summary: 'ویرایش قانون مشاوره هوشمند' })
|
||||
@Put("smart-advisor-rules/:id")
|
||||
@ApiOperation({ summary: "ویرایش قانون مشاوره هوشمند" })
|
||||
updateSmartAdvisorRule(
|
||||
@Param('id') id: string,
|
||||
@Param("id") id: string,
|
||||
@Body() dto: Partial<CreateSmartAdvisorRuleDto>,
|
||||
) {
|
||||
return this.cmsService.updateSmartAdvisorRule(id, dto);
|
||||
}
|
||||
|
||||
@Delete('smart-advisor-rules/:id')
|
||||
@ApiOperation({ summary: 'حذف قانون مشاوره هوشمند' })
|
||||
deleteSmartAdvisorRule(@Param('id') id: string) {
|
||||
@Delete("smart-advisor-rules/:id")
|
||||
@ApiOperation({ summary: "حذف قانون مشاوره هوشمند" })
|
||||
deleteSmartAdvisorRule(@Param("id") id: string) {
|
||||
return this.cmsService.deleteSmartAdvisorRule(id);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user