Files
tessera-ctl/apps/api/src/calendar/dto/update-calendar-source.dto.ts
T
schalli 42daa87e5e feat(calendar): add domain field and test-connection button to Exchange sources
- Prisma: domain String? added to CalendarSource model (db push applied)
- DTOs: domain in CreateCalendarSourceDto, UpdateCalendarSourceDto, new TestCalendarSourceConfigDto
- Service: domain in SOURCE_SAFE_SELECT, addSource, updateSource; new testConnectionFromConfig method
- Controller: POST /calendar/sources/test-config (before :id routes to avoid collision)
- ExchangeProvider: domain in all source interfaces; passed as 3rd arg to EWS WebCredentials
- Frontend: domain in CalendarSource/CreateSourcePayload/UpdateSourcePayload; testSourceConfig API fn
- Form: domain field (Exchange-only), "Test connection" button with idle/loading/success/error states
- i18n: de+en keys for formFieldDomain, formFieldDomainHint, formTestConnection, formTesting, formTestSuccess, formTestFailed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 13:15:13 +02:00

60 lines
1.0 KiB
TypeScript

import {
IsBoolean,
IsHexColor,
IsIn,
IsNotEmpty,
IsOptional,
IsString,
IsUrl,
} from 'class-validator';
/**
* DTO for updating an existing calendar source.
* All fields are optional — only provided fields are updated.
*
* Security:
* - T-05-11: URL restricted to https only if provided
* - CAL-02: isVisible toggle for widget source visibility
*/
export class UpdateCalendarSourceDto {
@IsOptional()
@IsString()
@IsNotEmpty()
name?: string;
@IsOptional()
@IsIn(['caldav', 'ics', 'exchange'])
type?: string;
@IsOptional()
@IsUrl(
{ protocols: ['https'], require_protocol: true },
{ message: 'URL must use HTTPS protocol' },
)
url?: string;
@IsOptional()
@IsString()
username?: string;
@IsOptional()
@IsString()
password?: string;
@IsOptional()
@IsIn(['ews', 'graph'])
exchangeMode?: string;
@IsOptional()
@IsString()
domain?: string;
@IsOptional()
@IsHexColor()
color?: string;
@IsOptional()
@IsBoolean()
isVisible?: boolean;
}