Versions Compared

Key

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

...

     We need to construct a new API for the same. This API needs the user to provide valid userid, batchid and courseid to un-enroll them. In this proposed solution, we will add a new column namely 'isunenrollmentallowed' (boolean) in the  table sunbird.course_batch to indicate if unenrollment from a given batch is allowed or not.


ProsCons
  • Name and value of the column is self-explanatory and readable.
  • Can use the value in a code directly. No need for extra processing.
  • As the batch related permissions become more granular in future, we must need to add new columns.

Proposed Solution 2:

     In this proposed solution, we can add a new column called 'permissions' (bitmap) for different permissions applicable on the batch for any course. Based on that permission, we can decide to unenroll the particular user from that batch.


ProsCons
  • The permissions field can be used to incorporate any new attribute added in the future.
  • Need extra efforts to process the value retrieved from database. We need to iterate through each bit.

Batch Unenroll API:

...

        Method: POST

        URL: /v1/user/courses/unenroll

...

        Headers: Authorization, X-Authenticated-User-Token

    Request Body:          


Code Block
{ "params": { },

...

 
  

...

"request": { 
		

...

“userid” : 

...

“string”, 

...


		“batchid” : 

...

“string”, 
		

...

“courseid”:

...

 

...

”string” 
	} 
}


  






                         }