Organization
Top-level container for all resources. Defines the multi-tenant boundary, login settings, and external identity mappings. Collection:
organizations| DB: MongoDB Source:hbf-core/src/main/java/gr/helvia/hbf/core/domain/Organization.ktTypeScript:hbf-core-api/src/datamodel/organization.ts
Fields
| Field | Type | Required | Indexed | Notes |
|---|---|---|---|---|
id | String | yes | PK | MongoDB document ID |
displayName | String | yes | Organization name | |
image | String | no | Logo URL | |
timezone | String | no | Default: "UTC" | |
auditLogsNotificationEmail | String | no | Email for audit notifications | |
auditLogsNotificationsEnabled | Boolean | no | ||
externalOrganizations | List<ExternalEntity> | no | MS Teams org mappings | |
externalAnalytics | List<ExternalAnalytics> | no | ||
dataRetentionPeriod | Int | no | In days | |
auditLogsRetentionPeriod | Int | no | In days | |
loginSettings | LoginSettings | no | With defaults | |
createdAt | Date | yes | @CreatedDate | |
updatedAt | Date | yes | @LastModifiedDate |
Nested Objects
LoginSettings
| Field | Type | Notes |
|---|---|---|
isOrganizationNameVisible | Boolean | |
isOrganizationLogoVisible | Boolean | |
isCustomMessageVisible | Boolean | |
customMessage | String | |
isCredentialLoginVisible | Boolean | |
isGoogleLoginVisible | Boolean | |
isMicrosoftLoginVisible | Boolean | |
isSkipNativeLoginEnabled | Boolean | |
failedAuthenticationRedirectUrl | String | |
integrations | List<Integration> | @DBRef lazy, read-only. Auth integrations |
plugins | List<IntegrationPlugin> | Private, computed |
isAutoUserCreationEnabled | Boolean | @PrivateProperty |
defaultAutoCreationRole | OrganizationRole | @PrivateProperty |
suppressWelcomeEmail | Boolean | @PrivateProperty |
isPostAuthenticationEnabled | Boolean | @PrivateProperty |
postAuthenticationRequestUrl | String | @PrivateProperty |
postAuthenticationRequestHeaders | Map<String, String> | @PrivateProperty |
roleMap | Map<String, OrganizationRole> | @PrivateProperty, maps external claims to roles |
pluginRefs | List<String> | @Transient, @WriteOnly |
ExternalEntity (polymorphic)
Base fields:
| Field | Type | Notes |
|---|---|---|
id | String | |
createdAt | Date |
Subtypes:
- NoneType - no additional fields
- MsTeamsChannel -
channelId,azureTenantId,aadGroupId - MsTeamsOrganization -
azureTenantId - MsTeamsUser -
aadObjectId
Enums
OrganizationRole
| Value | Description |
|---|---|
HBF_ORG_ADMIN | Organization administrator |
HBF_ORG_EDITOR | Organization editor |
HBF_ORG_VIEWER | Organization viewer (read-only) |
HBF_ORG_LIVE_AGENT | Live chat agent |
HRWIZ_EMPLOYEE | HR Wizard employee |
HBF_ORG_LIVECHAT_ADMIN | Live chat administrator |
Relationships
- Contains: User (1..), Tenant (1..), AuditLog (0..), ApiToken (0..), KnowledgeBase (0..), Integration (0..), Tag (0..), UserInvitation (0..)
- Configures: LoginSettings with Integration plugins
TypeScript Mapping
| hbf-core (Kotlin) | hbf-core-api (TypeScript) | Notes |
|---|---|---|
| Organization | Organization | TS has analytics, users, externalId. Missing loginSettings, auditLogs*, externalOrganizations |
| LoginSettings | (not exported) | Gap: not in hbf-core-api types |
| ExternalEntity | ExternalChannel + MSTeamsExternalChannel | Different naming. In userGroup.ts |
| OrganizationRole | OrganizationRole | Aligned |