Documentation Index
Fetch the complete documentation index at: https://docs.wellapp.ai/llms.txt
Use this file to discover all available pages before exploring further.
FieldRuleValue stores the computed or user-supplied value for a single custom-column rule applied to a single record. Each row binds a FieldRule (the definition of a custom AI column) to a specific record by its string identifier and record root type, holding the computed JSONB value. It is the output store for the AI custom-column enrichment pipeline: the pipeline writes rows here after computing values; nothing else creates or modifies them via user interaction. There is no soft-delete column β rows are hard-deleted when their parent FieldRule is cascade-deleted.
| Naming | Value |
|---|
| Object | FieldRuleValue |
Resource type (JSON:API type) | field_rule_value |
| Collection / records root | β (not a records root) |
| REST base | /v1/field-rule-values |
| Entity class | FieldRuleValue |
Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.
API operations
| Operation | Method & path | Status |
|---|
| List | GET /v1/field-rule-values | π‘ Planned |
| Retrieve | GET /v1/field-rule-values/{id} | π‘ Planned |
| Create | POST /v1/field-rule-values | π‘ Planned |
| Update | PATCH /v1/field-rule-values/{id} | π‘ Planned |
| Delete | DELETE /v1/field-rule-values/{id} | π‘ Planned |
Data model
Attributes
| Field | Type | Required | Constraints | Allowed values | Description |
|---|
| value_id | string (UUID) β π system | β
Yes | UNIQUE; defaultRaw gen_random_uuid() | β | Public UUID identifier for the row. Generated by the database on insert; never writable by callers. |
| record_id | string | β
Yes | max length 255; composite UNIQUE with field_rule (field_rule_values_rule_record_unique) | β | The public UUID string of the record (e.g. a company_id or person_id) to which this computed value applies. Together with field_rule this pair is unique in the table, enabling race-condition-safe upserts. |
| root | string | β
Yes | max length 50; part of composite hot-path index idx_field_rule_values_root_record_rule | β | The record root type (e.g. βcompaniesβ, βpeopleβ) to which this value belongs. Denormalized from FieldRule.root for hot-path batch queries in the AI column-context assembly pipeline. |
| value | jsonb (nullable) | βͺ No | nullable | β | The computed value for the custom column on this record, stored as arbitrary JSONB. Null when the pipeline has not yet produced a value or when the result was explicitly null. Shape is determined by the parent FieldRuleβs column_type. |
| created_at | datetime β π system | β
Yes | set by onCreate hook; not nullable | β | Timestamp when this value row was first written by the enrichment pipeline. |
| updated_at | datetime β π system | βͺ No | nullable; set by onCreate and onUpdate hooks | β | Timestamp of the most recent update to this row by the pipeline. Null if the row has never been updated after creation. |
Relationships
| Name | Type | Required | Description |
|---|
| field_rule | to-one (ManyToOne) | Yes β NOT NULL; deleteRule: cascade | The FieldRule that defines the custom column whose computed value this row stores. Cascade deletion means all FieldRuleValue rows are hard-deleted when their parent FieldRule is removed. Part of the composite unique constraint (field_rule, record_id). |
System-computed
- value_id: auto-generated UUID via gen_random_uuid() on insert
- created_at: set by MikroORM onCreate hook; not user-settable
- updated_at: set by MikroORM onCreate and onUpdate hooks; not user-settable
- No soft-delete (deleted_at column absent): rows are hard-deleted on cascade from FieldRule deletion
- Hot-path composite index idx_field_rule_values_root_record_rule (root, record_id, field_rule_pk) added in Migration20260416000000 for AI custom-column batch context assembly
- Unique constraint field_rule_values_rule_record_unique (field_rule_pk, record_id) added in Migration20260330153340 to enable race-condition-safe upserts from the enrichment pipeline
Example
{
"data": {
"type": "field_rule_value",
"id": "a3f1c2d4-8e5b-4a7f-92b1-0123456789ab",
"attributes": {
"value_id": "a3f1c2d4-8e5b-4a7f-92b1-0123456789ab",
"record_id": "c7e9a1b2-3d4f-4e5a-8b9c-0a1b2c3d4e5f",
"root": "companies",
"value": { "text": "B2B SaaS company focused on developer tooling", "confidence": 0.92 },
"created_at": "2026-04-02T14:23:11.000Z",
"updated_at": "2026-04-02T14:23:11.000Z"
},
"relationships": {
"field_rule": {
"data": { "type": "field_rule", "id": "f8a2b3c4-1d2e-3f4a-5b6c-7d8e9f0a1b2c" }
}
}
}
}
Source: apps/api/src/database/entities/FieldRuleValue.ts Β· domain: workspace Β· tier: Infrastructure