Get Hedhog updates in your inbox
New releases, fresh recipes, and breaking changes — no spam.
CRM Submodule
relation-types
Catalog of person-to-person relation type codes (e.g. spouse, partner, parent), used to define relationship edges between person records.
Source path: libraries/crm/src/person-relation-type
Module file: person-relation-type.module.ts
Introduction
The Relation Types submodule exposes a catalog of person-to-person relationship kinds (e.g. spouse, partner, parent) used to label edges between individual person records. The catalog itself is hardcoded in the service as a fixed list (parent, child, spouse, sibling, guardian, dependent, partner, responsible, emergency_contact, other) rather than backed by a database table — list and get synthesize records on the fly by indexing into that constant array.
Unlike Contact Types and Document Types, this catalog is intentionally immutable: the controller still exposes POST, PATCH and DELETE routes (for interface consistency with the other catalog submodules), but the service implementation of all three unconditionally throws a 400 Bad Request explaining that relation types are fixed by schema and cannot be created, updated, or deleted. The MCP tool surface mirrors the read-only intent at the design level — only crm.relation-types.list and crm.relation-types.get are registered as tools, even though the underlying HTTP write routes technically exist and simply reject every call.
This catalog backs the relation edges defined between person_individual records, letting the CRM represent family or household structures for individual contacts without conflating that with the employer/company relationships modeled separately on the person record itself.
HTTP Endpoints
5 endpoints
Paginated list of person relation types, synthesized from a fixed in-code list rather than a database table.
- Query
- page, pageSize, search
Get a single relation type by ID (1-based index into the fixed relation type list).
- Params
- id (int)
Always rejected with a 400 Bad Request — relation types are fixed by schema and cannot be created dynamically.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| code | string | yes | — |
| locale | Record<string, { name: string }> | yes | e.g. { "en": { "name": "..." } } |
Always rejected with a 400 Bad Request — relation types cannot be updated.
- Params
- id (int)
Always rejected with a 400 Bad Request — relation types cannot be deleted.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| ids | number[] | yes | IDs to delete |
MCP Tools
Named tools callable by AI models via the Model Context Protocol (MCP).
crm.relation-types.listLists person relation types (e.g. parent, spouse, partner). These are fixed system types and cannot be created or deleted
crm.relation-types.getReturns a single person relation type by ID