FIX: new user columns

This commit is contained in:
Gabriel Rosa
2022-07-20 09:50:58 -03:00
parent 5ce8099c25
commit c61c37b268
3 changed files with 15 additions and 25 deletions
+7 -17
View File
@@ -1,5 +1,5 @@
import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';
import { RoleDto, UserRole } from 'src/modules/roles/dto/entities';
import { UserRole } from 'src/modules/roles/dto/entities';
export class Hierarchy {
@ApiProperty()
id: number;
@@ -45,27 +45,17 @@ export class User {
createdAt: string;
@ApiProperty()
updatedAt: string;
@ApiProperty()
status: string;
@ApiPropertyOptional()
lastLogin?: string;
}
export class UserNoRoles extends OmitType(User, ['roles']) {}
export class UserNoRolesAndCustomer extends OmitType(UserNoRoles, [
'customer',
]) {}
export class UserByCustomer {
@ApiProperty({ type: [RoleDto] })
roles: RoleDto[];
@ApiProperty()
id: string;
@ApiProperty()
name: string;
@ApiProperty()
username: string;
@ApiProperty()
mfaStatus: string;
@ApiProperty()
createdAt: string;
@ApiProperty()
updatedAt: string;
}
export class UserByCustomer extends OmitType(User, ['customer']) {}
export class CreateUserReq {
@ApiPropertyOptional()
name?: string;