bmc_hub/migrations/1035_email_connection_configuration.sql
Christian abfb945679 feat(planner): add overdue cases handling and improve case rendering
- Introduced `overdueCases` state to track overdue cases in the planner.
- Enhanced `loadCases` function to fetch and store overdue cases.
- Updated `renderCases` to display overdue cases with appropriate labels.
- Modified case card rendering to highlight overdue cases.

fix(telefoni): ensure WebSocket connection on DOMContentLoaded

- Adjusted WebSocket connection logic to handle cases where the script loads after DOMContentLoaded.

test(tests): add tests for case creation and internal ticket handling

- Added tests to ensure ticket creation commits all optional data.
- Implemented tests for internal ticket creation, ensuring correct customer and user assignments.

feat(migrations): add new tables for email configuration and case assignments

- Created `email_connection_configurations` table for managing email settings.
- Introduced `sag_case_assignees` table to handle individual case assignments.
- Added `sag_case_details` table for structured case type details.
- Updated existing case types to align with new templates and added support for internal tickets.

fix(timetracking): allow manual time creation without case customer

- Modified manual time creation to support entries without a customer.
- Updated settlement options to recommend internal settlement for customerless time.

feat(v4): enhance case detail template with new features

- Added new features to the case detail template, including compact icons and inline relation creation.
- Improved comment actions and time tracking functionalities.
2026-09-20 03:33:10 +02:00

31 lines
1.4 KiB
SQL

-- Central, encrypted configuration for the mailbox BMC Hub reads and sends from.
-- Secrets are stored as a Fernet-encrypted JSON blob and are never returned by the API.
CREATE TABLE IF NOT EXISTS email_connection_configurations (
id SERIAL PRIMARY KEY,
provider VARCHAR(30) NOT NULL CHECK (provider IN ('microsoft365_graph', 'imap_smtp')),
is_enabled BOOLEAN NOT NULL DEFAULT false,
mailbox_address VARCHAR(320) NOT NULL,
sender_name VARCHAR(255) NOT NULL DEFAULT 'BMC Hub',
imap_host VARCHAR(255),
imap_port INTEGER NOT NULL DEFAULT 993,
imap_folder VARCHAR(255) NOT NULL DEFAULT 'INBOX',
imap_use_ssl BOOLEAN NOT NULL DEFAULT true,
smtp_host VARCHAR(255),
smtp_port INTEGER NOT NULL DEFAULT 587,
smtp_use_tls BOOLEAN NOT NULL DEFAULT true,
graph_tenant_id VARCHAR(255),
graph_client_id VARCHAR(255),
secrets_encrypted TEXT,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_by_user_id INTEGER
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_email_connection_singleton
ON email_connection_configurations ((1));
DROP TRIGGER IF EXISTS email_connection_configurations_updated_at_trigger ON email_connection_configurations;
CREATE TRIGGER email_connection_configurations_updated_at_trigger
BEFORE UPDATE ON email_connection_configurations
FOR EACH ROW EXECUTE FUNCTION update_settings_updated_at();