role
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class CreateAdminDto {
|
||||
@ApiProperty({ description: 'Mobile phone number' })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
phone!: string;
|
||||
|
||||
@ApiProperty({ description: 'First name', required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
firstName?: string;
|
||||
|
||||
@ApiProperty({ description: 'Last name', required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
lastName?: string;
|
||||
|
||||
@ApiProperty({ description: 'Role id for the admin' })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
roleId!: string;
|
||||
|
||||
@ApiProperty({ description: 'Restaurant id' })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
restId!: string;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
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: 'Restaurant id (optional)', required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
restId?: string;
|
||||
|
||||
@ApiProperty({ description: 'List of permission IDs', isArray: true, required: false })
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
permissionIds?: string[];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, IsString, IsNumber } from 'class-validator';
|
||||
|
||||
export class FindRolesDto {
|
||||
@ApiProperty({ description: 'Search by role name', required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
name?: string;
|
||||
|
||||
@ApiProperty({ description: 'Restaurant id filter', required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
restId?: string;
|
||||
|
||||
@ApiProperty({ description: 'Page number', required: false, default: 1 })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
page?: number;
|
||||
|
||||
@ApiProperty({ description: 'Items per page', required: false, default: 20 })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
limit?: number;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, IsString, IsArray } from 'class-validator';
|
||||
|
||||
export class UpdateRoleDto {
|
||||
@ApiProperty({ description: 'Role name', required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
name?: string;
|
||||
|
||||
@ApiProperty({ description: 'List of permission IDs', isArray: true, required: false })
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
permissionIds?: string[];
|
||||
}
|
||||
Reference in New Issue
Block a user