feat: complete scheduled publishing, security remediation and DEV_TICKETS implementation
Deploy Canina / deploy (push) Successful in 2m29s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 6s

This commit is contained in:
parsa committed 2026-09-29 01:15:33 +03:30
1 parent d6d4158cbe
commit efb3c473c4
35 files changed
+685 -185

No files matched your search

+17 -3
View File
@@ -230,7 +230,7 @@ export class OrdersService {
});
}
return tx.order.create({
const newOrder = await tx.order.create({
data: {
userId,
couponId,
@@ -252,6 +252,17 @@ export class OrdersService {
},
},
});
if (couponId) {
await tx.coupon
.update({
where: { id: couponId },
data: { usedCount: { increment: 1 } },
})
.catch(() => {});
}
return newOrder;
});
// Send Order Confirmation SMS for wallet orders
@@ -570,8 +581,11 @@ export class OrdersService {
throw new NotFoundException('سفارش مورد نظر یافت نشد');
}
if (['shipped', 'delivered'].includes(order.status)) {
throw new BadRequestException('این سفارش قبلاً پرداخت و تکمیل شده است');
const ALLOWED_RETRY_STATUSES = ['pending_payment', 'failed'];
if (!ALLOWED_RETRY_STATUSES.includes(order.status)) {
throw new BadRequestException(
'تنها سفارش‌های در انتظار پرداخت یا ناموفق قابلیت پرداخت مجدد دارند.',
);
}
const selectedMethod = paymentMethod || order.paymentMethod || 'online';