Door-to-door sales management — territory setup, rep tracking, leaderboard rankings, CAC analytics, and field operations.
D2DDashboard — stats, active routes, territories
useQuery(api.d2d.queries.getRepsByContractor)
Empty state with clear CTA to add first rep.
TerritoryList — filterable by status
useQuery(api.d2d.queries.getTerritoriesByContractor)
TerritoryDetail — stats, map, assigned reps
useQuery(api.d2d.queries.getTerritoryById)
TerritoryCreate — zip codes boundary mode
useMutation(api.d2d.mutations.createTerritory)
TerritoryCreate — polygon boundary mode
useMutation(api.d2d.mutations.createTerritory)
TerritoryDetail — door status breakdown with color dots
useQuery(api.d2d.queries.getTerritoryStats)
RepList — filterable by status
useQuery(api.d2d.queries.getRepsByContractor)
RepDetail — profile, stats, daily activity
useQuery(api.d2d.queries.getRepById)
RepCreate — name, email, phone, team link, territory
useMutation(api.d2d.mutations.createRep)
RepDetail — full profile, weekly/all-time stats, route, actions
useQuery(api.d2d.queries.getRepStats)
RepDetail — onboarding state with activate CTA
useMutation(api.d2d.mutations.activateRep)
D2DLeaderboard — ranked by metric + period
useQuery(api.d2d.queries.getLeaderboard)
D2DLeaderboard — revenue metric, monthly period
useQuery(api.d2d.queries.getLeaderboard) — metric: revenue
Empty state when no rep activity exists for selected period.
D2DAnalytics — CAC metrics, trend, volume
useQuery(api.d2d.queries.getAnalytics)
D2DAnalytics — financial summary + segmented period
useQuery(api.d2d.queries.getCacMetrics)
Empty state when no analytics data for selected period.
Schema tables, queries, mutations, and flows that power D2D Sales Operations.
index.tsxscreenterritories.tsxterritory/[id].tsxscreenterritory/create.tsxscreenreps.tsxscreenrep/[id].tsxscreenrep/create.tsxscreenleaderboard.tsxscreenanalytics.tsxscreend2d.queries.getRepsByContractord2d.queries.getTerritoriesByContractord2d.queries.getRepByIdd2d.queries.getTerritoryByIdd2d.queries.getLeaderboardd2d.queries.getAnalyticsd2d.teams.getLiveRepStatusesd2d.teams.getActiveAlertsd2d.mutations.createTerritoryd2d.mutations.updateTerritoryd2d.mutations.createRepd2d.mutations.updateRepd2d.mutations.assignRepToTerritoryd2d.mutations.updateRepStatusTerritories are the primary organizational unit. Reps are assigned to territories, not the other way around.
Live status updates via Convex subscriptions show active/traveling/idle state without polling.
Cost per door, per appointment, per sale — enables data-driven territory and staffing decisions.
Gold/silver/bronze rankings with weekly bonus payouts drive rep performance and retention.
Active → saturated → resting → active. 60-day rest period before revisiting fully canvassed areas.