Update the following deleteQuestionnaire async deleteQuestionnaire(req: Request, res: Response, next: NextFunction) {
    try {
      const questionnaireId = parseInt(req.params.questionnaireId);
      const [questionnaire, childQuestionnaires, parentQuestionnaire] =
        await Promise.all([
          prisma.questionnaire.findUnique({
            where: { id: questionnaireId },
            select: {
              id: true,
              questionnaireItems: { select: { itemCode: true } },
              isDraft: true,
              approved: false,
            },
          }),
          prisma.questionnaire.findMany({
            where: { parentQuestionnaireId: questionnaireId },
            select: {
              id: true,
              questionnaireItems: { select: { itemCode: true } },
              isDraft: true,
              approved: false,
            },
          }),
          prisma.questionnaire.findFirst({
            where: { childQuestionnaires: { some: { id: questionnaireId } } },
            select: {
              id: true,
              questionnaireItems: { select: { itemCode: true } },
              isDraft: true,
              approved: false,
            },
          }),
        ]);
      if (!questionnaire) {
        return res
          .status(httpStatusCodes.NOT_FOUND)
          .json(
            new ResponseJSON(
              'Questionnaire not found',
              true,
              httpStatusCodes.NOT_FOUND
            )
          );
      }
      const result = await prisma.$transaction(async (tx) => {
        await tx.questionnaireItem.deleteMany({
          where: {
            itemCode: {
              in: questionnaire.questionnaireItems.map((el) => el.itemCode),
            },
            questionnaireId: questionnaire.id,
          },
        });
        if (parentQuestionnaire) {
          await tx.questionnaireItem.deleteMany({
            where: {
              itemCode: {
                in: parentQuestionnaire.questionnaireItems.map(
                  (el) => el.itemCode
                ),
              },
              questionnaireId: parentQuestionnaire.id,
            },
          });
        }
        await Promise.all(
          childQuestionnaires.map((questionnaire) =>
            tx.questionnaireItem.deleteMany({
              where: {
                itemCode: {
                  in: questionnaire.questionnaireItems.map((el) => el.itemCode),
                },
                questionnaireId: questionnaire.id,
              },
            })
          )
        );
        return await tx.questionnaire.deleteMany({
          where: {
            id: {
              in: (() => {
                const ids: number[] = [questionnaire.id];
                if (parentQuestionnaire) ids.push(parentQuestionnaire.id);
                childQuestionnaires.forEach((qu) => ids.push(qu.id));
                return ids;
              })(),
            },
          },
        });
      });
      return res
        .status(httpStatusCodes.OK)
        .json(new ResponseJSON('Success', false, httpStatusCodes.OK, result));
    } catch (error) {
      console.log('error--- ', error);
      next(
        apiErrorHandler(
          error,
          req,
          errorMessages.INTERNAL_SERVER,
          httpStatusCodes.INTERNAL_SERVER
        )
      );
    }
  } so that it can only delete questionnaires with the status isDraft: true, approved: false. Show with steps