Skip to content

fix: add kycFileId > 0 filter to KYC stats queries#3391

Draft
TaprootFreak wants to merge 1 commit intodevelopfrom
fix/kyc-stats-filter
Draft

fix: add kycFileId > 0 filter to KYC stats queries#3391
TaprootFreak wants to merge 1 commit intodevelopfrom
fix/kyc-stats-filter

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • Add kycFileId > 0 filter to countByDateRange() and getMaxKycFileIdByDateRange() in user-data.service.ts
  • Without this filter, records without a KYC file (e.g. merged or inactive user_data entries with kycFileId = NULL) were included in the KYC file yearly statistics
  • This makes the stats queries consistent with getUserDatasWithKycFile(), which already filters on kycFileId > 0

Affected

  • GET /support/kycFileStats endpoint (compliance KYC stats page)
  • 4 phantom records (user_data IDs: 5083, 1671, 6536, 8354) were incorrectly counted as closures

Test plan

  • Verify KYC stats page shows correct counts after deployment
  • Compare stats with Excel audit export to confirm consistency

Stats queries (countByDateRange, getMaxKycFileIdByDateRange) did not
filter on kycFileId > 0, unlike getUserDatasWithKycFile. This caused
records without a KYC file to be counted in the yearly statistics.
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.

1 participant