fix: request data notification when new
This commit is contained in:
parent
8a4317c94e
commit
07e5f53be2
1 changed files with 12 additions and 0 deletions
|
|
@ -181,6 +181,7 @@ export class QuotationPayment extends Controller {
|
|||
|
||||
await tx.quotation
|
||||
.update({
|
||||
include: { requestData: true },
|
||||
where: { id: quotation.id },
|
||||
data: {
|
||||
quotationStatus:
|
||||
|
|
@ -238,6 +239,17 @@ export class QuotationPayment extends Controller {
|
|||
receiverId: res.createdByUserId,
|
||||
},
|
||||
});
|
||||
|
||||
if (quotation.quotationStatus === "PaymentPending") {
|
||||
await prisma.notification.create({
|
||||
data: {
|
||||
title: "รายการคำขอใหม่ / New Request",
|
||||
detail: "รหัส / code : " + res.requestData.map((v) => v.code).join(", "),
|
||||
registeredBranchId: res.registeredBranchId,
|
||||
groupReceiver: { create: { name: "document_checker" } },
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return payment;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue