From ae414dcfb00215fa9adbc4fc7d8dd9b602f373f6 Mon Sep 17 00:00:00 2001 From: sbriat Date: Fri, 27 Jan 2023 16:56:04 +0100 Subject: [PATCH] minor refactor --- ...secase.spec.ts => authentication.messager.usecase.spec.ts} | 0 ...sager.usecase.spec.ts => logging.messager.usecase.spec.ts} | 0 .../src/adapters/secondaries/prisma-repository.abstract.ts | 4 +--- src/modules/database/src/interfaces/repository.interface.ts | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) rename src/modules/authentication/tests/unit/{authentication-messager.usecase.spec.ts => authentication.messager.usecase.spec.ts} (100%) rename src/modules/authentication/tests/unit/{logging-messager.usecase.spec.ts => logging.messager.usecase.spec.ts} (100%) diff --git a/src/modules/authentication/tests/unit/authentication-messager.usecase.spec.ts b/src/modules/authentication/tests/unit/authentication.messager.usecase.spec.ts similarity index 100% rename from src/modules/authentication/tests/unit/authentication-messager.usecase.spec.ts rename to src/modules/authentication/tests/unit/authentication.messager.usecase.spec.ts diff --git a/src/modules/authentication/tests/unit/logging-messager.usecase.spec.ts b/src/modules/authentication/tests/unit/logging.messager.usecase.spec.ts similarity index 100% rename from src/modules/authentication/tests/unit/logging-messager.usecase.spec.ts rename to src/modules/authentication/tests/unit/logging.messager.usecase.spec.ts diff --git a/src/modules/database/src/adapters/secondaries/prisma-repository.abstract.ts b/src/modules/database/src/adapters/secondaries/prisma-repository.abstract.ts index 8d80045..ea1622c 100644 --- a/src/modules/database/src/adapters/secondaries/prisma-repository.abstract.ts +++ b/src/modules/database/src/adapters/secondaries/prisma-repository.abstract.ts @@ -74,8 +74,6 @@ export abstract class PrismaRepository implements IRepository { } } - // TODO : using any is not good, but needed for nested entities - // TODO : Refactor for good clean architecture ? async create(entity: Partial | any, include?: any): Promise { try { const res = await this._prisma[this._model].create({ @@ -143,7 +141,7 @@ export abstract class PrismaRepository implements IRepository { } } - async delete(uuid: string): Promise { + async delete(uuid: string): Promise { try { const entity = await this._prisma[this._model].delete({ where: { uuid }, diff --git a/src/modules/database/src/interfaces/repository.interface.ts b/src/modules/database/src/interfaces/repository.interface.ts index 28a79c9..8912545 100644 --- a/src/modules/database/src/interfaces/repository.interface.ts +++ b/src/modules/database/src/interfaces/repository.interface.ts @@ -12,6 +12,6 @@ export interface IRepository { create(entity: Partial | any, include?: any): Promise; update(uuid: string, entity: Partial, include?: any): Promise; updateWhere(where: any, entity: Partial | any, include?: any): Promise; - delete(uuid: string): Promise; + delete(uuid: string): Promise; deleteMany(where: any): Promise; }