Saving Course batch details inside user
Problem statement:
In course batch stats , we need to do different data sorting and that can be achieve if all data save same place. That's why user course batch some data we are storing inside user index.
Ticket ref: SB-10240
Changes required for SB-10240
Inside user index we need to save following new attribute:
New attribute added in User ES
"rootOrgName": "name of rootOrg", // new added "organisations" : [ { "userId":"", "organisationId":"", "orgName":"" // new added } ], "batches":[ { "enrolledOn": "", "batchId": "", "courseId": "", "lastAccessedOn": "", "progress": "" } ] Note: all values will be added on ES only, Cassandra storage won't change.
Following point need to be taken care:
- Sync all the user, and during sync we need to add above fields into Elasticsearch (One time job on each Env)
- Whenever user is added or removed from batch, we need to call sync.
- Sync batch info to user profile whenever enroll or unenroll api calls happen
- Sync batch info to user profile whenever update content state api calls
- Sync batch info to user profile whenever create batch api calls , with participants list
- Sync batch info to user profile whenever update batch comes with participants list
- Update org api