mirror of
https://github.com/temetro/temetro.git
synced 2026-08-25 01:47:01 +00:00
feat: computed analytics endpoint, rework Analysis page
Add GET /api/analytics returning real aggregates over the clinic's patients/appointments/prescriptions/tasks, and rebuild the Analysis page to render them. Drops the fabricated revenue/profit cards — temetro has no billing data source. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { Router } from "express";
|
||||
|
||||
import { requireAuth, requireOrg } from "../middleware/auth.js";
|
||||
import * as service from "../services/analytics.js";
|
||||
|
||||
export const analyticsRouter = Router();
|
||||
|
||||
// Clinic analytics are readable by any member of the active clinic.
|
||||
analyticsRouter.use(requireAuth, requireOrg);
|
||||
|
||||
analyticsRouter.get("/", async (req, res, next) => {
|
||||
try {
|
||||
res.json(await service.getAnalytics(req.organizationId!));
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user