Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMendozaPrado committed Jun 14, 2024
2 parents b451e3f + 9b8df70 commit d0c2be6
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions services/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
sprintSurveyAnswerProject,
rulerSurveyAnswers,
rulerEmotion,
sprintSurveyQuestion,
} from "@/db/schema";
import { and, asc, eq, inArray, ne, or } from "drizzle-orm";
import { SQSClient, SendMessageBatchCommand } from "@aws-sdk/client-sqs";
Expand Down Expand Up @@ -97,11 +98,23 @@ export async function createProject({
);
};

const sprintSurveyQuestionsIds: number[] = [30, 31, 32, 33, 34, 41];

jumpToNextSprint();
while (currentDate <= newProject.endDate) {
await db
const [insertedSurvey] = await db
.insert(sprintSurvey)
.values({ projectId, scheduledAt: currentDate });
.values({ projectId, scheduledAt: currentDate })
.returning({ id: sprintSurvey.id });

// insertedSurvey.id

await db.insert(sprintSurveyQuestion).values(
sprintSurveyQuestionsIds.map((questionId) => ({
sprintSurveyId: insertedSurvey.id,
questionId: questionId,
})),
);

jumpToNextSprint();
}
Expand Down

0 comments on commit d0c2be6

Please sign in to comment.