import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';

export class CreatePermissionDto {
  @ApiProperty({ example: 'chat' })
  @IsString()
  @IsNotEmpty()
  module: string;

  @ApiProperty({ example: 'send' })
  @IsString()
  @IsNotEmpty()
  action: string;

  @ApiProperty({ example: 'chat.send' })
  @IsString()
  @IsNotEmpty()
  code: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  description?: string;
}
