-
Notifications
You must be signed in to change notification settings - Fork 144
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
chore!: refactoring quiz for it to be time based #3732
Conversation
86d9828
to
8b22994
Compare
).authorize(undefined) | ||
expect(validator).toBeInstanceOf(ExpectedPhoneMetadataMissingError) | ||
}) | ||
|
||
it("returns error with voip type", () => { | ||
const validator = PhoneMetadataAuthorizer( | ||
getPhoneMetadataRewardsSettings(), | ||
getPhoneMetadataQuizzesSettings(), |
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.
quizzes or quiz?
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.
it depend of the context on whether it's singular or plural
} | ||
} | ||
|
||
return { |
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.
please add tracing wrapper (at least for add)
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.
isn't the tracing already provided by mongodb tracing module? we are not doing this for the other module in this mongoose folder
@@ -7,7 +7,7 @@ export class PhoneCarrierTypeNotAllowedError extends UnauthorizedPhoneError {} | |||
export class PhoneCountryNotAllowedError extends UnauthorizedPhoneError {} | |||
|
|||
export class InvalidPhoneForOnboardingError extends UnauthorizedPhoneError {} | |||
export class InvalidPhoneForRewardError extends UnauthorizedPhoneError {} | |||
export class InvalidPhoneForQuizError extends UnauthorizedPhoneError {} |
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.
please be consistent Quiz or Quizzes (I prefer quiz but it is up to you)
key: RateLimitPrefix.addEarnAttemptPerIp, | ||
limits: getAddEarnPerIpLimits(), | ||
error: UserAddEarnAttemptIpRateLimiterExceededError, | ||
addQuizAttemptPerIp: { |
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.
same here, quiz or quizzes?
core/api/src/config/index.ts
Outdated
@@ -13,6 +13,7 @@ export * from "./schema" | |||
import { ConfigError } from "./error" | |||
|
|||
import { toDays } from "@/domain/primitives" | |||
import { QuizzesValue } from "@/app/quiz/config" |
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.
🤔 shouldn't thits be part of config and not from app layer? it is creating a circular dependency
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.
not sure, but I've also been thinking about that. I think this is the config of the quizzes, so we may argue this could be fine? I also try to make the quiz module for self contain.
088a83c
to
9848e3b
Compare
639abc3
to
667b2ea
Compare
667b2ea
to
5c987e3
Compare
-- will make it easier to parse later once and have rules based on time
-- will make it easier to extract to an independent pod if we choose to in the future