Entity
- Customizable application entities.
- Autogenerated view at /app/:tenant/:entity-slug.
- Autogenerated form at /app/:tenant/:entity-slug/new.
- Autogenerated view and form at /app/:tenant/:entity-slug/:id.
Life Cycle
Route | Create | Read | Update | Delete |
---|---|---|---|---|
/admin/entities | ||||
/admin/entities/new | ||||
/admin/entities/:entity-slug |
Properties
Name | Title | Type | Description |
---|---|---|---|
name * | Name | String | Unique internal identifier, e.g. employee. |
slug * | Slug | String | Unique application URL, e.g. employees would show at /app/:tenant/employees |
title * | Title | String | Can be a i18n key for multi-language support. e.g. Employee or models.employee.object. |
titlePlural * | Plural Title | String | Can be a i18n key for multi-language support. e.g. Employees or models.employee.plural. |
order * | Order | Int | Order of display at the /app sidebar menu. |
prefix * | Prefix | String | Used for folios, e.g. EMP-0001, EMP-0002... |
isAutogenerated * | Is Autogenerated | Boolean | Generates views and forms at /app/:tenant/:entity-slug, /app/:tenant/:entity-slug/new and /app/:tenant/:entity-slug/:id. |
hasApi * | Has API | Boolean | Generates API at /api/:entity-slug (GET, POST) and /api/:entity-slug/:id (GET, PUT, DELETE). |
requiresLinkedAccounts * | Requires Linked Accounts | Boolean | Rows are shared between 2 tenants. |
icon * | Icon | String | Sidebar Icon SVG or image URL. |
active * | Active | Boolean | |
properties | Properties | Property | Custom entity Properties, e.g. Full name (Text), Salary (Number), Birthday (Date)... |
apiKeys | API Keys | ApiKeyEntity[] | CRUD permissions for API Keys |
webhooks | Webhooks | EntityWebhook[] | POST, PUT, GET, DELETE webhooks, e.g. for Zapier communication. |
Model
model Entity {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String @unique
slug String @unique
order Int @unique
prefix String @unique
title String // i18n key, eg: models.contract.object
titlePlural String // i18n key, eg: models.contract.plural
isAutogenerated Boolean
hasApi Boolean
requiresLinkedAccounts Boolean
icon String
active Boolean
properties Property[]
rows Row[]
apiKeys ApiKeyEntity[]
webhooks EntityWebhook[]
}