-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable updating nin #716
Enable updating nin #716
Conversation
if reference nin is the same as locked nin let verification through and replace the locked nin with the new verified nin
attributes = { | ||
"$set": { | ||
"identities": [{"identity_type": IdentityType.NIN.value, "number": "200102031234", "verified": True}] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nins have previously been replaced
"identities": [ | ||
{"identity_type": IdentityType.NIN.value, "number": locked_nin.number, "verified": True} | ||
], # hubba-bubba |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nins have previously been replaced
new_attributes = check_locked_identity(self.amdb, user_id, attributes, "test") | ||
|
||
# check_locked_identity should create a locked_identity so add it to the expected attributes | ||
locked_nin = NinIdentity(number="200102031234", created_by="test", is_verified=True) | ||
locked_identities = LockedIdentityList(elements=[locked_nin]) | ||
attributes["$set"]["locked_identity"] = locked_identities.to_list_of_dicts() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check_locked_attributes used to modify (and return) attributes, i.e. the same entity, so even if it did not add locked_identity the test was always true as attributes and new_attributes were the same dict
new_attributes = check_locked_identity(self.amdb, user_id, attributes, "test") | ||
|
||
locked_identities = LockedIdentityList(elements=[locked_nin]) | ||
attributes["$set"]["locked_identity"] = locked_identities.to_list_of_dicts() | ||
|
||
# user has locked_identity that is the same as the verified identity so only identities should be set | ||
self.assertDictEqual(attributes, new_attributes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same comment as for test above
Quality Gate failedFailed conditions |
Enable updating NIN and locked NIN if the new NIN has a reference to the currently locked NIN
Use case is changing of national identity number or groinf from coordination number to national identoty number