Problem
A user who registers through the RealUnit flow provides their nationality as part of POST /v1/realunit/register/complete. The backend writes it directly to UserData via updateUserDataInternal({ nationality }) and completes a REALUNIT_REGISTRATION KYC step, bumping the KYC level to 20 (realunit.service.ts, forwardRegistration — code comment: "same as NATIONALITY_DATA step").
However, NATIONALITY_DATA is listed unconditionally in requiredKycSteps(userData) (kyc.enum.ts), and no code path marks a NATIONALITY_DATA step as done when REALUNIT_REGISTRATION completes. getNext() therefore still returns NATIONALITY_DATA as an open required step.
Effect
The RealUnit app renders whatever the API reports as currentStep. After RealUnit registration the user is shown the standalone NATIONALITY_DATA step and enters their nationality a second time — over a different endpoint and in a different format ({id} object vs. the 2-letter symbol used by /register/complete).
Suggested fix
Either:
- have
REALUNIT_REGISTRATION completion also mark NATIONALITY_DATA as done, or
- exclude
NATIONALITY_DATA from requiredKycSteps when REALUNIT_REGISTRATION is done / nationality is already set on UserData.
Context
Found during a deep audit of the realunit-app country/nationality data path. Related app PR: DFXswiss/realunit-app#519.
Problem
A user who registers through the RealUnit flow provides their nationality as part of
POST /v1/realunit/register/complete. The backend writes it directly toUserDataviaupdateUserDataInternal({ nationality })and completes aREALUNIT_REGISTRATIONKYC step, bumping the KYC level to 20 (realunit.service.ts,forwardRegistration— code comment: "same as NATIONALITY_DATA step").However,
NATIONALITY_DATAis listed unconditionally inrequiredKycSteps(userData)(kyc.enum.ts), and no code path marks aNATIONALITY_DATAstep as done whenREALUNIT_REGISTRATIONcompletes.getNext()therefore still returnsNATIONALITY_DATAas an open required step.Effect
The RealUnit app renders whatever the API reports as
currentStep. After RealUnit registration the user is shown the standaloneNATIONALITY_DATAstep and enters their nationality a second time — over a different endpoint and in a different format ({id}object vs. the 2-letter symbol used by/register/complete).Suggested fix
Either:
REALUNIT_REGISTRATIONcompletion also markNATIONALITY_DATAas done, orNATIONALITY_DATAfromrequiredKycStepswhenREALUNIT_REGISTRATIONis done / nationality is already set onUserData.Context
Found during a deep audit of the realunit-app country/nationality data path. Related app PR: DFXswiss/realunit-app#519.