# Entity Reference Overview {#entity-reference-overview}


This section documents all database entities in the Ever Gauzy platform. Entities are organized by domain and include field definitions, relationships, and inheritance hierarchy.


## Entity Inheritance {#entity-inheritance}


All entities inherit from a base hierarchy:





```mermaid
classDiagram
    class BaseEntity {
        +id: string
        +createdAt: Date
        +updatedAt: Date
        +isActive: boolean
        +isArchived: boolean
    }
    class TenantBaseEntity {
        +tenantId: string
        +tenant: Tenant
    }
    class TenantOrganizationBaseEntity {
        +organizationId: string
        +organization: Organization
    }
    BaseEntity <|-- TenantBaseEntity
    TenantBaseEntity <|-- TenantOrganizationBaseEntity
```





Most entities extend `TenantOrganizationBaseEntity`, inheriting automatic tenant and organization scoping.


## Entity Index by Domain {#entity-index-by-domain}



### Core {#core}


| Entity                                           | Table             | Description            |
| ------------------------------------------------ | ----------------- | ---------------------- |
| [User](https://sourcey-gauzy.pages.dev/database/entity-reference/core-entities/index.md#user)                     | `user`            | User accounts          |
| [Tenant](https://sourcey-gauzy.pages.dev/database/entity-reference/core-entities/index.md#tenant)                 | `tenant`          | Top-level isolation    |
| [Organization](https://sourcey-gauzy.pages.dev/database/entity-reference/core-entities/index.md#organization)     | `organization`    | Business units         |
| [Role](https://sourcey-gauzy.pages.dev/database/entity-reference/core-entities/index.md#role)                     | `role`            | User roles             |
| [RolePermission](https://sourcey-gauzy.pages.dev/database/entity-reference/core-entities/index.md#rolepermission) | `role_permission` | Permission assignments |


### Employees {#employees}


| Entity                                                 | Table              | Description            |
| ------------------------------------------------------ | ------------------ | ---------------------- |
| [Employee](https://sourcey-gauzy.pages.dev/database/entity-reference/employee-entities/index.md#employee)               | `employee`         | Employee records       |
| [EmployeeAward](https://sourcey-gauzy.pages.dev/database/entity-reference/employee-entities/index.md#employeeaward)     | `employee_award`   | Awards and recognition |
| [EmployeeLevel](https://sourcey-gauzy.pages.dev/database/entity-reference/employee-entities/index.md#employeelevel)     | `employee_level`   | Seniority levels       |
| [EmployeeSetting](https://sourcey-gauzy.pages.dev/database/entity-reference/employee-entities/index.md#employeesetting) | `employee_setting` | Per-employee settings  |


### Time Tracking {#time-tracking}


| Entity                                            | Table        | Description           |
| ------------------------------------------------- | ------------ | --------------------- |
| [TimeLog](https://sourcey-gauzy.pages.dev/database/entity-reference/time-tracking-entities/index.md#timelog)       | `time_log`   | Time entries          |
| [TimeSlot](https://sourcey-gauzy.pages.dev/database/entity-reference/time-tracking-entities/index.md#timeslot)     | `time_slot`  | 10-min activity slots |
| [Timesheet](https://sourcey-gauzy.pages.dev/database/entity-reference/time-tracking-entities/index.md#timesheet)   | `timesheet`  | Weekly timesheets     |
| [Screenshot](https://sourcey-gauzy.pages.dev/database/entity-reference/time-tracking-entities/index.md#screenshot) | `screenshot` | Activity screenshots  |
| [Activity](https://sourcey-gauzy.pages.dev/database/entity-reference/time-tracking-entities/index.md#activity)     | `activity`   | App/URL activities    |


### Tasks & Projects {#tasks--projects}


| Entity                                                             | Table                  | Description      |
| ------------------------------------------------------------------ | ---------------------- | ---------------- |
| [Task](https://sourcey-gauzy.pages.dev/database/entity-reference/task-project-entities/index.md#task)                               | `task`                 | Work items       |
| [OrganizationProject](https://sourcey-gauzy.pages.dev/database/entity-reference/task-project-entities/index.md#organizationproject) | `organization_project` | Projects         |
| [OrganizationSprint](https://sourcey-gauzy.pages.dev/database/entity-reference/task-project-entities/index.md#organizationsprint)   | `organization_sprint`  | Agile sprints    |
| [DailyPlan](https://sourcey-gauzy.pages.dev/database/entity-reference/task-project-entities/index.md#dailyplan)                     | `daily_plan`           | Daily work plans |


### Financial {#financial}


| Entity                                                | Table          | Description            |
| ----------------------------------------------------- | -------------- | ---------------------- |
| [Invoice](https://sourcey-gauzy.pages.dev/database/entity-reference/invoice-payment-entities/index.md#invoice)         | `invoice`      | Invoices and estimates |
| [InvoiceItem](https://sourcey-gauzy.pages.dev/database/entity-reference/invoice-payment-entities/index.md#invoiceitem) | `invoice_item` | Line items             |
| [Payment](https://sourcey-gauzy.pages.dev/database/entity-reference/invoice-payment-entities/index.md#payment)         | `payment`      | Payment records        |
| [Expense](https://sourcey-gauzy.pages.dev/database/entity-reference/expense-income-entities/index.md#expense)          | `expense`      | Business expenses      |
| [Income](https://sourcey-gauzy.pages.dev/database/entity-reference/expense-income-entities/index.md#income)            | `income`       | Revenue entries        |


### CRM & ATS {#crm--ats}


| Entity                            | Table                  | Description       |
| --------------------------------- | ---------------------- | ----------------- |
| [Contact](https://sourcey-gauzy.pages.dev/database/entity-reference/crm-entities/index.md)         | `organization_contact` | Business contacts |
| [Pipeline](https://sourcey-gauzy.pages.dev/database/entity-reference/crm-entities/index.md)        | `pipeline`             | Sales pipelines   |
| [Deal](https://sourcey-gauzy.pages.dev/database/entity-reference/crm-entities/index.md)            | `deal`                 | Sales deals       |
| [Candidate](https://sourcey-gauzy.pages.dev/database/entity-reference/candidate-entities/index.md) | `candidate`            | Job candidates    |


### Products & Inventory {#products--inventory}


| Entity                                         | Table             | Description      |
| ---------------------------------------------- | ----------------- | ---------------- |
| [Product](https://sourcey-gauzy.pages.dev/database/entity-reference/product-inventory-entities/index.md)        | `product`         | Products         |
| [ProductVariant](https://sourcey-gauzy.pages.dev/database/entity-reference/product-inventory-entities/index.md) | `product_variant` | Product variants |
| [Warehouse](https://sourcey-gauzy.pages.dev/database/entity-reference/product-inventory-entities/index.md)      | `warehouse`       | Warehouses       |


### Collaboration {#collaboration}


| Entity                               | Table      | Description          |
| ------------------------------------ | ---------- | -------------------- |
| [Comment](https://sourcey-gauzy.pages.dev/database/entity-reference/collaboration-entities/index.md)  | `comment`  | Comments on entities |
| [Mention](https://sourcey-gauzy.pages.dev/database/entity-reference/collaboration-entities/index.md)  | `mention`  | @mentions            |
| [Reaction](https://sourcey-gauzy.pages.dev/database/entity-reference/collaboration-entities/index.md) | `reaction` | Emoji reactions      |
| [Favorite](https://sourcey-gauzy.pages.dev/database/entity-reference/collaboration-entities/index.md) | `favorite` | Bookmarked entities  |


## Multi-ORM Support {#multi-orm-support}


All entities are decorated for both TypeORM and MikroORM using the `MultiORMEntity` decorator:

```typescript
@MultiORMEntity("table_name")
export class MyEntity extends TenantOrganizationBaseEntity {
  @MultiORMColumn()
  name: string;
}
```

See [Multi-ORM Architecture](https://sourcey-gauzy.pages.dev/architecture/multi-orm-architecture/index.md) and [Multi-ORM Entities](https://sourcey-gauzy.pages.dev/database/multi-orm-entities/index.md) for details.
