import { UserRole } from '@/shared/types/app';

export type CommunicationEventType = 'meeting' | 'drill' | 'event' | 'deadline';
export type CommunicationEventTargetLevel = 'system' | 'all' | 'organization' | 'school' | 'campus';

export interface CommunicationEventTargetDto {
  readonly level: CommunicationEventTargetLevel;
  readonly id: string | null;
}

export interface CommunicationEventDto {
  readonly id: string;
  readonly title: string;
  readonly date: string;
  readonly type: CommunicationEventType;
  readonly targetLevel: CommunicationEventTargetLevel;
  readonly roles: readonly UserRole[];
  readonly organizationId: string | null;
  readonly campusId: string | null;
  readonly schoolId: string | null;
  readonly classId: string | null;
  readonly canceledEventId: string | null;
  readonly createdById: string;
  readonly updatedById: string | null;
  readonly createdAt: string;
  readonly updatedAt: string;
}

export interface CommunicationEventCreateDto {
  readonly title: string;
  readonly date: string;
  readonly type: CommunicationEventType;
  readonly roles?: readonly UserRole[];
  readonly targets: readonly CommunicationEventTargetDto[];
}

export interface CommunicationEventUpdateDto {
  readonly id: string;
  readonly title?: string;
  readonly date?: string;
  readonly type?: CommunicationEventType;
  readonly roles?: readonly UserRole[];
  readonly targets?: readonly CommunicationEventTargetDto[];
}

export interface CommunicationEventCancelDto {
  readonly id: string;
  readonly reason?: string;
}
