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.
[❗❗ 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.
[❗❗ 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.
[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.
[❗❗ 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.
[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.