/
API to get user types
API to get user types
- SC-880Getting issue details... STATUS
Overview
As part of user search result enhancements, we will require user to be able to filter based on user-type.
For that, we need a way to fetch the available user-types.
Approach 1
Create a look-up table within database, and return it from there.
Pros:
- Systematic proper approach for persistence of look-up
- Additional values don't require code-changes.
Cons
- Will result in unnecessary I/O calls for pretty limited data.
- It will extend database design without much advantage.
- As such we are using Cassandra - and such table is useful if we can apply foreign key constraints at database level.
Approach 2 (Preferred)
Use hard-coded values from existing enumeration created for the purpose
Pros:
- DB storage not required
- Easy to implement.
Cons:
- Enumerated values are stored within code, so additional value requires code-change
Given the simplicity of the data, and no forseen future requirements to maintain it as a seperate entity, we propose to use Approach 2.
Approach 3
Store the user-types available in user-profile configuration.
Pros
- Flexible per installation - one can have different user-types - different display-names
Cons
- Difficult to apply business logic based on user-types.
- Difficult to maintain - if someone changes user-types list, especially remove existing value can become a problem for data-consistency.
API Definition
GET /v1/user/type/list
Response: 200 OK [ "TEACHER", "OTHER"]
, multiple selections available,
Related content
Replace usage of elasticsearch with cassandra for enrolments - Implementation Design
Replace usage of elasticsearch with cassandra for enrolments - Implementation Design
More like this
Allow users to declare their State & District via their profile
Allow users to declare their State & District via their profile
More like this
Saving Course batch details inside user
Saving Course batch details inside user
More like this
Design for getting batch status inside my enroll course.
Design for getting batch status inside my enroll course.
More like this
Design for adding org name for 'my courses'
Design for adding org name for 'my courses'
More like this