> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cessy.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cessy.ai/_mcp/server.

# Field Types

> Choose Cessy command, event, projection, and permission field types that make runtime validation and generated contracts predictable.

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

## Common guidance

| Need                 | Prefer                                                               |
| -------------------- | -------------------------------------------------------------------- |
| Stable identity      | `uuid` or another explicit id type.                                  |
| Human-readable label | `string` with length expectations.                                   |
| Money                | structured amount and currency fields.                               |
| Date or time         | explicit date/time type with timezone expectations.                  |
| Status               | enum with business names.                                            |
| Free-form metadata   | structured 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.