Saltar al contenido principal

Core Entities

Core platform entities: User, Tenant, Organization, Role, and RolePermission.

Userโ€‹

The User entity represents an authenticated account. Each user belongs to one tenant and can be associated with an employee or candidate profile.

ColumnTypeDescription
idUUIDPrimary key
emailstringUnique email address
firstNamestring?First name
lastNamestring?Last name
hashstring?Password hash (bcrypt)
imageUrlstring?Avatar URL
preferredLanguagestring?i18n preference (e.g., en)
preferredComponentLayoutenum?TABLE, CARDS_GRID, SPRINT_VIEW
thirdPartyIdstring?OAuth provider ID
roleIdUUID?FK to role
tenantIdUUID?FK to tenant

Relations:

RelationTypeTargetDescription
roleManyToOneRoleUser's role
tenantManyToOneTenantUser's tenant
employeeOneToOneEmployeeEmployee profile
candidateOneToOneCandidateCandidate profile
tagsManyToManyTagAssociated tags
socialAccountsOneToManySocialAccountOAuth providers

Tenantโ€‹

The Tenant entity is the top-level isolation boundary. All data is scoped to a tenant.

ColumnTypeDescription
idUUIDPrimary key
namestringTenant name
logostring?Logo URL

Relations:

RelationTypeTarget
organizationsOneToManyOrganization
usersOneToManyUser
rolesOneToManyRole
settingsOneToManyTenantSetting
apiKeysOneToManyTenantApiKey

Organizationโ€‹

The Organization entity represents a business unit within a tenant.

ColumnTypeDescription
idUUIDPrimary key
namestringOrganization name
officialNamestring?Legal/official name
currencyenumDefault currency
defaultValueDateTypeenumDate type for budgets
regionCodestring?Region code
imageUrlstring?Organization image
isDefaultbooleanDefault organization flag
totalEmployeesnumber?Total employee count
profile_linkstring?Public profile URL slug
bannerstring?Banner image URL
invitesAllowedboolean?Whether invitations are allowed
bonusTypeenum?Bonus calculation type
bonusPercentagenumber?Bonus percentage
fiscalStartDateDate?Fiscal year start
fiscalEndDateDate?Fiscal year end
futureDateAllowedboolean?Allow future date entries

Roleโ€‹

ColumnTypeDescription
idUUIDPrimary key
namestringRole name (e.g., ADMIN)
isSystembooleanSystem-defined (immutable)
tenantIdUUIDFK to tenant

Built-in Roles: SUPER_ADMIN, ADMIN, DATA_ENTRY, EMPLOYEE, CANDIDATE, MANAGER, VIEWER

RolePermissionโ€‹

ColumnTypeDescription
idUUIDPrimary key
roleIdUUIDFK to role
permissionstringPermission enum value
enabledbooleanWhether enabled
tenantIdUUIDFK to tenant

Entity Relationship Diagramโ€‹