public void Process(ExpenseData expense) { using (ProcessContext context = new ProcessContext()) { foreach (var processStep in steps) { bool shouldContinue = processStep.Process(expense, context); if (!shouldContinue) { HandlePartialResult(context); } } HandleCompleteResult(context, expense); } }
public void AdditionalExpenses(ExpenseData additional) { // ... additionalExpenses.Add(additional); }
public void Approve(ExpenseData expense) { }
private void HandleCompleteResult(ProcessContext context, ExpenseData expense) { }