Appearance
Entity: reportTemplate
Entity Type: Database table
Description: A reportTemplate represents a named, manually assembled report consisting of an ordered list of reportBlock records (charts, tables, text). Unlike dashboardLayout (one per user), a tenant can have any number of reportTemplates, and any user within the tenant can view and use any reportTemplate belonging to that tenant — templates are shared within a tenant, not private to their creator. See Report Builder for the block-assembly mechanism.
Data Attributes Table
| Attribute Name | Description | Data Type | Default Value | Required (= Nullable) | Unique | Format | Validations | Index | Example |
|---|---|---|---|---|---|---|---|---|---|
| id | Unique identifier for the report template record. | UUID | Generated in code (app layer) | Yes | Yes | UUID v7 | Must be a valid UUID v7. | Primary Key | 01960000-0000-7000-8000-000000000301 |
| tenantId | Tenant this report template belongs to. Required on every entity — primary mechanism for data isolation across organisations. Also the sharing boundary: any user within this tenant can view and use this template. | UUID | - | Yes | No | UUID v7 | Foreign Key → tenant.id | name: idx_reportTemplate_tenantId, type: btree | 01960000-0000-7000-8000-000000000099 |
| name | User-given name identifying the report template. | String | - | Yes | No | - | Must not be an empty string. | name: idx_reportTemplate_name, type: btree | Monthly consumption overview |
| createdAt | Timestamp of entity creation. Immutable. | Timestamp with time zone | Set in code | Yes | No | ISO 8601 | - | - | 2026-08-19T10:00:00Z |
| updatedAt | Timestamp of last entity update (rename, or any block insert/reorder/remove within the template). | Timestamp with time zone | Set in code | Yes | No | ISO 8601 | - | - | 2026-08-19T10:00:00Z |
| deletedAt | Timestamp of soft delete. Once set, immutable. Records with deletedAt IS NULL are considered active. | Timestamp with time zone | null | No | No | ISO 8601 | - | - | null |
| createdBy | Identifier of the actor who created this record — the template's original creator, though visibility/use is shared tenant-wide (see tenantId). | String | - | Yes | No | type:actor | - | - | user:01960000-0000-7000-8000-000000000050 |
| updatedBy | Identifier of the actor who last updated this record. | String | - | Yes | No | type:actor | - | - | user:01960000-0000-7000-8000-000000000050 |
Audited fields
Recorded on created (in full), updated (changed only) and deleted (in full): name.
Excluded: none.
Not registered for entityName resolution (architecture 61-audit-log.md §7.4 in the code repo: a valid, permanent state, not a gap). If registered, name is the natural candidate. Unlike dashboardLayout, a tenant may have any number of report templates and they are shared tenant-wide rather than owned by one user — createdBy records who originated the template, but every tenant user can subsequently read and use it (see this entity's own description).