Field Types

Field types shape generated validation, OpenAPI, GraphQL, MCP tool schemas, projections, and custom pages.

Common guidance

NeedPrefer
Stable identityuuid or another explicit id type.
Human-readable labelstring with length expectations.
Moneystructured amount and currency fields.
Date or timeexplicit date/time type with timezone expectations.
Statusenum with business names.
Free-form metadatastructured object only when consumers can tolerate schema evolution.

Commands

Command fields should represent what the caller must provide to request a decision. Avoid derived fields that the decider or policy can compute.

Events

Event fields should capture durable facts needed by future decisions, projections, audit, and policies. Be careful when removing or renaming event fields; history still contains older events.

Projections

Projection fields should support read questions, filters, sorting, and UI display. Do not expose sensitive fields just because they exist on events.

Refinement

Use refined types when a field has business constraints. Clear validation messages are part of the runtime contract.