Skip to content

fix: review nationality step immediately instead of waiting for cron#3226

Merged
TaprootFreak merged 4 commits intodevelopfrom
fix/instant-nationality-review
Mar 5, 2026
Merged

fix: review nationality step immediately instead of waiting for cron#3226
TaprootFreak merged 4 commits intodevelopfrom
fix/instant-nationality-review

Conversation

@TaprootFreak
Copy link
Copy Markdown
Collaborator

@TaprootFreak TaprootFreak commented Feb 20, 2026

Summary

  • Adds a dedicated updateNationalityStep() method that performs the nationality review inline when the user submits their data
  • Eliminates the up-to-1-minute wait for the reviewNationalityStep cron job to process the step
  • Extracts shared review logic into a private reviewNationalityData() helper method, used by both the inline review and the cron job — no code duplication
  • Removes dead nationality branch from generic updateKycStep() (no longer reachable)
  • The cron job remains as a fallback for edge cases (e.g. residence permit countries like RU)

Test plan

  • Submit nationality data during onboarding and verify the step is immediately completed (not stuck on "InReview")
  • Verify blocked/merged users still get the correct ignored/manualReview status
  • Verify disallowed nationalities still go to manualReview
  • Verify RU nationality still stays on INTERNAL_REVIEW (requires residence permit)
  • Verify existing cron job still works as fallback

The nationality review check is trivial (blocked/merged user, allowed nationality)
and can be performed inline when the user submits their data, eliminating
the up-to-1-minute wait for the cron job to process the step.
Eliminate code duplication between updateNationalityStep (inline review)
and reviewNationalityStep (cron job) by extracting the review logic
into a single private helper method.
The nationality path is now handled by the dedicated updateNationalityStep
method, so the if (data.nationality) branch in updateKycStep is unreachable.
@TaprootFreak TaprootFreak marked this pull request as ready for review February 20, 2026 11:08
Comment thread src/subdomains/generic/kyc/services/kyc.service.ts Outdated
Address review feedback: instead of first saving with INTERNAL_REVIEW
and then immediately changing the status, determine the final status
inline and save data + status in one DB write. This eliminates the
unnecessary intermediate INTERNAL_REVIEW state and reduces DB writes
and step logs from 2 to 1 for non-residence-permit countries.
@TaprootFreak TaprootFreak merged commit c2f6607 into develop Mar 5, 2026
8 checks passed
@TaprootFreak TaprootFreak deleted the fix/instant-nationality-review branch March 5, 2026 16:02
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.

3 participants