ores.ts.domain

Table of Contents

This page is the node for the ores.ts.domain facet of the codegen template library, part of the ores.ts technical space. Each archetype below is documented, and holds its mustache source, in its own linked page — this page is the facet-level summary and the routing table to them.

1. Summary

One archetype: an interface per entity or junction, named in PascalCase, with the object's fields in the order the C++ domain class declares them and the field names in snake_case — they are the keys rfl::json writes.

The interface is the object the protocol payloads carry, stated once. A protocol response that lists tenant_type rows references TenantType, so a UI reads a payload without restating the entity. The protocol facet's type projection maps ores::<component>::domain::<entity> onto this interface, so the two facets name one type. A junction renders the same way and follows the C++ junction block: version, the tenant when the model sets it, the left and right columns, the model's own columns, then the audit tail.

2. What the facet emits, and what it does not

The interface mirrors the C++ domain class's member list: the audited identity prelude (version, tenant_id, workspace_id when the model sets the flags), the primary key, the natural keys, the model's own columns, and the flat audit fields. A member whose C++ type has no TypeScript projection refuses the model rather than emit <member>: ;, so the interface never states an empty type. The entity guard is org_loader._reject_silent_entity_domain_ts_gap; it reads no :ores.*.enabled: property.

A composed struct (domain_groups, domain_identity_group, domain_audit_group) reaches its fields through a group member, and the interface names that member's own interface. That field-group interface is not emitted here, so such an entity renders a reference with no module behind it; the field-group TypeScript domain layer is a separate piece of work. A junction has no groups: its C++ class declares the audit tail as plain members, so the interface states them directly.

A junction member whose C++ type has no TypeScript projection refuses the model, because the interface would carry the member with no type or drop it silently, and a UI that reads either one fails at run time. The guard is org_loader._reject_silent_junction_ts_gap.

3. Which entities emit

A domain_entity model, which is every entity the C++ domain facet renders. A model with no * Columns section is refused upstream by the loader, so the archetype never sees one. A junction model emits as well, with the field set the C++ junction block declares.

4. Archetypes

Archetype Description
ores.ts.domain.domain_types The TypeScript interface for one entity's or junction's domain object.

5. See also

  • ores.ts — the parent technical space's facet catalogue and shared Mustache conventions.
  • ores.ts.protocol — the sibling facet whose payload interfaces reference these types.
  • Template variable reference — every variable this facet's template may read.

Emacs 29.3 (Org mode 9.6.15)