Multi-tenant scheduling SaaS (AgendaPro-equivalent): - Backend: Node + Express + node:sqlite, multi-tenant (admin/owner/employee), versioned migrations, 4 templates (estetica-spa, barberia, clinica, blank). - Frontend: React 18 + TS + Vite + Tailwind, FullCalendar drag-and-drop, Recharts dashboard, mobile-first (day/list views on mobile). - Features: calendar+services+employees+clients+tickets, dashboard with best employee/service, top tickets, top/frequent clients, commissions, cancellation policy + no-show tracking, public online booking (/b/:slug), cash register (cierre de caja), reminders/notifications center. - Verification: 65/65 e2e API, 58/58 visual (0 overflow, 0 console errors), typecheck clean, vite build OK.
17 lines
517 B
TypeScript
17 lines
517 B
TypeScript
import { Router } from "express";
|
|
import { db } from "../db.ts";
|
|
import type { AuthedRequest } from "../lib/auth.ts";
|
|
import { err } from "../lib/auth.ts";
|
|
|
|
export const businessRouter = Router();
|
|
|
|
businessRouter.get("/", (req: AuthedRequest, res) => {
|
|
const b = db
|
|
.prepare(
|
|
`SELECT id, name, industry, currency, currency_symbol, phone, address FROM businesses WHERE id = ?`
|
|
)
|
|
.get(req.user!.business_id);
|
|
if (!b) return err(res, 404, "Negocio no encontrado");
|
|
res.json({ business: b });
|
|
});
|