What problem does it solve?
Business logic is the layer where the product lives. It is the difference between "save a row to the database" (data access) and "process a refund only if the order satisfies business constraints" (enforcing rules that define how a feature behaves). This skill centralizes complex workflows, state transitions, and calculations that would otherwise be scattered across routes, repositories, and UI logic.
Core Features & Use Cases
- Explicit guards in the service layer that codify domain rules at the hinge points of business operations.
- A state machine pattern that restricts transitions to allowed paths (Draft → Submitted → Under Review → Approved → Fulfilled, etc.).
- Domain events to decouple side effects (emails, analytics, webhooks) from core business logic.
- Testability through clear rule-driven unit tests mapped to each business requirement.
Quick Start
Define domain rules for a new feature, implement a service function with explicit guards, and validate each rule with unit tests.