Core Concepts
Purpose
The Universal Entity Platform provides a stable, reusable foundation for modelling business objects that share common concerns:
- identity,
- hierarchy,
- properties,
- tags,
- grouping,
- relationships,
- access control,
- lifecycle management,
- auditability.
Instead of creating a completely new CRUD stack for every new business object, developers define new entity types, property groups, tag groups, templates, and application-specific behavior.
Primary Rule
Every important business object is represented by exactly one entity.
Examples:
Customer -> Entity
Site -> Entity
Building -> Entity
Room -> Entity
Asset -> Entity
Credential -> Entity
Tag -> Entity
Group -> EntityA domain table may still exist when the object has special behavior, but the object should still own one entity row.
Entity
An entity is the universal identity record.
It answers:
What is this object?
Where is it in the hierarchy?
Is it active or deleted?
What type is it?
What is its stable platform identity?It does not store ordinary business attributes like hostname, serial number, address, or password.
Those are represented through domain tables, properties, or the Vault depending on behavior.
Entity Type
An entity type defines what kind of object an entity represents.
Examples:
customer
site
building
room
asset
credential
tag
group
connection_method
vendorEntity types are stored as data, not PostgreSQL enums. This allows new types to be introduced without schema migrations.
Hierarchy
Hierarchy models containment.
Default Eco Manager hierarchy:
Customer
└── Site
└── Building
└── AssetFuture hierarchy:
Customer
└── Site
└── Building
└── Room
└── AssetHierarchy answers:
Where is this thing located or owned structurally?Hierarchy is implemented by:
entities.parent_entity_id
entities.path ltreeDo not store containment in the generic relationship table.
Relationship
Relationships model associations that are not containment.
Examples:
Asset uses Credential
Asset depends_on Asset
Asset connects_to Asset
User manages Asset
Connection Method applies_to SiteRelationships answer:
How is this thing associated with another thing?They may form arbitrary graphs, including cycles where the business domain allows them.
Entity Group
An entity group is a named collection of entities.
Groups are useful for:
- commissioning batches,
- maintenance sets,
- reporting scopes,
- critical asset lists,
- customer portfolios,
- project collections,
- user-defined collections.
A group is itself an entity, with members stored in a membership table.
Group membership is not containment.
Property Group
A property group is a named section of related properties.
Examples:
Device
Network
BACnet
Modbus
Credentials
CommissioningProperty groups are used by the frontend to organize forms and detail views.
Property Definition
A property definition describes a typed property that may be assigned to entities.
Examples:
hostname
ip_address
serial_number
firmware_version
bacnet_device_instance
commissioning_statusA property definition defines validation rules, display behavior, sensitivity, and searchability.
Property Value
A property value stores the actual value for an entity and property definition.
Example:
Entity: Asset A
Property: ip_address
Value: "192.168.1.40"Sensitive values must not be stored as ordinary property values unless they are references to Vault-managed secrets.
Tag Group
A tag group organizes tags.
Examples:
Criticality
Commissioning Status
Vendor
Asset Class
EnvironmentTag groups may be configured as single-select or multi-select.
Tag
A tag is an entity representing a label that can be assigned to other entities.
Examples:
Critical
Trend
Commissioned
Blocked
ProductionTags are assigned through a tagging table or a tagged_with relationship. Prefer a dedicated entity_tags table when tag querying and uniqueness matter.
Template
A template defines the expected metadata shape for a type of entity.
Example:
BACnet Controller Template
├── Property Groups
│ ├── Device
│ ├── Network
│ └── BACnet
└── Tag Groups
├── Vendor
└── Commissioning StatusTemplates help developers and authorized users create consistent entity forms and defaults.
Root Entity Scope
A root entity defines an authorization and tenancy boundary.
Examples:
Customer A root
Customer B root
Internal engineering rootA user may be scoped to one or more root entities.
Most operations must verify:
target.path <@ allowed_root.pathThis concept can later support PostgreSQL RLS.
Lifecycle
Entities support soft delete, restore, and hard delete.
Normal deletion is soft deletion:
deleted_at = now()Hard delete is explicit and normally performed by purge jobs after a retention period.