Type to search pages and rules.

Browse pages

Write Code for a Use Case

A use case is one command or query with its access, results, and scenarios, and its code spreads across every backend layer. This page maps each code element of a use case to its folder, its mark, and its check, so an author places new code without hunting six pages. The marks table owns which mark each element carries; the stack pages state each mark's written form.

Markdown

Concepts#

The Element Table#

Each row names one code element, the folder that holds it, the mark it carries, and the check that watches it. A check cell naming codes names the findings the tools report; a check cell naming review names the code a reviewer reads. This page adds no rule of its own.

ElementGoes InMarkChecked By
Command or query handlerThe use case folderimplements naming use-case/<module>.<name>use-case-act-missing, write-undeclared, effect-undeclared
Command or query messageThe use case folder beside its handlerNone; the handler folder places itname-drift
ValidatorThe use case folder beside its messageimplements naming use-case/<module>.<name>Review the validator body
Result typeThe use case folder beside its handlerNone; the handler folder places itresult-undeclared
Aggregate rootThe aggregate Domain/ folderimplements naming aggregate/<module>.<name>aggregate-unimplemented
Root method that changes stateOn the aggregate rootimplements naming use-case/<module>.<name>, exactly oneuse-case-act-missing, mark-count-invalid, act-event-undeclared, act-event-unimplemented
Domain eventThe Events/ folder of its aggregate Domain/ folderimplements naming event/<aggregate>.<fact>act-event-undeclared, act-event-unimplemented, code-placement-drift
Refusal typeThe Refusals/ folder of its aggregate Domain/ folderimplements naming rule/<home>.<name>refusal-unimplemented
Repository interfaceThe aggregate Domain/ folderNone; the aggregate folder places itconstituent-parent-missing
Repository implementationThe aggregate Infrastructure/ folderimplements naming aggregate/<module>.<name>, or derived from the interfacerepository-unimplemented
EndpointThe use case folder, or the host for a host-only endpointimplements naming use-case/<module>.<name>use-case-endpoint-missing, operation-use-case-drift
Request and response modelsThe use case folder beside the endpoint, or the node WebApi/ folder when sharedNone; the endpoint folder places themReview the transport models
Event handler classThe UseCases/On{Fact} folder inside the module UseCases/ folderimplements naming reaction/<module>.<name>reaction-unimplemented, effect-undeclared
Scheduled or manual hostThe module Jobs/ folder, hosted in Infrastructure or Workerimplements naming job/<module>.<name>job-unimplemented
External-system portThe node Application/ folder beside the aggregate it serves, or the owning module Contracts/Ports/ folder when called from another moduleimplements naming external-system/<name>external-system-unimplemented
TestThe test suite for its boundary, mirroring the module treeproves naming scenario/<use-case>.<name>proves-unreached, use-case-scenario-missing, use-case-unverified

Screens stay outside this table: whether a browser reaches a use case depends on the deployment. The Project Model states the mark rules, and System requires each mark; each stack page states the written form its language takes.

Standards#

None.

Conventions#

None.