mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-10 08:19:09 +00:00
FEAT: new user endpoints
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';
|
||||
import { RoleDto } from 'src/modules/roles/dto/entities';
|
||||
import { RoleDto, UserRole } from 'src/modules/roles/dto/entities';
|
||||
export class Customer {
|
||||
@ApiProperty()
|
||||
id: string;
|
||||
@@ -23,8 +23,8 @@ export class User {
|
||||
name: string;
|
||||
@ApiProperty()
|
||||
email: string;
|
||||
@ApiProperty({ type: [RoleDto] })
|
||||
roles: RoleDto[];
|
||||
@ApiProperty({ type: [UserRole] })
|
||||
roles: UserRole[];
|
||||
@ApiProperty()
|
||||
jobTitle?: string;
|
||||
@ApiProperty()
|
||||
@@ -66,7 +66,7 @@ export class CreateUserReq {
|
||||
@ApiProperty()
|
||||
email: string;
|
||||
@ApiPropertyOptional()
|
||||
roles?: string[];
|
||||
roleNames?: string[];
|
||||
@ApiPropertyOptional()
|
||||
jobTitle?: string;
|
||||
@ApiPropertyOptional()
|
||||
@@ -84,15 +84,15 @@ export class BatchCreateUserReq {
|
||||
}
|
||||
export class BatchCreateUserRes {
|
||||
@ApiProperty({ type: [User] })
|
||||
users: User[];
|
||||
usersCreated: User[];
|
||||
@ApiProperty({ type: [CreateUserReq] })
|
||||
errorUsers: CreateUserReq[];
|
||||
}
|
||||
|
||||
export class UpdateUserReq {
|
||||
@ApiPropertyOptional()
|
||||
name?: string;
|
||||
@ApiPropertyOptional()
|
||||
roles?: string[];
|
||||
@ApiPropertyOptional()
|
||||
jobTitle?: string;
|
||||
@ApiPropertyOptional()
|
||||
department?: string;
|
||||
@@ -100,6 +100,11 @@ export class UpdateUserReq {
|
||||
hierarchy?: number;
|
||||
}
|
||||
|
||||
export class UpdateUserRes {
|
||||
@ApiProperty()
|
||||
user: UserByCustomer;
|
||||
}
|
||||
|
||||
export class GetAllUsersByCustomerIdReq {
|
||||
@ApiPropertyOptional()
|
||||
s?: string;
|
||||
@@ -131,4 +136,16 @@ export class SearchUserReq {
|
||||
s: string;
|
||||
}
|
||||
|
||||
export class SetUserRolesReq {
|
||||
@ApiProperty()
|
||||
userId: string;
|
||||
@ApiProperty()
|
||||
roleNames: string[];
|
||||
}
|
||||
|
||||
export class SetUserRolesRes {
|
||||
@ApiProperty()
|
||||
user: UserByCustomer;
|
||||
}
|
||||
|
||||
export class SearchUserRes extends GetAllUsersByCustomerIdRes {}
|
||||
|
||||
Reference in New Issue
Block a user