Skip to content

Add use-case docstring, execute and request/response doctrine tests #111

@absoludity

Description

@absoludity

Context

Use cases are the primary entry point for business logic in the Clean Architecture. The doctrine currently has no tests ensuring that use cases follow the expected structural conventions — that they are documented, that they expose a single `execute()` method, and that each use case is paired with matching `{Prefix}Request` and `{Prefix}Response` classes.

Without these tests, violations accumulate silently. Use cases can exist without docstrings, without an `execute()` method, or with request/response classes that are present in the module but never actually wired into the method signature.

Acceptance criteria

  • Doctrine test: use case classes MUST have a docstring
  • Doctrine test: use case classes MUST have an `execute()` method
  • Doctrine test: use case classes MUST have a matching `{Prefix}Request` class in the same bounded context
  • Doctrine test: use case classes MUST have a matching `{Prefix}Response` class in the same bounded context
  • Doctrine test: `execute()` MUST declare its first parameter as `{Prefix}Request`
  • Doctrine test: `execute()` MUST declare its return type as `{Prefix}Response`
  • Tests use runtime inspection with AST fallback for bounded contexts whose classes cannot be resolved at import time

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions