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,23 +7,23 @@ import {
|
||||
Param,
|
||||
UseGuards,
|
||||
Req,
|
||||
} from '@nestjs/common';
|
||||
import { B2BService, B2BWholesaleOrderItem } from './b2b.service';
|
||||
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 "@nestjs/common";
|
||||
import { B2BService, B2BWholesaleOrderItem } from "./b2b.service";
|
||||
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";
|
||||
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
import { Throttle } from "@nestjs/throttler";
|
||||
|
||||
@ApiTags('B2B - مدیریت پنل B2B و درخواستها')
|
||||
@Controller('b2b')
|
||||
@ApiTags("B2B - مدیریت پنل B2B و درخواستها")
|
||||
@Controller("b2b")
|
||||
export class B2BController {
|
||||
constructor(private readonly b2bService: B2BService) {}
|
||||
|
||||
@Throttle({ default: { limit: 5, ttl: 60000 } })
|
||||
@Post('inquire')
|
||||
@ApiOperation({ summary: 'ثبت استعلام جدید B2B (فرم ثبت استعلام)' })
|
||||
@Post("inquire")
|
||||
@ApiOperation({ summary: "ثبت استعلام جدید B2B (فرم ثبت استعلام)" })
|
||||
createInquiry(
|
||||
@Body()
|
||||
body: {
|
||||
@@ -40,21 +40,21 @@ export class B2BController {
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('ADMIN')
|
||||
@Roles("ADMIN")
|
||||
@ApiBearerAuth()
|
||||
@Get('inquiries')
|
||||
@ApiOperation({ summary: 'لیست تمام استعلامهای B2B (مخصوص ادمین)' })
|
||||
@Get("inquiries")
|
||||
@ApiOperation({ summary: "لیست تمام استعلامهای B2B (مخصوص ادمین)" })
|
||||
findAllInquiries() {
|
||||
return this.b2bService.findAllInquiries();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('ADMIN')
|
||||
@Roles("ADMIN")
|
||||
@ApiBearerAuth()
|
||||
@Put('inquiries/:id')
|
||||
@ApiOperation({ summary: 'به روزرسانی وضعیت استعلام B2B' })
|
||||
@Put("inquiries/:id")
|
||||
@ApiOperation({ summary: "به روزرسانی وضعیت استعلام B2B" })
|
||||
updateInquiryStatus(
|
||||
@Param('id') id: string,
|
||||
@Param("id") id: string,
|
||||
@Body() body: { status: string; adminNotes?: string },
|
||||
) {
|
||||
return this.b2bService.updateInquiryStatus(id, body);
|
||||
@@ -62,30 +62,30 @@ export class B2BController {
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Get('partner')
|
||||
@ApiOperation({ summary: 'دریافت اطلاعات حساب همکار تجاری' })
|
||||
@Get("partner")
|
||||
@ApiOperation({ summary: "دریافت اطلاعات حساب همکار تجاری" })
|
||||
getPartnerProfile(@Req() req: { user: { id?: string; userId?: string } }) {
|
||||
const userId = req.user.id || req.user.userId || '';
|
||||
const userId = req.user.id || req.user.userId || "";
|
||||
return this.b2bService.getPartnerProfile(userId);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Post('orders')
|
||||
@ApiOperation({ summary: 'ثبت سفارش عمدهفروشی B2B' })
|
||||
@Post("orders")
|
||||
@ApiOperation({ summary: "ثبت سفارش عمدهفروشی B2B" })
|
||||
createWholesaleOrder(
|
||||
@Req() req: { user: { id?: string; userId?: string } },
|
||||
@Body() body: { items: B2BWholesaleOrderItem[]; totalAmount: number },
|
||||
) {
|
||||
const userId = req.user.id || req.user.userId || '';
|
||||
const userId = req.user.id || req.user.userId || "";
|
||||
return this.b2bService.createWholesaleOrder(userId, body);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('ADMIN')
|
||||
@Roles("ADMIN")
|
||||
@ApiBearerAuth()
|
||||
@Get('partners')
|
||||
@ApiOperation({ summary: 'لیست حسابهای همکاران تجاری (مخصوص ادمین)' })
|
||||
@Get("partners")
|
||||
@ApiOperation({ summary: "لیست حسابهای همکاران تجاری (مخصوص ادمین)" })
|
||||
getAllPartnerAccounts() {
|
||||
return this.b2bService.getAllPartnerAccounts();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user