Skip to content

Commit

Permalink
fix(mixin): refactor user interface
Browse files Browse the repository at this point in the history
refactor user interface

gh-107
  • Loading branch information
Tyagi-Sunny committed Apr 2, 2024
1 parent 262811b commit 01e89dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/__tests__/unit/audit.mixin.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ const mockOpts: IAuditMixinOptions = {
const mockUser: User = {
id: 'testCurrentUserId',
username: 'testCurrentUserName',
authClientId: 123,
permissions: ['1', '2', '3'],
role: 'admin',
firstName: 'test',
lastName: 'lastname',
Expand Down
15 changes: 5 additions & 10 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,16 @@ export type AuditMixinBase<T extends Entity, ID, Relations> = MixinBaseClass<{
}>;

export interface User<ID = string, TID = string, UTID = string> {
id?: string;
username: string;
password?: string;
id?: string | number;
username?: string;
identifier?: ID;
permissions: string[];
authClientId: number;
email?: string;
role: string;
firstName: string;
lastName: string;
role?: string;
firstName?: string;
lastName?: string;
middleName?: string;
tenantId?: TID;
userTenantId?: UTID;
passwordExpiryTime?: Date;
allowedResources?: string[];
}

export type ActorId = Extract<keyof User, string>;

0 comments on commit 01e89dc

Please sign in to comment.