Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

...

Code Block
{
  "eid": "BE_JOB_REQUEST",
  "ets": 1619527882745,
  "mid": "LP.1619527882745.32dc378a-430f-49f6-83b5-bd73b767ad36",
  "actor": {
    "id": "delete-user",
    "type": "System"
  },
  "context": {
    "channel": "01309282781705830427",
    "pdata": {
      "id": "org.sunbird.platform",
      "ver": "1.0"
    },
    "env": "dev"
  },
  "object": {
    "id": "<deleted-userId>",
    "type": "DeleteUserUser"
  },
  "edata": {
    "organisationId": "<organisationId>"
    "userId": "<userId>",
    "action": "delete-user<deleted-userId>",
    "iteration": 1
  }
}

Transfer Ownership

Ownership transfer API

...

  • This API will trigger the kafka event to transfer-ownership flink job, to precess the things asynchronously. This API will validate if “toUserId“ has all the roles of from user.

Request

Code Block
curl --location --request POST '{{host}}/api/user/v1/ownership/transfer' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{api_key}}' \
--header 'x-authenticated-user-token: {{user_token}}' \
--data-raw '{
    "request":{
suggested_users": [
     "organisationId": "{{organisationId}}",	{
      		"toUserIdrole": "{{TO_UUID}}ORG_ADMIN",
      		"fromUserIdusers": "{{FROM_UUID}}"[]
    }
}'

Response:

Code Block
languagejson
{
    "id": "api.user.ownership.transfer"	},
    "ver": "1.0",
    "ts": "2023-08-28T13:54:45Z+05:30",
    "params": 	{
        "resmsgid": "a638c46e-63a5-47de-bf00-029cbe435e5e",
        "msgid": null,
        "err": null,
        "status": "successful",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
        "status": "Ownership transfer event is pushed successfully!"
    }
}

Flink Job

Transfer ownership:

Sample kafka event

Code Block
{
  "eid": "BE_JOB_REQUEST",
  "ets": 1619527882745,
  "mid": "LP.1619527882745.32dc378a-430f-49f6-83b5-bd73b767ad36",
  "actor": {
    "id": "ownership-transfer",
    "type": "System"
  },
  "context": {
    "channel": "01309282781705830427",
    "pdata": 		"role": "CONTENT_CREATOR",
    		"users": []
    	},
    	{
      		"idrole": "org.sunbird.platform",
      "ver": "1.0"
    },
    "env": "dev"
  },
  "object": {
    "id": "do_11329603741667328018COURSE_MENTOR",
    		"typeusers": "OwnershipTransfer"
[]
 },   "edata": {
    "organisationId": "{{organisationId}}",	}
    "toUserId": "{{TO_UUID}}"],
    "fromUserId": "{{FROM_UUID}}"
    "action": "ownershipdelete-transferuser",
    "iteration": 1
  }
}

...

Batch

  • Fetch the list of open and ongoing batches created by fromUserId from sunbird_courses.course_batch table.

  • Update the user entry in sunbird_courses.course_batch table for open and ongoing batches only.

    • createdby

  • If the user is added as a course mentors to any batch, than use the search API to find out the batches and than remove the userId from mentors column in sunbird_courses.course_batch table.

...

Manage Learn -

As part of the Manage Learn use case, the user’s PII data is captured and/or used in the below-mentioned workflows -

  1. A complete snapshot of a user’s profile which includes name (first and last name) as well as masked email and phone is captured under various collections in MongoDB (observations, projects, survey, and programUsers) at the start of any transaction i.e. the moment a user starts working on a survey, or project or decides to join a program. This is done to give the Program manager the details of the user as it was when he/she started working on the resource and is not affected by his/her profile change later. This means a user’s name, location, role, and sub roles which is later used for certificate generation using Sunbird RC is the same when he/she started the resource.

  2. When the Program Manager requests reports via the Program Dashboard about the details of each and every user who has worked on a resource or has joined the program, the user’s email and phone along with the name is provided via a CSV using the Lern Data Product. These details are fetched in real-time at the moment of generating the on-demand report from the common and shared Redis and Cassandra storage. No change is required here since the expectation is user’s name, email phone will be deleted from the common storage and replaced with the “Deleted User” string, We will just need to test this once to confirm the entry from the reports is not removed but just the PII data is removed.

Info

Note - No other place in Logs, Druid, ES or Neo4j does Manage Learn workflow write to

...