-
Notifications
You must be signed in to change notification settings - Fork 0
Add new report for Topgear handles created #38
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
Conversation
| sso.email AS "SSO email" | ||
| FROM members.member m | ||
| JOIN identity."user" u | ||
| ON u.user_id = m."userId"::numeric(10, 0) |
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.
[❗❗ correctness]
Casting m."userId" to numeric(10, 0) may lead to unexpected behavior if m."userId" contains non-numeric characters or exceeds the precision. Consider ensuring that m."userId" is always a valid numeric value or adjust the data type accordingly.
| usl.sso_user_name, | ||
| usl.email | ||
| FROM identity.user_sso_login usl | ||
| WHERE usl.user_id = m."userId"::numeric(10, 0) |
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.
[❗❗ correctness]
Similar to line 15, casting m."userId" to numeric(10, 0) in the WHERE clause may lead to unexpected behavior. Ensure that m."userId" is always a valid numeric value or adjust the data type accordingly.
| usl.provider_id | ||
| LIMIT 1 | ||
| ) sso ON TRUE | ||
| WHERE m.email ILIKE '%@wipro.com' |
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.
[performance]
The WHERE clause filters by m.email ILIKE '%@wipro.com', which may lead to performance issues if the dataset is large and there is no index supporting this pattern match. Consider evaluating the need for an index or alternative filtering strategies.
| description: | ||
| "Filter users created after this date (defaults to current date - 90 days)", | ||
| }) | ||
| getTopgearHandles(@Query("startDate") startDate?: string) { |
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.
[❗❗ correctness]
The startDate parameter is expected to be a Date, but it is being passed as a string. Consider parsing it to a Date object before using it to ensure correct date handling.
| } | ||
|
|
||
| async getTopgearHandles(opts: { startDate?: string }) { | ||
| const startDate = parseOptionalDate(opts.startDate) ?? subDays(new Date(), 90); |
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.
[correctness]
Consider validating the opts.startDate before parsing it with parseOptionalDate. If opts.startDate is not a valid date string, parseOptionalDate might return null, leading to unexpected behavior. Adding validation can prevent potential issues with invalid input.
No description provided.