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

Update scam detection #1079

Merged
merged 5 commits into from
Sep 26, 2024
Merged

Conversation

danielailie
Copy link
Collaborator

@danielailie danielailie commented Sep 19, 2024

  • add endpoint for admin to trigger scam update for certain collection
  • add rabbit queue where an event will be posted after the endpoint gets call
  • add consumer that will mark or clear the scam based on the input

@danielailie danielailie changed the title Update scam algorithm Update scam detection Sep 19, 2024
@@ -157,4 +160,11 @@ export class AdminOperationsResolver {
});
return true;
}

@Mutation(() => Boolean)
@UseGuards(JwtOrNativeAuthGuard, GqlAdminAuthGuard)

Choose a reason for hiding this comment

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

👍

}

export enum ScamInputEnum {
deny = 'deny',

Choose a reason for hiding this comment

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

Maybe use PascalCase for enums (if applicable)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to keep them like this here because of mongo

async consumeScamEvents(event: MarkScamCollectionEvent) {
if (event.type === ScamInputEnum.allow) {
await this.collectionScamService.manuallyClearCollectionScamInfo(event.collectionIdentifier)
} else {

Choose a reason for hiding this comment

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

Could have also been "else if" for "deny", and throw error (unrecognized) on "else".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would like to let it like this because are only two possibilities and in the future if we add another one then update the condition 🙏

@danielailie danielailie merged commit d0e8ae4 into development Sep 26, 2024
1 check failed
@danielailie danielailie deleted the TOOL-246-update-scam-algorithm branch September 26, 2024 10:16
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