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.firstName

Deleted User

userProfile.lastName

This key will be unset (deleted)

userProfile.dob

This key will be unset (deleted)

userProfile.email

This key will be unset (deleted)

userProfile.maskedEmail

This key will be unset (deleted)

userProfile.recoveryEmail

This key will be unset (deleted)

userProfile.prevUsedEmail

This key will be unset (deleted)

userProfile.encEmail

This key will be unset (deleted)

userProfile.phone

This key will be unset (deleted)

userProfile.maskedPhone

This key will be unset (deleted)

userProfile.recoveryPhone

This key will be unset (deleted)

userProfile.prevUsedPhone

This key will be unset (deleted)

userProfile.encPhone

This 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.

KeyValue

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.firstName

Deleted User

observationInformation.userProfile.firstName

Deleted User

userProfile.lastName

This key will be unset (deleted)

userProfile.dob

This key will be unset (deleted)

userProfile.email

This key will be unset (deleted)

userProfile.maskedEmail

This key will be unset (deleted)

userProfile.recoveryEmail

This key will be unset (deleted)

userProfile.prevUsedEmail

This key will be unset (deleted)

userProfile.encEmail

This key will be unset (deleted)

userProfile.phone

This key will be unset (deleted)

userProfile.maskedPhone

This key will be unset (deleted)

userProfile.recoveryPhone

This key will be unset (deleted)

userProfile.prevUsedPhone

This key will be unset (deleted)

userProfile.encPhone

This key will be unset (deleted)

observationInformation.userProfile.lastName

This key will be unset (deleted)

observationInformation.userProfile.dob

This key will be unset (deleted)

observationInformation.userProfile.email

This key will be unset (deleted)

observationInformation.userProfile.maskedEmail

This key will be unset (deleted)

observationInformation.userProfile.recoveryEmail

This key will be unset (deleted)

observationInformation.userProfile.prevUsedEmail

This key will be unset (deleted)

observationInformation.userProfile.encEmail

This key will be unset (deleted)

observationInformation.userProfile.phone

This key will be unset (deleted)

observationInformation.userProfile.maskedPhone

This key will be unset (deleted)

observationInformation.userProfile.recoveryPhone

This key will be unset (deleted)

observationInformation.userProfile.prevUsedPhone

This key will be unset (deleted)

observationInformation.userProfile.encPhone

This key will be unset (deleted)

Last updated