diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 37d77d2..962070b 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -469,6 +469,17 @@ export class QuotationController extends Controller { }, ); + await Promise.all([ + tx.service.updateMany({ + where: { id: { in: ids.service }, status: Status.CREATED }, + data: { status: Status.ACTIVE }, + }), + tx.product.updateMany({ + where: { id: { in: ids.product }, status: Status.CREATED }, + data: { status: Status.ACTIVE }, + }), + ]); + return await tx.quotation.create({ include: { productServiceList: { @@ -718,6 +729,17 @@ export class QuotationController extends Controller { }, ); + await Promise.all([ + tx.service.updateMany({ + where: { id: { in: ids.service }, status: Status.CREATED }, + data: { status: Status.ACTIVE }, + }), + tx.product.updateMany({ + where: { id: { in: ids.product }, status: Status.CREATED }, + data: { status: Status.ACTIVE }, + }), + ]); + return await tx.quotation.update({ include: { productServiceList: {