- Add automatic route simulator (30s tick) that advances trucks and dispatches notifications without needing client-driven pull - Add GET /api/tracking/status protected by JWT for tunnel-view (each user only sees their own route + own inbox) - Add POST /api/tracking/reset-demo to wipe in-memory state without restarting the server (useful for repeated demos) - Add feedback module (POST /api/feedback, GET /api/feedback/me) with 4 feedback types and optional rating - Add addresses module: GET /colonias, GET/PUT /me with colonia validation against the catalog (rejects unknown colonias) - Add in-memory repos for route-state and notification inbox - Auto-register new users in the service mock with default route on register/login so they receive notifications immediately
18 lines
579 B
TypeScript
18 lines
579 B
TypeScript
import { Router } from "express";
|
|
import { AuthRoutes } from "./auth/routes.js";
|
|
import { TrackingRoutes } from "./tracking/routes.js";
|
|
import { FeedbackRoutes } from "./feedback/routes.js";
|
|
import { AddressesRoutes } from "./addresses/routes.js";
|
|
|
|
export class AppRoutes {
|
|
static get routes(): Router {
|
|
const router = Router();
|
|
|
|
router.use('/api/auth', AuthRoutes.routes);
|
|
router.use('/api/tracking', TrackingRoutes.routes);
|
|
router.use('/api/feedback', FeedbackRoutes.routes);
|
|
router.use('/api/addresses', AddressesRoutes.routes);
|
|
|
|
return router;
|
|
}
|
|
} |