25 lines
618 B
TypeScript
25 lines
618 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsNotEmpty, IsString, IsArray, IsOptional } from 'class-validator';
|
|
|
|
export class CreateRoleDto {
|
|
@ApiProperty({ description: 'Role name' })
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
name!: string;
|
|
|
|
@ApiProperty({ description: 'Role title' })
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
title!: string;
|
|
|
|
@ApiProperty({ description: 'Restaurant id (optional)', required: false })
|
|
@IsOptional()
|
|
@IsString()
|
|
restId?: string;
|
|
|
|
@ApiProperty({ description: 'List of permission IDs', isArray: true, required: false })
|
|
@IsOptional()
|
|
@IsArray()
|
|
permissionIds?: string[];
|
|
}
|