78 lines
5.0 KiB
JavaScript
78 lines
5.0 KiB
JavaScript
// ─────────────────────────────────────────────────────────────────────────────
|
|
// Single source of truth for map status taxonomies & color tokens.
|
|
//
|
|
// The Territory Map (property canvassing lifecycle) and LynkDispatch (live
|
|
// dispatch ops) track different entities, so they keep separate taxonomies —
|
|
// but BOTH read their colors from the shared hue tokens below, so the palette
|
|
// never drifts or contradicts itself across the app.
|
|
//
|
|
// One hue = one meaning:
|
|
// red → urgent / hot amber → needs attention / busy
|
|
// emerald→ positive / converted blue → in progress / active
|
|
// violet → undecided / neutral slate → inactive / declined
|
|
// gray → low priority / idle
|
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
export const STATUS_HUES = {
|
|
red: '#ef4444',
|
|
amber: '#f59e0b',
|
|
emerald: '#10b981',
|
|
blue: '#3b82f6',
|
|
violet: '#a78bfa',
|
|
slate: '#cbd5e1',
|
|
gray: '#6b7280',
|
|
};
|
|
|
|
// ── Territory Map — property canvassing lifecycle ───────────────────────────
|
|
// `color` — marker/polygon stroke & fill (hex)
|
|
// `fillOpacity` — polygon fill alpha
|
|
// `badge` — Tailwind classes for the status pill
|
|
// `dot` — Tailwind bg class for the legend swatch
|
|
export const CANVASSING_STATUS = {
|
|
'Hot Lead': { color: STATUS_HUES.red, fillOpacity: 0.40, badge: 'bg-red-500 text-white', dot: 'bg-red-500' },
|
|
'Customer': { color: STATUS_HUES.emerald, fillOpacity: 0.30, badge: 'bg-emerald-500 text-white', dot: 'bg-emerald-500' },
|
|
'Renovated': { color: STATUS_HUES.blue, fillOpacity: 0.20, badge: 'bg-blue-500 text-white', dot: 'bg-blue-500' },
|
|
'Neutral': { color: STATUS_HUES.violet, fillOpacity: 0.20, badge: 'bg-violet-400 text-white', dot: 'bg-violet-400' },
|
|
'Not Interested': { color: STATUS_HUES.slate, fillOpacity: 0.35, badge: 'bg-slate-300 text-slate-900', dot: 'bg-slate-300' },
|
|
};
|
|
|
|
// Render/legend order for the canvassing statuses.
|
|
export const CANVASSING_STATUS_ORDER = ['Hot Lead', 'Customer', 'Renovated', 'Neutral', 'Not Interested'];
|
|
|
|
// Fallback used when a property has no (or an unknown) canvassing status.
|
|
export const CANVASSING_STATUS_DEFAULT = CANVASSING_STATUS.Neutral;
|
|
|
|
// ── LynkDispatch — live dispatch operations ─────────────────────────────────
|
|
export const REP_STATUS = {
|
|
available: { color: STATUS_HUES.emerald, label: 'Available' },
|
|
en_route: { color: STATUS_HUES.blue, label: 'En Route' },
|
|
busy: { color: STATUS_HUES.amber, label: 'Busy' },
|
|
};
|
|
|
|
export const LEAD_URGENCY = {
|
|
emergency: { color: STATUS_HUES.red, label: 'Emergency' },
|
|
high: { color: STATUS_HUES.amber, label: 'High' },
|
|
standard: { color: STATUS_HUES.gray, label: 'Standard' },
|
|
};
|
|
|
|
// Flat id→value maps for existing call sites that index by status/urgency key.
|
|
export const REP_STATUS_COLORS = Object.fromEntries(Object.entries(REP_STATUS).map(([k, v]) => [k, v.color]));
|
|
export const REP_STATUS_LABELS = Object.fromEntries(Object.entries(REP_STATUS).map(([k, v]) => [k, v.label]));
|
|
export const URGENCY_COLORS = Object.fromEntries(Object.entries(LEAD_URGENCY).map(([k, v]) => [k, v.color]));
|
|
|
|
// ── Team Schedule — appointment / meeting status ────────────────────────────
|
|
// `badge` — Tailwind classes for the status pill
|
|
// `dot` — Tailwind bg class for the legend swatch
|
|
// `desc` — one-line meaning shown in the legend (so Converted vs Scheduled is clear)
|
|
export const MEETING_STATUS = {
|
|
Scheduled: { label: 'Scheduled', badge: 'bg-blue-500/20 text-blue-600 dark:text-blue-400', dot: 'bg-blue-500', desc: 'Upcoming appointment' },
|
|
Rescheduled: { label: 'Rescheduled', badge: 'bg-amber-500/20 text-amber-600 dark:text-amber-400', dot: 'bg-amber-500', desc: 'Moved to a new date or time' },
|
|
Completed: { label: 'Completed', badge: 'bg-emerald-500/20 text-emerald-600 dark:text-emerald-400', dot: 'bg-emerald-500', desc: 'Visit took place' },
|
|
Converted: { label: 'Converted', badge: 'bg-violet-500/20 text-violet-600 dark:text-violet-400', dot: 'bg-violet-500', desc: 'Won — became a signed job' },
|
|
Cancelled: { label: 'Cancelled', badge: 'bg-slate-500/20 text-slate-600 dark:text-slate-400', dot: 'bg-slate-400', desc: 'Called off' },
|
|
};
|
|
|
|
export const MEETING_STATUS_ORDER = ['Scheduled', 'Rescheduled', 'Completed', 'Converted', 'Cancelled'];
|
|
|
|
export const MEETING_STATUS_DEFAULT = { label: 'Unknown', badge: 'bg-zinc-400/20 text-zinc-500 dark:text-zinc-400', dot: 'bg-zinc-400', desc: '' };
|