import {
  IsInt,
  IsNotEmpty,
  IsObject,
  IsOptional,
  IsString,
} from 'class-validator';

export type JsonValue =
  | string
  | number
  | boolean
  | null
  | JsonObject
  | JsonValue[];

export type JsonObject = {
  [key: string]: JsonValue;
};

export class CreateSystemNotificationDto {
  @IsString()
  @IsNotEmpty()
  title!: string;

  @IsString()
  @IsNotEmpty()
  message!: string;

  @IsString()
  @IsOptional()
  type?: string;

  @IsInt()
  @IsOptional()
  senderUserId?: number;

  @IsInt()
  @IsOptional()
  receiverUserId?: number;

  @IsInt()
  @IsOptional()
  receiverStakeholderId?: number;

  @IsInt()
  @IsOptional()
  meetingRequestId?: number;

  @IsObject()
  @IsOptional()
  data?: JsonObject;
}
