Skip to content

Conversation

@vas3a
Copy link
Collaborator

@vas3a vas3a commented Dec 3, 2025

No description provided.

@vas3a vas3a merged commit f86bd98 into dev Dec 3, 2025
7 checks passed
@vas3a vas3a deleted the PS-469_payment-reconciliation branch December 3, 2025 19:29
}[] = [];

if (userIds.length > 0) {
const ids = uniq(userIds);
Copy link

Choose a reason for hiding this comment

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

[⚠️ correctness]
The use of uniq to filter userIds is a good practice to avoid redundant database queries. However, ensure that uniq is imported from a reliable library like lodash to prevent potential runtime errors.

>`
>`
WITH u(user_id) AS (
VALUES ${Prisma.join(ids.map((id) => Prisma.sql`(${id})`))}
Copy link

Choose a reason for hiding this comment

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

[❗❗ security]
Using Prisma.sql to safely interpolate values into the SQL query is a good practice for preventing SQL injection. However, ensure that ids is properly sanitized and validated before this step.

LEFT JOIN user_tax_form_associations utx ON upm.user_id = utx.user_id AND utx.tax_form_status = 'ACTIVE'
LEFT JOIN user_identity_verification_associations uiv ON upm.user_id = uiv.user_id
WHERE upm.user_id IN (${Prisma.join(uniq(userIds))})
FROM u
Copy link

Choose a reason for hiding this comment

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

[❗❗ correctness]
The alias u for the table is not defined in the FROM clause. Ensure that u is a valid alias for a table or subquery. This could lead to a runtime error if u is not properly defined.

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.

2 participants