Skip to main content

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.
NamingValue
ObjectFieldRuleValue
Resource type (JSON:API type)field_rule_value
Collection / records rootβ€” (not a records root)
REST base/v1/field-rule-values
Entity classFieldRuleValue
Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.

API operations

OperationMethod & pathStatus
ListGET /v1/field-rule-values🟑 Planned
RetrieveGET /v1/field-rule-values/{id}🟑 Planned
CreatePOST /v1/field-rule-values🟑 Planned
UpdatePATCH /v1/field-rule-values/{id}🟑 Planned
DeleteDELETE /v1/field-rule-values/{id}🟑 Planned

Data model

Attributes

FieldTypeRequiredConstraintsAllowed valuesDescription
value_idstring (UUID) β€” πŸ”’ systemβœ… YesUNIQUE; defaultRaw gen_random_uuid()β€”Public UUID identifier for the row. Generated by the database on insert; never writable by callers.
record_idstringβœ… Yesmax 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.
rootstringβœ… Yesmax 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.
valuejsonb (nullable)βšͺ Nonullableβ€”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_atdatetime β€” πŸ”’ systemβœ… Yesset by onCreate hook; not nullableβ€”Timestamp when this value row was first written by the enrichment pipeline.
updated_atdatetime β€” πŸ”’ systemβšͺ Nonullable; 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

NameTypeRequiredDescription
field_ruleto-one (ManyToOne)Yes β€” NOT NULL; deleteRule: cascadeThe 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