Skip to content

Commit

Permalink
refac(entities): string as relational references
Browse files Browse the repository at this point in the history
  • Loading branch information
notusertelken committed Sep 19, 2022
1 parent eefadc5 commit 6c4099b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/domain/entities/principal.entity.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Role } from './role.entity';
import { v4 as uuid } from 'uuid';

export class Principal {
id: string;
roles: Role[];
constructor(roles: Role[]) {
roles: string[];
constructor(roles: string[]) {
this.id = uuid();
this.roles = roles;
}
Expand Down
5 changes: 2 additions & 3 deletions src/domain/entities/role.entity.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Scope } from './scope.entity';
import { v4 as uuid } from 'uuid';
export class Role {
id!: string;
name: string;
scopes!: Scope[];
constructor(name: string, scopes: Scope[]) {
scopes!: string[];
constructor(name: string, scopes: string[]) {
this.id = uuid();
this.name = name;
this.scopes = scopes;
Expand Down

0 comments on commit 6c4099b

Please sign in to comment.