Skip to content

Commit

Permalink
feat: added segreged dtos
Browse files Browse the repository at this point in the history
  • Loading branch information
seba1288 committed Sep 30, 2024
1 parent f7eb8fd commit 5fae94f
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Expose, Type } from 'class-transformer';
import { IsDefined } from 'class-validator';
import { GroupDto } from 'src/groups/dtos/group.dto';
import { GroupDto } from 'src/core/groups/dtos';
import { AccountBasicDto, SystemStatus } from 'src/libs/shared';
import { RoleDto } from 'src/roles/dtos/role.dto';
import { RoleDto } from 'src/core/role/dtos/role.dto';

export class UserAccountDto extends AccountBasicDto {
@Expose()
Expand Down
1 change: 1 addition & 0 deletions src/core/accounts/dtos/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './account.dto';
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions src/core/groups/dtos/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './create-group.dto';
export * from './join-group.dto';
export * from './group.dto';
File renamed without changes.
1 change: 1 addition & 0 deletions src/core/role/dtos/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './role.dto';
27 changes: 27 additions & 0 deletions src/core/role/dtos/role.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Expose, Type } from 'class-transformer';
import { IsDefined } from 'class-validator';
import { Action, BaseDto, Subject, SystemStatus } from 'src/libs/shared';

export class PermissionRule {
@Expose()
action!: Action;

@Expose()
subject!: Subject;
}

export class RoleDto extends BaseDto {
@Expose()
name!: string;

@Expose()
code!: string;

@Expose()
@Type(() => PermissionRule)
permissions!: PermissionRule[];

@Expose()
@IsDefined()
status!: SystemStatus;
}
14 changes: 0 additions & 14 deletions src/groups/dtos/join-group.dto.ts

This file was deleted.

0 comments on commit 5fae94f

Please sign in to comment.