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

export class CreatePermissionDto {
  @ApiProperty({ example: 'stakeholders.create' })
  @IsString()
  @MinLength(1)
  @MaxLength(50)
  name!: string;

  @ApiPropertyOptional({
    example: 'web',
    default: 'web',
    description: 'Auth guard this permission applies to',
  })
  @IsOptional()
  @IsString()
  @MaxLength(50)
  guardName?: string;
}
