Demo steps

This commit is contained in:
Imbus 2024-05-04 13:52:41 +02:00
parent 884662e409
commit c186c3b515

View file

@ -47,18 +47,32 @@ public class Database {
} }
public String getRecipes(Request req, Response res) { public String getRecipes(Request req, Response res) {
// Essentially serialize DefaultRecipes to json
return "{}"; return "{}";
} }
public String getPallets(Request req, Response res) { public String getPallets(Request req, Response res) {
// 1. Get query param -> validate cookie type if not null
// 2. Figure out if we should return all pallets or just one type
// 3. Return pallets as {cookie, blocked}
return "{\"pallets\":[]}"; return "{\"pallets\":[]}";
} }
public String reset(Request req, Response res) { public String reset(Request req, Response res) {
// 1. Wipe database
// 2. Re-run migrations
// 3. Return success
return "{}"; return "{}";
} }
public String createPallet(Request req, Response res) { public String createPallet(Request req, Response res) {
// 1. Get query param
// 2. Check if cookie exists (is in DefaultRecipes)
// 3. Start transaction
// 3. Check with db if raw materials are available -> decrement if so
// 4. Insert into pallets
// 5. Commit transaction
// 6. Return pallet id
return "{}"; return "{}";
} }