-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
Conversation
[diff-counting] Significant lines: 78. |
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
if (hasArchivedChat) { | ||
throw new BadRequestError( | ||
`Coffee chat with uuid: ${uuid} has an archived chat with the same submitter and other member` | ||
); | ||
} |
There was a problem hiding this comment.
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.
Summary
This PR implements the Autochecker to fail for coffee chats you've chatted with last semester
coffeeChatAPI.ts
CoffeeChatAPI.test.ts
for the autochecker which passedCoffeeChatAPI.test.ts
andCoffeeChatDao.test.ts
since they're already strongly typedNotion/Figma Link
Testing
Notes