Skip to main content

Business Rules: Organic Development Workflow

Category: Guidelines
Status: Draft (Awaiting Approval)
Scope: Extraction and documentation of legacy business logic.


🎯 Objective

To establish a sustainable, incremental process for capturing Business Rules (BR) from the legacy WepNG codebase without overwhelming the engineering team.

🔄 The Lifecycle of a Business Rule

The workflow follows a 4-stage "Discovery-to-Reference" cycle:

1. Discovery (Module-Driven)

During deep-dive analysis of a module (e.g., OMGT), the AI Agent or Developer identifies candidate rules.

  • Trigger: Seeing complex if/else logic, validation checks, or state transitions.
  • Tooling: Metadata scan or manual code review.

2. Drafting (BR Candidates)

Candidates are recorded in a temporary location.

  • Location: docs/architecture/specs/draft/[module]/br_candidates_[module].md
  • Format:
    • ID: BR-[MODULE]-XXX (e.g., BR-OMGT-001)
    • Title: Concise rule name.
    • Context: File and line number as evidence.
    • Logic: Extracted pseudocode or plain English description.
    • Status: 🔍 To Verify

3. Validation (Creator Gate)

The Lead Engineer (or original Creator) reviews the draft candidates.

  • Review: Confirming if the code represents the intended business logic or a technical workaround.
  • Output: Mark as ✅ Validated or provide corrections in the draft.

4. Reference (Single Source of Truth)

Validated rules are promoted from drafts to the permanent repository.

  • Relocation: The verified BR logic must be moved from docs/architecture/specs/draft/[module]/ to the corresponding module folder in docs/architecture/specs/current/[module]/.
  • Registration: Add the rule entry to the central Business Rule Index.
  • Expansion: If the rule requires detailed documentation, it is expanded into a Gherkin scenario or Use Case within the specs/current/[module]/ directory.

📏 Standards & Conventions

ID Naming

  • BR-[MODULE]-[NUMBER] (Zero-padded to 3 digits).
  • Modules: OMGT, WA, MNT, BO, MYWEP, CRM, WA, FEE.

Definition Criteria

A Business Rule must be:

  • Atomic: One single logical constraint.
  • Stateable: True or False given a specific input.
  • Sourceable: Must have a direct link to the code implementing it.

🛠️ Operational Example

In br_candidates_omgt.md:

BR-OMGT-005: Callback Recipient Validation
Status: 🔍 To Verify
Evidence: OrderService.cs:L452
Logic: If an order is in 'Hold' status, callbacks can only be assigned to members of the 'Supervisors' group.


Reference: Business Rules Strategy