/* eslint-disable @typescript-eslint/no-unused-vars */ import { ICustomRole } from 'lib/types/model'; import { IRole, IUserRole } from 'lib/types/stores/access-store'; import { ICustomRoleInsert, ICustomRoleUpdate, IRoleStore, } from 'lib/types/stores/role-store'; export default class FakeRoleStore implements IRoleStore { count(): Promise { return Promise.resolve(0); } roles: ICustomRole[] = []; getGroupRolesForProject(projectId: string): Promise { throw new Error('Method not implemented.'); } nameInUse(name: string, existingId?: number): Promise { throw new Error('Method not implemented.'); } async getAll(): Promise { return this.roles; } async create(role: ICustomRoleInsert): Promise { const roleCreated = { ...role, type: 'some-type', id: this.roles.length, }; this.roles.push(roleCreated); return Promise.resolve(roleCreated); } update(role: ICustomRoleUpdate): Promise { throw new Error('Method not implemented.'); } delete(id: number): Promise { throw new Error('Method not implemented.'); } getRoles(): Promise { throw new Error('Method not implemented.'); } async getRoleByName(name: string): Promise { return this.roles.find((r) => (r.name = name)); } getRolesForProject(projectId: string): Promise { throw new Error('Method not implemented.'); } removeRolesForProject(projectId: string): Promise { throw new Error('Method not implemented.'); } getProjectRoles(): Promise { throw new Error('Method not implemented.'); } async getRootRoles(): Promise { return this.roles; } getRootRoleForAllUsers(): Promise { throw new Error('Method not implemented.'); } get(key: number): Promise { throw new Error('Method not implemented.'); } exists(key: number): Promise { throw new Error('Method not implemented.'); } deleteAll(): Promise { throw new Error('Method not implemented.'); } destroy(): void { throw new Error('Method not implemented.'); } }