04 · The Core

Status & Ownership Engine

The heart of the application. Not a screen — the shared machinery every module writes through, so status tracking and ownership are uniform across the entire lifecycle.

1

Validate transitions

A state machine rejects illegal jumps.

2

Hand off ownership

Pass the baton between teams.

3

Record history

Immutable status + activity log.

4

Run SLA clock

Per-stage timer feeds escalation.

1 · State machine

Each status defines its allowed next statuses. A request outside that set is rejected — a stage cannot be skipped or set to an impossible value.

NEW_LEAD ENRICHED MANAGER_APPROVAL ASSIGNED CONNECTED
CONNECTED OPPORTUNITY QUOTE_REQUESTED QUOTE_SHELL PRICING_ADDED QUOTE_SENT
QUOTE_SENT SAMPLE_REQUESTED IN_PRODUCTION IN_QA DISPATCHED FEEDBACK_AWAITED
FEEDBACK_AWAITED SAMPLE_APPROVED | SAMPLE_REJECTED
SAMPLE_APPROVED DOCS_REQUESTED DOCS_PROVIDED CLIENT_APPROVED CONTRACT_DRAFT CONTRACT_CONFIRMED
CONTRACT_CONFIRMED IN_PRODUCTION PACKAGED SHIPPED PAYMENT COMPLETED

Transition contract

function transition(entity, toStatus, actor, newOwner?):
  assert isAllowed(entity.status, toStatus)   # else reject
  fromStatus = entity.status;  fromOwner = entity.current_owner_id
  entity.status = toStatus
  if newOwner: reassign(entity, newOwner)
  StatusHistory.append(entity, fromStatus, toStatus, actor)
  ActivityLog.append(entity, "STATUS_CHANGE", actor, fromOwner, entity.current_owner_id)
  startSlaTimer(entity, toStatus);  notifyRelevantParties(entity)

2 · Ownership hand-off (the baton)

At any moment an entity has exactly one owner and team. Transitions pass the baton along the export chain:

SALES PURCHASE PRODUCTION QA LOGISTICS

Reassigning the owner updates current_owner_id + owner_team, drops the item into the receiving team's work queue, and logs from_owner → to_owner.

This answers "who is working on it?" — "who has it now" and "who had it before" are both reconstructable from the activity log.

3 · History & audit

StatusHistory

One append-only row per transition — from, to, by, when.

ActivityLog

One append-only row per meaningful action, including ownership changes.

Neither is ever updated or deleted. Together they reconstruct the full life of any deal.

4 · SLA / TAT timers

Each stage has a target turnaround (e.g. a quote in 24h). On entering a status a timer starts; if it elapses without the exit transition, the escalation chain fires. The same measurements power the TAT metrics on the KPI dashboard.

Status legend

New Lead Enriched Connected Opportunity Sample Approved Contract Confirmed In Production Dispatched Completed
Why centralize this? "Status + owner + audit" is needed identically in all six modules. Implementing it once, as an engine modules call, guarantees consistency, prevents illegal states, and makes tracking structural rather than something each screen must remember to do.