import { ApiProperty } from '@nestjs/swagger';
import { UserLicenseDTO } from './user-license-dto';
import { IsArray, IsEmail, IsEnum, IsInt, IsNotEmpty } from 'class-validator';
import { SiteLanguage } from '../types/site-language';

export const SYSTEM_USER_ID = 1;
export const SYSTEM_USER_ROLE_ID = 1000;

export class UserDTO {
  @IsInt()
  @IsNotEmpty()
  @ApiProperty({})
  id: number;

  @IsEmail()
  @IsNotEmpty()
  @ApiProperty({})
  name: string;

  @IsEmail()
  @IsNotEmpty()
  @ApiProperty({})
  email: string;

  @IsEmail()
  @IsNotEmpty()
  @ApiProperty({})
  roleId: number;

  @IsArray()
  @ApiProperty({})
  licenses: UserLicenseDTO[];

  @IsEnum(SiteLanguage)
  @IsNotEmpty()
  @ApiProperty({})
  language: SiteLanguage;
}
