Overview :
There are multiple user accounts created by states that have never been used/ been inactive for extended periods for time. As states move to officially onboard users (SSO, self sign up etc.), there is a need to clean up these legacy accounts.This will require a 'hard delete' so as to free up mobile numbers/ email IDs associated with them, if any.Active accounts for a state will be retained post validation with the state: Users who have created or created content, corse mentors, batch creators etc. will be retained in the system. SB-10454 and SB-10455
Problem statement :
Since user details are spread across different systems and we need to remove it from all places. and same applicable for org as well.
Solution 1:
Sunbird can expose an API to do user hard delete. Api structure will be as follow:
Method : DELETE URL: v1/data/delete Request body : { "request": { "objectIds" : [], "objectType" : "" } } Response body: { "id": "api.data.delete", "ver": "v1", "ts": "2019-02-06 05:21:18:948+0000", "responseCode": "OK", "result": { "response": { } } }
Since this api will do all operations in background, it will do initial request validation and all other validation will be handle in background.
Pros | Cons |
---|---|
Api will have more control on consumer | |
Easy to generate Audit logs | |
Easy for consumer to invoke | |
Solution 2 :
Write an ETL job to preform same operations. ETL job will do following operations:
User | Organisation |
---|---|
|
|
Pros | Cons |
---|---|
Standalone job to perform this operation. | Difficult to control caller , Ex: caller is not identified by sunbird |
Can't reuse it for later use case: Example: Org admin want's to delete some user or delete some of the org |
Solution 3 :
Provide sequence of CQL queries and curl command to do all above operations.