Skip to content

Commit

Permalink
upgrade to 9 and updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
uerbzr committed Jan 27, 2025
1 parent d4ef267 commit d27c889
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 55 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ Pizza Shop needs a very simple ordering system with just just 3 tables, Customer
- Include yourself as a customer and your favourite Pizza.


## Extension
## Extension (choose at least two)

- Add extra toppings to Pizzas and allow customers to add toppings to their order. Add a new table for Toppings and a new table for OrderToppings. Add any endpoints you think necessary to add toppings.
- Assume that Pizzas take 3 minutes to prepare and 12 minutes to cook in the oven. Modify your code so your customers see at what stage their order is and add an endpoint so the delivery drivers app can set the order as Delivered

## Super Extension (optional)

- The Pizza Shop can only cook 4 pizzas at a time and the delivery driver is allocated 10 minutes to deliver one pizza at a time. Add an estimated delivery time to the Order!

- Add a new table for DeliveryDrivers and add an endpoint to assign a driver to an order. Add a new endpoint to get all orders for a driver.
- Add the ability for the Pizza shop to sell other products on the Menu. e.g. Burgers, Fries, Drinks. Update any existing code and add any endpoints you think necessary to add products these to an order.

## Tips

Expand Down
32 changes: 0 additions & 32 deletions exercise.pizzashopapi/Controllers/WeatherForecastController.cs

This file was deleted.

4 changes: 2 additions & 2 deletions exercise.pizzashopapi/Data/Seeder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public async static void SeedPizzaShopApi(this WebApplication app)
{
db.Add(new Customer() { Name="Nigel" });
db.Add(new Customer() { Name = "Dave" });
db.SaveChanges();
await db.SaveChangesAsync();
}
if(!db.Pizzas.Any())
{
Expand All @@ -26,7 +26,7 @@ public async static void SeedPizzaShopApi(this WebApplication app)
if(1==1)
{

db.SaveChanges();
await db.SaveChangesAsync();
}
}
}
Expand Down
1 change: 1 addition & 0 deletions exercise.pizzashopapi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
app.ConfigurePizzaShopApi();

app.SeedPizzaShopApi();

app.Run();
2 changes: 1 addition & 1 deletion exercise.pizzashopapi/Repository/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace exercise.pizzashopapi.Repository
{
public interface IRepository
{
IEnumerable<Order> GetOrdersByCustomer();
Task<IEnumerable<Order>> GetOrdersByCustomer(int id);


}
Expand Down
4 changes: 2 additions & 2 deletions exercise.pizzashopapi/Repository/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace exercise.pizzashopapi.Repository
public class Repository : IRepository
{
private DataContext _db;
public IEnumerable<Order> GetOrdersByCustomer(int id)
public Task<IEnumerable<Order>> GetOrdersByCustomer(int id)
{
return _db.ord
throw new NotImplementedException();
}
}
}
12 changes: 0 additions & 12 deletions exercise.pizzashopapi/WeatherForecast.cs

This file was deleted.

2 changes: 1 addition & 1 deletion exercise.pizzashopapi/exercise.pizzashopapi.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down

0 comments on commit d27c889

Please sign in to comment.