feat(03-01): implement setup backend with junction table

- Setup service with CRUD, syncSetupItems, removeSetupItem
- SQL aggregation for itemCount, totalWeight, totalCost via COALESCE
- Hono routes for all 7 endpoints with zValidator
- Mount setupRoutes at /api/setups
- All 87 tests pass (24 new setup tests)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 12:43:02 +01:00
parent 1e4e74f8d2
commit 0f115a2a4b
3 changed files with 197 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import { totalRoutes } from "./routes/totals.ts";
import { imageRoutes } from "./routes/images.ts";
import { settingsRoutes } from "./routes/settings.ts";
import { threadRoutes } from "./routes/threads.ts";
import { setupRoutes } from "./routes/setups.ts";
// Seed default data on startup
seedDefaults();
@@ -25,6 +26,7 @@ app.route("/api/totals", totalRoutes);
app.route("/api/images", imageRoutes);
app.route("/api/settings", settingsRoutes);
app.route("/api/threads", threadRoutes);
app.route("/api/setups", setupRoutes);
// Serve uploaded images
app.use("/uploads/*", serveStatic({ root: "./" }));