feat: online booking portal (closes groombook/groombook#3) (#27)
Add customer-facing booking flow with three public API endpoints (/api/book/services, /api/book/availability, /api/book/appointments) and a four-step React wizard (service → date/time → contact info → confirm). Availability is computed from real groomer schedules with slot-level conflict detection. Booking auto-creates or matches clients by email and uses a transaction to guard against race conditions. Co-authored-by: Groom Book CTO <cto@groombook.app> Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit was merged in pull request #27.
This commit is contained in:
committed by
GitHub
parent
b767a00b5f
commit
e524099214
@@ -8,6 +8,7 @@ import { servicesRouter } from "./routes/services.js";
|
||||
import { appointmentsRouter } from "./routes/appointments.js";
|
||||
import { staffRouter } from "./routes/staff.js";
|
||||
import { invoicesRouter } from "./routes/invoices.js";
|
||||
import { bookRouter } from "./routes/book.js";
|
||||
import { authMiddleware } from "./middleware/auth.js";
|
||||
|
||||
const app = new Hono();
|
||||
@@ -25,6 +26,9 @@ app.use(
|
||||
// Health check (no auth required)
|
||||
app.get("/health", (c) => c.json({ status: "ok" }));
|
||||
|
||||
// Public booking routes — no auth required, must be registered before auth middleware
|
||||
app.route("/api/book", bookRouter);
|
||||
|
||||
// Protected API routes
|
||||
const api = app.basePath("/api");
|
||||
api.use("*", authMiddleware);
|
||||
|
||||
Reference in New Issue
Block a user