import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsNotEmpty } from 'class-validator';
import { SiteLanguage } from '../../common/types/site-language';
import {
  ApiFilterParamsDecorator,
  ApiGetListParams,
} from '../../common/types/api-filter-params';

export class UserRoleDTO {
  @ApiProperty({})
  num: number;

  @ApiProperty({})
  title: string;

  @ApiProperty({})
  isAdmin: boolean;
}

export class UserRoleDTOWhere {}

@ApiFilterParamsDecorator(UserRoleDTOWhere)
export class UserRoleQueryDTO extends ApiGetListParams<UserRoleDTOWhere> {}

export class ChangeUserProfileDTO {
  @ApiProperty({ type: Date })
  dateOfBirth: string;

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