Concept
Entity system
Codemeta OS has a generic entity layer through which every CRUD mutation passes. This gives you uniform behavior – whether you create a ticket, a contract or a knowledge article.
Three components per entity
- Schema defines fields, types and required fields.
- Configuration links schema, permissions, protected fields and supported data scopes.
- Relationship model describes who may see which record — relationship-based (owner, team, tenant).
A uniform service layer reads the configuration and gives all entities the same behavior.
What happens on a mutation?
In a single database transaction:
- Generate a UUIDv7, set
version, taketenantIdfrom the header. - Draw a sequence number if the entity has one (
T-2026-00042etc.). - Write the data.
- Record the audit entry with a JSON patch.
If any of these steps fails, the entire transaction is rolled back. You will never see a record without an audit entry.
Protected fields
Some fields are controlled by the service and cannot be set directly by the
caller – for example id, tenantId, version, createdAt,
createdBy, deletedAt, deletedBy. If you send them in the body, they are
ignored or the API responds with 422 Unprocessable Entity.