Welcome, new Bangazonians!
Your job is to build out a .NET Web API that makes each resource in the Bangazon ERD available to application developers throughout the entire company.
- Products
- Product types
- Customers
- Orders
- Payment types
- Employees
- Computers
- Training programs
- Departments
Pro tip: You do not need to make a Controller for the join tables, because those aren't resources.
Your product owner will provide you with a prioritized backlog of features for you to work on over the development sprint. The first version of the API will be completely open since we have not determined which authentication method we want to use yet.
The only restriction on the API is that only requests from the www.bangazon.com
domain should be allowed. Requests from that domain should be able to access every resource, and perform any operation a resource.
First, you need to plan. Your team needs to use the official SQL script (see below) and build a Bangazon ERD using dbdiagram.io. Once your team agrees that the ERD is complete, you must get it approved by your manager before you begin writing code for the API.
Next, you need to author the Models needed for your API. Make sure that each model has the approprate foreign key relationship defined on it, either with a custom type or an List<T>
to store many related things. The boilerplate code shows you one example - the relationship between Order
and OrderProduct
, which is 1 -> ∞. For every OrderId, it can be stored in the OrderProduct
table many times.
You will be using the Official Bangazon SQL file to create your database. Create the database using SSMS, create a new SQL script for that database, copy the contents of the SQL file into your script, and then execute it.
Now it's time to build the controllers that handle GET, POST, PUT, and DELETE operations on each resource. Make sure you read, and understand, the requirements in the issue tickets to you can use SQL to return the correct data structure to client requests.
Each feature ticket your team will work on for this sprint has testing requirements. This boilerplate solution has a testing project includes with some starter code. You must make sure that all tests pass before you submit a PR. Run the script found here to create a test database. Your tests will be run against this database so that your normal database is not altered by running your tests. Get together with your team and add some test data to this database. This should be done by adding INSERT
statements to the bottom of the ./bangazontest.sql
file.