🗄️ Database

Database Schema Overview

Comprehensive overview of the Ever Gauzy database schema.

Core Entity Groups

Diagram; its source is available below
Diagram source
graph TB
    subgraph "Multi-Tenancy"
        T[Tenant] --> O[Organization]
        T --> U[User]
    end

    subgraph "HR"
        O --> E[Employee]
        E --> TL[TimeLog]
        E --> TS[Timesheet]
        E --> EX[Expense]
    end

    subgraph "Project Management"
        O --> P[Project]
        P --> TK[Task]
        TK --> TL
    end

    subgraph "CRM"
        O --> C[Contact]
        O --> PL[Pipeline]
        PL --> D[Deal]
    end

    subgraph "Accounting"
        O --> I[Invoice]
        O --> PM[Payment]
        O --> EX
    end

Key Tables

Multi-Tenancy

TableDescriptionRelations
tenantTop-level isolationHas many organizations
organizationBusiness entityBelongs to tenant
userAuthentication entityBelongs to tenant
rolePermission groupBelongs to tenant
role_permissionRole ↔ permission mappingBelongs to role

Employees & HR

TableDescriptionRelations
employeeEmployee profileBelongs to user
time_logIndividual time entriesBelongs to employee
timesheetWeekly time summaryHas many time_logs
time_slotActivity time slotsBelongs to time_log
screenshotScreen capturesBelongs to time_slot
activityKeyboard/mouse activityBelongs to time_slot
expenseExpense recordsBelongs to employee
incomeIncome recordsBelongs to employee

Project Management

TableDescriptionRelations
projectProject entityBelongs to org
taskWork itemsBelongs to project
sprintSprint iterationsBelongs to project
daily_planDaily work plansBelongs to employee
goalOKR objectivesBelongs to org
goal_kpiKey performance metricBelongs to goal

Accounting

TableDescriptionRelations
invoiceInvoice entityHas many items
invoice_itemLine itemsBelongs to invoice
paymentPayment recordsBelongs to invoice
estimateQuotes/estimatesHas many items

CRM

TableDescriptionRelations
contactClient/lead entityBelongs to org
pipelineSales pipelineHas many stages
dealSales opportunityBelongs to pipeline

Common Columns

All entities inherit from TenantOrganizationBaseEntity:

ColumnTypeDescription
idUUIDPrimary key
tenantIdUUIDTenant scope
organizationIdUUIDOrganization scope
createdAttimestampCreation timestamp
updatedAttimestampLast update
isActivebooleanSoft active flag
isArchivedbooleanArchive flag

Edit this page

Copyright © 2023-Present Ever Co. LTD.Docs by Sourcey