fix(prisma): regenerate client types, fix admin service and sync graphify
This commit is contained in:
1 parent
4e768d66a9
commit
c35cff5671
229 files changed
+113729
-113225
No files matched your search
@@ -615,7 +615,11 @@ export class AdminService {
|
||||
});
|
||||
}
|
||||
|
||||
async refundOrderToWallet(orderId: string, customAmount?: number, reason?: string) {
|
||||
async refundOrderToWallet(
|
||||
orderId: string,
|
||||
customAmount?: number,
|
||||
reason?: string,
|
||||
) {
|
||||
const order = await this.prisma.order.findUnique({
|
||||
where: { id: orderId },
|
||||
include: { user: true },
|
||||
@@ -626,12 +630,15 @@ export class AdminService {
|
||||
}
|
||||
|
||||
if (!order.userId || !order.user) {
|
||||
throw new BadRequestException('این سفارش به کاربر ثبتنامشدهای متصل نیست');
|
||||
throw new BadRequestException(
|
||||
'این سفارش به کاربر ثبتنامشدهای متصل نیست',
|
||||
);
|
||||
}
|
||||
|
||||
const refundAmount = customAmount !== undefined && customAmount > 0
|
||||
? customAmount
|
||||
: Number(order.totalAmount || 0);
|
||||
const refundAmount =
|
||||
customAmount !== undefined && customAmount > 0
|
||||
? customAmount
|
||||
: Number(order.totalAmount || 0);
|
||||
|
||||
if (refundAmount <= 0) {
|
||||
throw new BadRequestException('مبلغ استرداد باید بیشتر از صفر باشد');
|
||||
@@ -653,7 +660,9 @@ export class AdminService {
|
||||
amount: refundAmount,
|
||||
type: 'deposit',
|
||||
status: 'completed',
|
||||
description: reason || `استرداد وجه سفارش لغو شده #${order.trackingNumber || order.id.slice(0, 8)} به کیف پول`,
|
||||
description:
|
||||
reason ||
|
||||
`استرداد وجه سفارش لغو شده #${order.trackingNumber || order.id.slice(0, 8)} به کیف پول`,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -812,7 +821,7 @@ export class AdminService {
|
||||
update: { value: String(value) },
|
||||
create: { key, value: String(value), category: 'general' },
|
||||
});
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user