Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import { Hono } from "hono";
import earningsRoutes from "./earnings.routes";
import inboxRoutes from "./inbox.routes";
import ladderRoutes from "./ladder.routes";
import metricsRoutes from "./metrics.routes";
import adminPartnersRoutes from "./partners.routes";
import prospectsRoutes from "./prospects.routes";
import rampRoutes from "./ramp.routes";
import referralFunnelRoutes from "./referral-funnel.routes";
import adminReferralsRoutes from "./referrals.routes";
import signupsRoutes from "./signups.routes";
import tasksRoutes from "./tasks.routes";
/**
* RRM — recruitment CRM for Hyderabad channel partners (F-21).
*
* Mounted under `/api/admin/rrm`. The parent admin router already applies
* `contextMiddleware` and `requirePlatformAdmin`, so nothing here re-applies
* them — there is no `growth` role in this repo, only `admin` and
* `super_admin`.
*
* Grouped in one sub-router because RRM is a time-boxed campaign: if the
* 14-day gate is missed and Phase 2 is not built, this whole tree comes out
* in one deletion rather than being unpicked from the admin surface.
*/
const rrm = new Hono<{ Bindings: CloudflareBindings }>();
// Mount points are NOT uniform, and the difference is deliberate rather than
// sloppy: `prospects.routes.ts` declares bare paths (`/`, `/:id`) so it mounts
// under a prefix, while the others carry their own leading segment (`/inbox`,
// `/tasks`, `/ramp`, `/metrics/funnel`) and must mount at the root or the
// segment doubles — `/rrm/tasks/tasks`.
rrm.route("/prospects", prospectsRoutes);
// Partner programme. Two routers serve `/referrals/*`, split by what they own:
// this one owns the LIFECYCLE (list, detail, verify, reject, duplicate), and
// `earningsRoutes` below owns the LEDGER (`/referrals/:id/outcome`,
// `/earnings/:id/reverse`, `/payouts`). Different sub-paths, so they do not
// collide — and money mutations stay in one file rather than being sprinkled
// through the screen that happens to trigger them.
rrm.route("/referrals", adminReferralsRoutes);
rrm.route("/partners", adminPartnersRoutes);
rrm.route("/signups", signupsRoutes);
rrm.route("/", inboxRoutes); // /inbox, /messages/send
rrm.route("/", tasksRoutes); // /tasks, /tasks/:id/complete, /tasks/:id/confirm-intent
rrm.route("/", rampRoutes); // /ramp, /ramp/release, /halt, /config
rrm.route("/", metricsRoutes); // /metrics/funnel
rrm.route("/", referralFunnelRoutes); // /referral-funnel (FR-I-3)
rrm.route("/", ladderRoutes); // /schedule, /templates, /templates/sync
rrm.route("/", earningsRoutes); // /referrals/:id/outcome, /earnings/:id/reverse, /payouts
export default rrm;
|