Skip to content

Commit

Permalink
Documentation and return type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PahaKoha committed Oct 22, 2023
1 parent 43e6f89 commit 76fc89c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/domain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function init(repositories: Repositories, appConfig: AppConfig): DomainSe

const aiService = new AIService(repositories.aiRepository);
const editorToolsService = new EditorToolsService(repositories.editorToolsRepository);
const userListService = new UserListService(repositories.userListRepository)
const userListService = new UserListService(repositories.userListRepository);

return {
noteService,
Expand All @@ -79,6 +79,6 @@ export function init(repositories: Repositories, appConfig: AppConfig): DomainSe
authService,
aiService,
editorToolsService,
userListService
userListService,
};
}
7 changes: 4 additions & 3 deletions src/domain/service/userListService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import type { UserList } from '@domain/entities/userList';


/**
* User List service
* User List service
*/
export default class UserListService {
public readonly repository: UserListRepository;

/**
* User List service constructor
* @param repository - userList repository instance
* User List service constructor
*
* @param repository - userList repository instance
*/
constructor(repository: UserListRepository) {
this.repository = repository;
Expand Down
1 change: 1 addition & 0 deletions src/presentation/http/router/userList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface UsersRouterOptions {
*/
const AllUsersRouter: FastifyPluginCallback<UsersRouterOptions> = (fastify, opts, done) => {
const usersService = opts.userListService;

/**
* Get all users
*/
Expand Down
4 changes: 2 additions & 2 deletions src/repository/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export async function init(orm: Orm): Promise<Repositories> {
const aiRepository = new AIRepository(openaiApiTransport);
const editorToolsRepository = new EditorToolsRepository(editorToolsStorage);
const teamRepository = new TeamRepository(teamStorage);
const userListRepository = new UserListRepository(userStorage)
const userListRepository = new UserListRepository(userStorage);

return {
noteRepository,
Expand All @@ -135,6 +135,6 @@ export async function init(orm: Orm): Promise<Repositories> {
aiRepository,
editorToolsRepository,
teamRepository,
userListRepository
userListRepository,
};
}
4 changes: 2 additions & 2 deletions src/repository/storage/postgres/orm/sequelize/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ export default class UserSequelizeStorage {
};
}


/**
* Get list users
* @returns { Promise<UserList> } - found all users
* Get all users
*/
public async getAllUsers(): Promise<User[]> {
const userList = await this.model.findAll({ });
Expand Down
6 changes: 2 additions & 4 deletions src/repository/userList.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type User from '@domain/entities/user';


/**
*
* Repository allows accessing data from business-logic (domain) level
*/
export default class UserListRepository {
public storage: UserStorage;
Expand All @@ -17,9 +17,7 @@ export default class UserListRepository {
}

/**
* Gets note list by creator id
*
* @returns { Promise<UserList> } user
* Get all users
*/
public async getAllUsers(): Promise<User[]> {
return await this.storage.getAllUsers();
Expand Down

0 comments on commit 76fc89c

Please sign in to comment.