fix(lint): clean up type definitions and missing imports
Deploy Canina / deploy (push) Failing after 30m46s
Deploy Canina / deploy (push) Failing after 30m46s
This commit is contained in:
1 parent
9c8286c63f
commit
2de442dbae
9 files changed
+147
-62
No files matched your search
@@ -92,7 +92,12 @@ export class OrdersService {
|
||||
|
||||
// Verify stock and build items
|
||||
let cartTotal = 0;
|
||||
const orderItems: Array<{ productId: string; quantity: number; unitPrice: number; totalPrice: number }> = [];
|
||||
const orderItems: Array<{
|
||||
productId: string;
|
||||
quantity: number;
|
||||
unitPrice: number;
|
||||
totalPrice: number;
|
||||
}> = [];
|
||||
|
||||
for (const item of createOrderDto.items) {
|
||||
const product = await this.prisma.product.findUnique({
|
||||
@@ -182,15 +187,20 @@ export class OrdersService {
|
||||
|
||||
// Send Order Confirmation SMS
|
||||
if (userId) {
|
||||
this.prisma.user.findUnique({ where: { id: userId } }).then((user) => {
|
||||
if (user && user.mobile) {
|
||||
this.smsService.sendOrderConfirmation(
|
||||
user.mobile,
|
||||
trackingNumber,
|
||||
finalAmount.toLocaleString('fa-IR'),
|
||||
).catch(() => {});
|
||||
}
|
||||
}).catch(() => {});
|
||||
this.prisma.user
|
||||
.findUnique({ where: { id: userId } })
|
||||
.then((user) => {
|
||||
if (user && user.mobile) {
|
||||
this.smsService
|
||||
.sendOrderConfirmation(
|
||||
user.mobile,
|
||||
trackingNumber,
|
||||
finalAmount.toLocaleString('fa-IR'),
|
||||
)
|
||||
.catch(() => {});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
return createdOrder;
|
||||
@@ -219,11 +229,9 @@ export class OrdersService {
|
||||
const mobile = updatedOrder.user?.mobile;
|
||||
const trackingNum = updatedOrder.trackingNumber || trackingCode || '';
|
||||
if (status === 'shipped' && mobile && trackingCode) {
|
||||
this.smsService.sendShippingNotification(
|
||||
mobile,
|
||||
trackingNum,
|
||||
trackingCode,
|
||||
).catch(() => {});
|
||||
this.smsService
|
||||
.sendShippingNotification(mobile, trackingNum, trackingCode)
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
return updatedOrder;
|
||||
|
||||
Reference in new issue
Block a user