Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC Autochecker Fail for past sem #886

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

JasonMun7
Copy link
Contributor

@JasonMun7 JasonMun7 commented Mar 12, 2025

Summary

This PR implements the Autochecker to fail for coffee chats you've chatted with last semester

  • Added the check within coffeeChatAPI.ts
  • Added in more tests CoffeeChatAPI.test.ts for the autochecker which passed
  • Removed unecessary typings in CoffeeChatAPI.test.ts and CoffeeChatDao.test.ts since they're already strongly typed

Notion/Figma Link

Testing

  • Ran using Jest

Notes

  • I currently check to see if there is any archived coffee chats with the same members
  • Should I check purely off the Sem? @cchrischen

@JasonMun7 JasonMun7 requested a review from a team as a code owner March 12, 2025 02:52
@JasonMun7 JasonMun7 requested a review from cchrischen March 12, 2025 02:53
@dti-github-bot
Copy link
Member

[diff-counting] Significant lines: 78.

Copy link
Collaborator

@cchrischen cchrischen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! Thanks Jason for the comprehensive test suite. Could you also add functionality in the function checkMemberMeetsCategory? Right now, we only autocheck the two categories that we can check from IDOL information. The other 14 would have to be checked through querying the coffee chat suggestions collection.

@@ -193,6 +193,20 @@ export const runAutoChecker = async (uuid: string, user: IdolMember): Promise<Co
throw new BadRequestError(`Coffee chat with uuid: ${uuid} does not exist`);
}

const archivedChats = await coffeeChatDao.getCoffeeChatsByUser(
coffeeChat.submitter.email,
undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably also want to only check accepted archive chats, so I think we should pass in approved here.

Comment on lines +204 to +208
if (hasArchivedChat) {
throw new BadRequestError(
`Coffee chat with uuid: ${uuid} has an archived chat with the same submitter and other member`
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a chat from the previous semester, we should update the coffee chat to have memberMeetsCategory be fail and an appropriate errorMessage isntead of throwing an error. The purpose of this function is to (potentially) update these two fields for autochecking. See the code below for more reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants