E-commerce API Assessment#20
Open
Olanrewajuemmanuel wants to merge 19 commits intoLibertytechX:mainfrom
Open
Conversation
Mismatch between django and rest_framework compatible versions resolved
Useful flag for setting permissions for HTTP write actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Premise
As required for the assessment, an e-commerce API is to be extended and developed using Django and DRF.
Changes
Product and Category Models: Added models for Product and Category with appropriate fields and relationships.
Order Model: Added an Order model with a many-to-many relationship to Product using an intermediary OrderProduct model.
User Authentication: Integrated JWT authentication using Django REST Framework to handle user registration and login.
Permissions: Restricted product creation and modifications to authenticated users or admin.
Order Placement: Allowed authenticated users to place orders and automatically assigned the logged-in user to the created order.
Order History: Provided an endpoint for users to retrieve their order history.
HATEOAS: Implemented HATEOAS for navigable API responses.
Breaking changes
Django package and rest framework were updated to later versions [This may cause incompatibility with previous versions of the codebase]
Tests
Model tests and View tests were carried out to ensure the expected functionality of the API. The framework itself supported all tests, the default rest framework APIs and faker. Tests were carried out to ensure good test and code coverage.
Postman Collection Link
https://restless-shuttle-307210.postman.co/workspace/Liberty-Assured-Ltd-Assessment~94d4d1eb-2613-4e65-8971-7c79602aafb4/collection/17367262-5e442dc6-495d-4ecd-b9e6-20b080f9a029?action=share&creator=17367262&active-environment=17367262-28bd0df6-2546-456e-94c5-9fcdb52fb045