dodil/erp-brick-lead

src/brick_lead/application/process.yaml

# The lead's process, as the customer sees and signs it (erp_platform.bpmn renders it at GET /process/bpmn).
# The shape of a module spec's `workflows:` (erp-method modules/crm, workflows.lead), written from what this brick's
# use cases do. Keys are the BPMN ids: frozen once signed — a renamed step gets a new key.
version: 1
name: Leads
actors:
  - { id: rep, name: Sales rep }
  - { id: marketing, name: Marketing }
  - { id: system, name: The system }
workflows:
  - entity: lead
    states: [new, working, qualified, disqualified, converted]
    terminal: [disqualified, converted]
    transitions:
      - { key: add_lead, from: none, to: new, by: rep, name: Add a lead, effect: "one email or one domain is one lead" }
      - { key: import_leads, from: none, to: new, by: marketing, name: Import a list, effect: "importing twice changes nothing" }
      - { key: start_working, from: new, to: working, by: rep, name: Start working it }
      - { key: qualify_lead, from: working, to: qualified, by: [rep, system], name: Qualify,
          gate: "score >= the scoring policy's threshold, computed now" }
      - { key: disqualify_lead, from: [new, working], to: disqualified, by: rep, name: Disqualify, requires: a reason }
      - { key: convert_lead, from: qualified, to: converted, by: rep, name: Convert,
          effect: "creates the business partner, the contact and the deal, in one step (CRM-03)" }