Client Categories & Segmentation

Client Categories & Segmentation

NexusRMS provides three systems for organising clients: Categories for manual tagging, Segments for dynamic or static groupings, and Lead Scoring for automated prioritisation.

Client Categories (ClientCategory)

Categories support a hierarchical structure via parent_id (e.g. Events > Corporate > Conferences). Fields:

  • name, slug (auto-generated), description
  • color (hex code, e.g. #FF5733), icon (Material Design icon name)
  • is_system (cannot delete, only deactivate), is_active, is_public
  • sort_order (lower = first), clients_count (denormalised counter)

Categories use a many-to-many relationship via the client_category_assignments pivot table. Assign categories on the create/edit form or via bulk actions on the list page.

Hierarchy Methods

  • getFullPath() — Full path, e.g. "Events > Corporate > Conferences"
  • hasChildren() / isLeaf() — Check for children
  • getAllDescendants() — Flat collection of all descendants
  • getDepth() — Nesting level (0 for root)
  • updateClientsCount() — Recalculate denormalised count

Scopes: active(), system(), custom(), topLevel(), ordered().

Client Segments (ClientSegment)

Two segment types via the type field:

  • dynamic — Membership auto-calculated from criteria
  • static — Membership manually managed

Fields: name, description, slug, type, criteria (JSON for dynamic), color, icon, is_system, is_active, is_public, client_count, last_refreshed_at, refresh_frequency.

Refresh Frequencies

realtime, hourly, daily, weekly, manual.

Dynamic Segments

The criteria JSON contains conditions with field, operator (equals, not_equals, contains, greater_than, less_than, in, not_in, is_null, is_not_null), and value. The applyCriteria() method builds the query; refreshMembers() recalculates membership.

Static Segments

  • addClient(clientId, addedBy, method) — Add a client (skips duplicates)
  • removeClient(clientId) — Remove a client

Members tracked via ClientSegmentMember: added_at, added_by, added_method (manual or automatic).

Segment Methods

  • isDynamic() / isStatic() — Check type
  • needsRefresh() — True if overdue for recalculation
  • duplicate(newName, userId) — Copy segment (including members for static)

Segment Quick Filters

Chips on the client list page with counts: All Clients, VIP, High Value, At Risk, New, Inactive.

Lead Scoring (ClientLeadScore)

Four scoring dimensions combined into total_score (0–100):

  • demographic_score — Profile attributes
  • behavioral_score — Actions and patterns
  • engagement_score — Portal usage and communication
  • firmographic_score — Company characteristics

Classification: hot (≥80), warm (50–79), cold (<50). Thresholds stored in lead_score_thresholds table. The rule_breakdown JSON field stores calculation details.

Score Change Tracking

previous_score and score_changed_at record changes. hasImproved() / hasDeclined() check direction. History stored in ClientLeadScoreHistory: score, previous_score, change, change_reason, recorded_at.

Tips

  • Use categories for broad classification and segments for data-driven groupings.
  • Set dynamic segments to daily refresh — realtime can impact performance.
  • Review lead scores regularly to prioritise outreach to hot and warm clients.
  • Use duplicate() to create segment variants without starting from scratch.
  • Monitor score trends via ClientLeadScoreHistory to spot declining engagement.

Was this article helpful?