53 lines
955 B
TypeScript
53 lines
955 B
TypeScript
import { IsArray, IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
import { AccountStatus, StoreStaffRole } from '@dukang/shared-types';
|
|
|
|
export class CreateStoreStaffDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
phone: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
name: string;
|
|
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
storeIds: string[];
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsIn(Object.values(StoreStaffRole))
|
|
staffRole?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
permissions?: string[];
|
|
}
|
|
|
|
export class UpdateStoreStaffDto {
|
|
@IsString()
|
|
@IsOptional()
|
|
name?: string;
|
|
|
|
@IsString()
|
|
@IsIn(Object.values(StoreStaffRole))
|
|
@IsOptional()
|
|
staffRole?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
permissions?: string[];
|
|
|
|
@IsString()
|
|
@IsIn(Object.values(AccountStatus))
|
|
@IsOptional()
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
storeIds?: string[];
|
|
}
|