diff --git a/app/src/main/java/krusty/Database.java b/app/src/main/java/krusty/Database.java index 08e80b8..96ea689 100644 --- a/app/src/main/java/krusty/Database.java +++ b/app/src/main/java/krusty/Database.java @@ -47,18 +47,32 @@ public class Database { } public String getRecipes(Request req, Response res) { + // Essentially serialize DefaultRecipes to json return "{}"; } 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\":[]}"; } public String reset(Request req, Response res) { + // 1. Wipe database + // 2. Re-run migrations + // 3. Return success return "{}"; } 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 "{}"; }