The store that had you built the API loves it so much, and it caused the store to become more successful and open up multiple locations.
We need to update our API to accommodate many locations. This means we have to add a new Model and new a relationship to our diagrams.
Objectives
Extend your API to not only track inventory, but also track how much we have at each location.
practice creating ASP.NET Web API endpoints
practice EF Core.
practice SQL Relationships
Requirements
Create a simple API that has a handful of endpoints to manage data
The API should be using Web API Controllers, Ef Core, and Postgres database
The API now has 2 models.
Explorer Mode
[ ] Create a Model for the Locations
[ ] The Locations should have at least
[ ] Id
[ ] Address
[ ] ManagerName
[ ] PhoneNumber
[ ] Add a relationship to your Item model to include a Foreign Key to the Locations table. Each location can have many items. There are now two new properties to your Existing Item model that points to the new Model you create (Location)
[ ] Add a new Locations Controller. This controller has at least 2 endpoints
[ ] A POST endpoint that allows a user to create a location
[ ] A GET endpoint that gets all locations
[ ] Update the following endpoints.
[x] Update the GET all items endpoint to need a location
[x] Update the GET endpoint for each item to need a location
[x] Update the POST endpoint that allows a user/client to add an item to the inventory to a location
[x] Update the PUT endpoint that allows a user/client to update an item for a location
[x] Update the DELETE endpoint that allows a user/client to delete an item for a location
[x] Add a new GET endpoint to get all items that are out of stock for a location. Keep you old GET endpoint for out of stock, but create a new one
[x] Update the GET endpoint that allows the user to search for an item based on SKU, and this should search all the locations.
[ ] Deploy your update to Heroku
Adventure Mode
Add A way to create an Order. Orders should have many Items and Items should have many orders.
Add endpoints to CRUD orders.
In your endpoints, only be able to add items to orders, if the item is in stock.
Add a way to associate orders to a location. Be able to View all orders per location.
Deploy your changes.
Epic Mode
Pick 1 or more of the following:
Go back and further any old assignment
Create a client console app in C# that allows a user to interact with you API
Update the inventory
The store that had you built the API loves it so much, and it caused the store to become more successful and open up multiple locations.
We need to update our API to accommodate many locations. This means we have to add a new Model and new a relationship to our diagrams.
Objectives
Requirements
Explorer Mode
[ ] Create a Model for the
Locations
[ ] The
Locations
should have at least[ ] Add a relationship to your
Item
model to include a Foreign Key to the Locations table. Each location can have many items. There are now two new properties to your ExistingItem
model that points to the new Model you create (Location
)[ ] Add a new Locations Controller. This controller has at least 2 endpoints
[ ] Update the following endpoints.
[x] Update the GET all items endpoint to need a location
[x] Update the GET endpoint for each item to need a location
[x] Update the POST endpoint that allows a user/client to add an item to the inventory to a location
[x] Update the PUT endpoint that allows a user/client to update an item for a location
[x] Update the DELETE endpoint that allows a user/client to delete an item for a location
[x] Add a new GET endpoint to get all items that are out of stock for a location. Keep you old GET endpoint for out of stock, but create a new one
[x] Update the GET endpoint that allows the user to search for an item based on SKU, and this should search all the locations.
[ ] Deploy your update to Heroku
Adventure Mode
Epic Mode
Pick 1 or more of the following: