Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DOM-001Domain Model QualityAnemic domain model
Flags domain objects that appear to expose data without owning behavior or invariants.
warningviolationNo auto-fix
How to fix
- Move invariant checks into the domain object or focused domain service.
- Keep DTOs separate from domain behavior.
- Add tests around the domain rule being protected.
What the rule validates
Business rules are scattered around a data structure instead of living with the domain concept.
Why it matters
Anemic models make invariants harder to protect and duplicate business rules across layers.
Common causes
- DTOs or ORM entities are treated as domain objects.
- Services contain all domain decisions.
- The domain model has not been extracted yet.
Typical violation example
Every service checks subscription status differently before changing billing state.Typical compliant example
A Subscription domain object owns allowed status transitions.Related rules
AP-DOM-002 - Aggregate boundary violationAP-DOM-003 - Oversized aggregate/service boundaryAP-DOM-004 - Domain logic scattered across layersAP-DOM-005 - Cross-aggregate modification risk
Adjacent categories
Related files/config
apps/api/src/modulespackages
Related CLI commands
archpilot validatearchpilot validate --ci