 const [questionnaire, categories] = await prisma.$transaction([
        prisma.questionnaire.findFirst({
          orderBy: [{ startDate: "desc" }],
          where: {
            ...filter,
            approved: true,
            disabled: false,
            endDate: {
              // gte: addDays(new Date(), -5), //previous code
              gte: startOfDay(endOfDay(subDays(new Date(), 5))), // return questionnaires with in the last 5 days of the current date
              lte: new Date(),
            },
            startDate: {
              // gte: subDays(new Date(), -5), // fetch records that are within 5 days range from current date
              lte: new Date(),
            },
            isDraft: false,
          },
          include: {
            questionnaireItems: {
              where: {
                disabled: false,
              },
              include: {
                item: {
                  include: {
                    translation: true,
                    itemMeasurements: true,
                  },
                },
              },
            },
            questionnaireRegionStatus: {
              where: { regionCode: { in: regionCodes } },
            },
          },
        }),
        prisma.division.findMany({
          where: { disabled: false },
          include: {
            group: {
              where: { disabled: false },
              include: {
                class: {
                  where: { disabled: false },
                  include: {
                    subclass: {
                      where: { disabled: false },
                      include: {
                        translation: true,
                      },
                    },
                    translation: true,
                  },
                },
                translation: true,
              },
            },
            translation: true,
          },
        }),
      ]); update the above code so that questionnaires in between startdate and enddate are fetched. And if current date is greater than enddate it means the questionnaire has expired.