IEEE-VIT / enigma7-backend

Code repository for the backend of Enigma 7.0
https://enigma-api.ieeevit.org
MIT License
3 stars 0 forks source link

Return the remaining time till XP increases for a user. #26

Closed aryan9600 closed 4 years ago

aryan9600 commented 4 years ago

Is your feature request related to a problem? Please describe. The frontend would like to receive the time remaining till the user's XP increases by 10 (as a result of the hourly generation feature), along with the user details

Describe the solution you'd like Store the timestamp of the first attempt as a DateTimeField in the User table. Calculate the time remaining till the XP is increased and return it in the user response. One way of doing this would be using a SerializerMethodField in the UserStatusSerializer and including that field in the fields attribute of that serializer.