Skip to content

Latest commit

 

History

History
79 lines (58 loc) · 5.86 KB

File metadata and controls

79 lines (58 loc) · 5.86 KB

Data Model

Sample Kafka Event

{
  "eid": "BE_JOB_REQUEST",
  "ets": 1669196680963,
  "mid": "LP.1669196680963.0e6ac196-e57d-40bb-ab39-f5ec479da3e6",
  "actor": {
    "id": "Sunbird Flink Job",
    "type": "System"
  },
  "context": {
    "pdata": {
      "ver": "1.0",
      "id": "org.sunbird.platform"
    },
    "channel": "01309282781705830427",
    "env": "sunbirdstaging"
  },
  "object": {
    "ver": "1669196652993",
    "id": "02c4e0dc-3e25-4f7d-b811-242c73e24a01"
  },
  "edata": {
    "action": "delete-user",
    "iteration": 1,
    "userId": "5deed393-6e04-449a-b98d-7f0fbf88f22e",
    "organisationId": "01309282781705830427"
  }
}

Mongo DB Update Logic

The following collections from the database ml-service will be updated in order to fully remove user PII data from mongoDB.

  • observations
  • surveySubmissions
  • observationSubmissions
  • projects
  • programUsers
  • solutions

Observations

The following table fields from the observation collection will be updated when createdBy key in observation collection is equal to the Kafka event userId.

surveySubmissions

The following table fields from the surveySubmissions collection will be updated when createdBy key in surveySubmissions collection is equal to the Kafka event userId.

projects

The following table fields from the projects collection will be updated when userId key in projects collection is equal to the Kafka event userId.

programUsers

The following table fields from the programUsers collection will be updated when userId key in programUsers collection is equal to the Kafka event userId.

Table fields

KeyValue
userProfile.firstNameDeleted User
userProfile.lastNameThis key will be unset (deleted)
userProfile.dobThis key will be unset (deleted)
userProfile.emailThis key will be unset (deleted)
userProfile.maskedEmailThis key will be unset (deleted)
userProfile.recoveryEmailThis key will be unset (deleted)
userProfile.prevUsedEmailThis key will be unset (deleted)
userProfile.encEmailThis key will be unset (deleted)
userProfile.phoneThis key will be unset (deleted)
userProfile.maskedPhoneThis key will be unset (deleted)
userProfile.recoveryPhoneThis key will be unset (deleted)
userProfile.prevUsedPhoneThis key will be unset (deleted)
userProfile.encPhoneThis key will be unset (deleted)

solutions

The following fields from the solutions collection will be updated when author key in solutions collection is equal to the Kafka event userId.

Key Value
creator Deleted User
license.author Deleted User
license.creator Deleted User

observationSubmissions

The following fields from the observationSubmissions collection will be updated when createdBy key in observation collection is equal to the Kafka event userId.

KeyValue
userProfile.firstNameDeleted User
observationInformation.userProfile.firstNameDeleted User
userProfile.lastNameThis key will be unset (deleted)
userProfile.dobThis key will be unset (deleted)
userProfile.emailThis key will be unset (deleted)
userProfile.maskedEmailThis key will be unset (deleted)
userProfile.recoveryEmailThis key will be unset (deleted)
userProfile.prevUsedEmailThis key will be unset (deleted)
userProfile.encEmailThis key will be unset (deleted)
userProfile.phoneThis key will be unset (deleted)
userProfile.maskedPhoneThis key will be unset (deleted)
userProfile.recoveryPhoneThis key will be unset (deleted)
userProfile.prevUsedPhoneThis key will be unset (deleted)
userProfile.encPhoneThis key will be unset (deleted)
observationInformation.userProfile.lastNameThis key will be unset (deleted)
observationInformation.userProfile.dobThis key will be unset (deleted)
observationInformation.userProfile.emailThis key will be unset (deleted)
observationInformation.userProfile.maskedEmailThis key will be unset (deleted)
observationInformation.userProfile.recoveryEmailThis key will be unset (deleted)
observationInformation.userProfile.prevUsedEmailThis key will be unset (deleted)
observationInformation.userProfile.encEmailThis key will be unset (deleted)
observationInformation.userProfile.phoneThis key will be unset (deleted)
observationInformation.userProfile.maskedPhoneThis key will be unset (deleted)
observationInformation.userProfile.recoveryPhoneThis key will be unset (deleted)
observationInformation.userProfile.prevUsedPhoneThis key will be unset (deleted)
observationInformation.userProfile.encPhoneThis key will be unset (deleted)