mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-12 18:59:08 +00:00
FEAT: Roles WIP
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';
|
||||
import { Role } from 'src/modules/roles/dto/entities';
|
||||
export class Customer {
|
||||
@ApiProperty()
|
||||
@@ -26,35 +26,13 @@ export class User {
|
||||
@ApiProperty({ type: [Role] })
|
||||
roles: Role[];
|
||||
@ApiProperty()
|
||||
jobTitle: string;
|
||||
jobTitle?: string;
|
||||
@ApiProperty()
|
||||
department: string;
|
||||
department?: string;
|
||||
@ApiProperty()
|
||||
hierarchy: string;
|
||||
@ApiProperty()
|
||||
customer: Customer;
|
||||
@ApiProperty()
|
||||
mfaStatus: string;
|
||||
@ApiProperty()
|
||||
createdAt: string;
|
||||
@ApiProperty()
|
||||
updatedAt: string;
|
||||
}
|
||||
export class UserWithoutRoles {
|
||||
@ApiProperty()
|
||||
id: string;
|
||||
@ApiProperty()
|
||||
name: string;
|
||||
@ApiProperty()
|
||||
email: string;
|
||||
@ApiProperty()
|
||||
jobTitle: string;
|
||||
@ApiProperty()
|
||||
department: string;
|
||||
@ApiProperty()
|
||||
hierarchy: string;
|
||||
@ApiProperty()
|
||||
customer: Customer;
|
||||
hierarchy?: string;
|
||||
@ApiPropertyOptional()
|
||||
customer?: Customer;
|
||||
@ApiProperty()
|
||||
mfaStatus: string;
|
||||
@ApiProperty()
|
||||
@@ -62,6 +40,10 @@ export class UserWithoutRoles {
|
||||
@ApiProperty()
|
||||
updatedAt: string;
|
||||
}
|
||||
export class UserNoRoles extends OmitType(User, ['roles']) {}
|
||||
export class UserNoRolesAndCustomer extends OmitType(UserNoRoles, [
|
||||
'customer',
|
||||
]) {}
|
||||
export class UserByCustomer {
|
||||
@ApiProperty({ type: [Role] })
|
||||
roles: Role[];
|
||||
@@ -80,17 +62,17 @@ export class UserByCustomer {
|
||||
}
|
||||
export class CreateUserReq {
|
||||
@ApiPropertyOptional()
|
||||
name: string;
|
||||
name?: string;
|
||||
@ApiProperty()
|
||||
email: string;
|
||||
@ApiPropertyOptional()
|
||||
roles: string[];
|
||||
roles?: string[];
|
||||
@ApiPropertyOptional()
|
||||
jobTitle: string;
|
||||
jobTitle?: string;
|
||||
@ApiPropertyOptional()
|
||||
department: string;
|
||||
department?: string;
|
||||
@ApiPropertyOptional()
|
||||
hierarchy: string;
|
||||
hierarchy?: string;
|
||||
}
|
||||
export class CreateUserRes {
|
||||
@ApiProperty()
|
||||
@@ -107,7 +89,7 @@ export class BatchCreateUserRes {
|
||||
|
||||
export class GetAllUsersByCustomerIdReq {
|
||||
@ApiPropertyOptional()
|
||||
s: string;
|
||||
s?: string;
|
||||
}
|
||||
export class GetAllUsersByCustomerIdRes {
|
||||
@ApiProperty({ type: [UserByCustomer] })
|
||||
|
||||
Reference in New Issue
Block a user