Skip to main content

Untitled Diagram documentation

Summary​

Introduction​

Database type​

  • Database system: PostgreSQL

Table structure​

employees​

Core employee entity with organizational & personal info

NameTypeSettingsReferencesNote
idUUIDπŸ”‘ PK, null, unique
employee_codeVARCHARnot nullKIT-0001 etc.
uuid_keycloakVARCHARnullLinked Keycloak user ID
first_nameVARCHARnull
last_nameVARCHARnull
genderVARCHARnullmale, female, diverse, other
birth_dateDATEnull
nationalityVARCHARnull
photo_urlVARCHARnull/uploads/avatars/...
bioTEXTnull
emailVARCHARnot null
phoneVARCHARnull
address_streetVARCHARnull
address_zipVARCHARnull
address_cityVARCHARnull
address_countryVARCHARnull
department_idUUIDnullfk_employees_department_id_departments
role_idUUIDnullfk_employees_role_id_roles
reports_toUUIDnullfk_employees_reports_to_employeesSupervisor
employment_typeVARCHARnullDefault fulltime; values: fulltime, parttime, intern, external
hire_dateDATEnull
termination_dateDATEnull
statusVARCHARnullDefault active; values: active, inactive, on_leave
timezoneVARCHARnullDefault Europe/Berlin
languageVARCHARnullDefault de
themeVARCHARnullDefault catppuccin-frappe
notifications_enabledBOOLEANnullDefault true
matrix_usernameVARCHARnull@user:intern.phudevelopement.xyz
created_atTIMESTAMPnullDefault now()
updated_atTIMESTAMPnullDefault now()
last_loginTIMESTAMPnull

departments​

Organizational unit such as IT, HR, Finance

NameTypeSettingsReferencesNote
idUUIDπŸ”‘ PK, null, unique
nameVARCHARnot null
codeVARCHARnullShort code, e.g. HR, FIN, IT
descriptionTEXTnull
manager_idUUIDnullfk_departments_manager_id_employees
created_atTIMESTAMPnullDefault now()

roles​

System roles and access levels

NameTypeSettingsReferencesNote
idUUIDπŸ”‘ PK, null, unique
nameVARCHARnot null
descriptionTEXTnull
keycloak_idVARCHARnullLinked Keycloak role ID
permissions_jsonJSONBnullList of permissions, e.g. ['hr.view', 'finance.edit']

documents​

Central file storage and reference system

NameTypeSettingsReferencesNote
idUUIDπŸ”‘ PK, null, unique
titleVARCHARnull
file_pathVARCHARnot null
typeVARCHARnullpdf, image, doc, etc.
categoryVARCHARnulle.g. Krankmeldung, Vertrag, Rechnung
owner_idUUIDnullfk_documents_owner_id_employees
linked_moduleVARCHARnullOrigin module e.g. HR, Finance
uploaded_atTIMESTAMPnullDefault now()
checksumVARCHARnull
is_confidentialBOOLEANnullDefault false

reminders​

Universal reminder and notification system

NameTypeSettingsReferencesNote
idUUIDπŸ”‘ PK, null, unique
titleVARCHARnull
descriptionTEXTnull
due_dateDATEnull
priorityVARCHARnulllow, medium, high, critical
linked_entity_typeVARCHARnullTarget type, e.g. Document, Ticket
linked_entity_idUUIDnull
owner_idUUIDnullfk_reminders_owner_id_employees
statusVARCHARnullDefault open; values: open, done, overdue
created_atTIMESTAMPnullDefault now()
notifiedBOOLEANnullDefault false

dashboards​

User-specific workspace layout and preferences

NameTypeSettingsReferencesNote
idUUIDπŸ”‘ PK, null, unique
owner_idUUIDnullfk_dashboards_owner_id_employees
widgets_jsonJSONBnull
layout_jsonJSONBnull
themeVARCHARnullDefault catppuccin-frappe
last_accessedTIMESTAMPnull

infra_services​

Technical integrations managed by admins (DB, Keycloak, Matrix, etc.)

NameTypeSettingsReferencesNote
idUUIDπŸ”‘ PK, null, unique
nameVARCHARnot null
typeVARCHARnulldatabase, auth, mail, chat, storage, external_api
connection_urlVARCHARnull
statusVARCHARnullDefault active
last_syncTIMESTAMPnull
managed_byUUIDnullfk_infra_services_managed_by_employees

Relationships​

  • employees to departments: many_to_one
  • employees to roles: many_to_one
  • employees to employees: many_to_one
  • departments to employees: many_to_one
  • documents to employees: many_to_one
  • reminders to employees: many_to_one
  • dashboards to employees: many_to_one
  • infra_services to employees: many_to_one

Database Diagram​

erDiagram
employees }o--|| departments : references
employees }o--|| roles : references
employees }o--|| employees : references
departments }o--|| employees : references
documents }o--|| employees : references
reminders }o--|| employees : references
dashboards }o--|| employees : references
infra_services }o--|| employees : references

employees {
UUID id
VARCHAR employee_code
VARCHAR uuid_keycloak
VARCHAR first_name
VARCHAR last_name
VARCHAR gender
DATE birth_date
VARCHAR nationality
VARCHAR photo_url
TEXT bio
VARCHAR email
VARCHAR phone
VARCHAR address_street
VARCHAR address_zip
VARCHAR address_city
VARCHAR address_country
UUID department_id
UUID role_id
UUID reports_to
VARCHAR employment_type
DATE hire_date
DATE termination_date
VARCHAR status
VARCHAR timezone
VARCHAR language
VARCHAR theme
BOOLEAN notifications_enabled
VARCHAR matrix_username
TIMESTAMP created_at
TIMESTAMP updated_at
TIMESTAMP last_login
}

departments {
UUID id
VARCHAR name
VARCHAR code
TEXT description
UUID manager_id
TIMESTAMP created_at
}

roles {
UUID id
VARCHAR name
TEXT description
VARCHAR keycloak_id
JSONB permissions_json
}

documents {
UUID id
VARCHAR title
VARCHAR file_path
VARCHAR type
VARCHAR category
UUID owner_id
VARCHAR linked_module
TIMESTAMP uploaded_at
VARCHAR checksum
BOOLEAN is_confidential
}

reminders {
UUID id
VARCHAR title
TEXT description
DATE due_date
VARCHAR priority
VARCHAR linked_entity_type
UUID linked_entity_id
UUID owner_id
VARCHAR status
TIMESTAMP created_at
BOOLEAN notified
}

dashboards {
UUID id
UUID owner_id
JSONB widgets_json
JSONB layout_json
VARCHAR theme
TIMESTAMP last_accessed
}

infra_services {
UUID id
VARCHAR name
VARCHAR type
VARCHAR connection_url
VARCHAR status
TIMESTAMP last_sync
UUID managed_by
}