Application is about people solving problems and getting rated. You have to implement API operations as defined in the code provided. Please add the lines of code only in the designated code block as indicated using comments in each of the files. Any code added outside the designated lines may not work as it is intended to, for us.
DATA MODEL :-
All data to be stored in Mongo collections :-
- “users” - models/[login to view URL]
- “problems” - models/[login to view URL]
All relevant models are in models/
All operations are in operations/
Ignore hubs/ and other folders. Ignore all [login to view URL] files.
**Bonus if you are able to figure out and write proper test cases. But it’s not mandatory **
OPERATIONS TO IMPLEMENT:
1. Register ([login to view URL]):
This operation will take input username and password, creates a new user, and returns a logged in user. It will also generate a JWT token with user_id and user_name, which will be saved in the header with key “jwt”. The sugar for encryption is passed as argument.
2. Login ([login to view URL]):
This operation will take input username and password, checks credentials, and logs in the user by setting the JWT token with user_id and user_name. Similar to register operation.
3. Me ([login to view URL]):
This operation will return current logged in User. Logged-in user_id is already being fetched from the token. Refer to validation.go.
4. Update Profile ([login to view URL]):
Update user with following fields. All are optional, if not supplied or empty don’t update it. (Name/Email/Phone/password). On Success return “AukaatResponse” with appropriate status.
5. Add Problem ([login to view URL]):
Add the given problem to DB. Return “AukaatResponse” appropriately.
6. List Problems ([login to view URL]):
List Problems returns all the problems in the DB
7. Edit Problem ([login to view URL]):
Edit the given problem(ID). Return “AukaatResponse” appropriately.
8. Get Problem ([login to view URL])
Return the problem as specified by the ID.
1. Depending on tasks, you might only get paid on meeting complete requirements. Please verify that you understand requirements clearly before starting out.
2. Our team of senior developers will review the code, and this may take up to a week. The money will be released once the code has been approved by them. We may suggest changes to the code, and/or review the contract in extreme cases.
3. Prefer to work with individual freelancers.