Skip to content

Commit

Permalink
Merge pull request #219 from wizelineacademy/sqs-integration-with-lalo
Browse files Browse the repository at this point in the history
implements rulersurvey sqs for lalo
  • Loading branch information
pedroalonsoms authored Jun 13, 2024
2 parents 156cd9e + 709c994 commit 930a802
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions handlers/subscriber.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import db from "@/db/drizzle";
import { finalSurvey, sprintSurvey } from "@/db/schema";
import { feedbackAnalysis, projectAnalysis } from "@/services/rag";
import {
feedbackAnalysis,
projectAnalysis,
rulerAnalysis,
} from "@/services/rag";
import { DeleteMessageCommand, SQSClient } from "@aws-sdk/client-sqs";
import { eq } from "drizzle-orm";
import { Resource } from "sst";
Expand All @@ -14,8 +18,7 @@ export const handler: SQSHandler = async (event) => {
switch (messageBody.type) {
case "RULER":
try {
console.log("ruler msg bdy", messageBody);
//TODO: lalo implements this
await rulerAnalysis(messageBody.id);
} catch (error) {
console.log("ERROR:", error);
}
Expand Down
3 changes: 2 additions & 1 deletion services/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ export async function getUpdateFeedbackHistory({
}

export interface SQSMessageBody {
id: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
id: any;
type: "RULER" | "SPRINT" | "FINAL";
}

Expand Down
2 changes: 1 addition & 1 deletion services/rulerSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function submitRulerSurveyAnswer(surveyAnswer: RulerSurveyAnswer) {
MessageGroupId: messageGroupId,
MessageDeduplicationId: crypto.randomUUID(),
MessageBody: JSON.stringify({
id: 1,
id: surveyAnswer.userId,
type: "RULER",
} as SQSMessageBody),
}),
Expand Down

0 comments on commit 930a802

Please sign in to comment.