diff --git a/.prettierrc b/.prettierrc index 3e189a3..9db28a2 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { "singleQuote": true, "trailingComma": "all", - "printWidth": 140 + "printWidth": 120 } diff --git a/src/common/interceptors/transform-response.interceptor.ts b/src/common/interceptors/transform-response.interceptor.ts index ca014e8..c1a8364 100644 --- a/src/common/interceptors/transform-response.interceptor.ts +++ b/src/common/interceptors/transform-response.interceptor.ts @@ -23,8 +23,14 @@ function isPaginatedResult(value: unknown): value is PaginatedResult { } @Injectable() -export class TransformResponseInterceptor implements NestInterceptor | PaginatedResponseEnvelope> { - intercept(context: ExecutionContext, next: CallHandler): Observable | PaginatedResponseEnvelope> { +export class TransformResponseInterceptor implements NestInterceptor< + T, + T | ResponseEnvelope | PaginatedResponseEnvelope +> { + intercept( + context: ExecutionContext, + next: CallHandler, + ): Observable | PaginatedResponseEnvelope> { if (context.getType() !== 'http') { return next.handle(); } diff --git a/src/modules/comment/application/services/comment-access.service.ts b/src/modules/comment/application/services/comment-access.service.ts index 210e3a9..b705ca9 100644 --- a/src/modules/comment/application/services/comment-access.service.ts +++ b/src/modules/comment/application/services/comment-access.service.ts @@ -1,6 +1,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { COMMENT_REPOSITORY, type ICommentRepository } from '../../domain/repositories/comment.repository.interface.js'; -import { ISSUE_REPOSITORY, type IIssueRepository } from '../../../issue/domain/repositories/issue.repository.interface.js'; +import { + ISSUE_REPOSITORY, + type IIssueRepository, +} from '../../../issue/domain/repositories/issue.repository.interface.js'; import { Comment } from '../../domain/entities/comment.entity.js'; import { CommentNotFoundException } from '../../domain/exceptions/comment-not-found.exception.js'; diff --git a/src/modules/comment/application/use-cases/create-comment/create-comment.use-case.spec.ts b/src/modules/comment/application/use-cases/create-comment/create-comment.use-case.spec.ts index e0745d9..20dd077 100644 --- a/src/modules/comment/application/use-cases/create-comment/create-comment.use-case.spec.ts +++ b/src/modules/comment/application/use-cases/create-comment/create-comment.use-case.spec.ts @@ -49,7 +49,9 @@ describe('CreateCommentUseCase', () => { it('throws IssueNotFoundException when the issue is not visible to the user', async () => { vi.mocked(issueRepository.findById).mockResolvedValue(null); - await expect(useCase.execute(new CreateCommentCommand(1, 'user-2', 'Hello'))).rejects.toThrow(IssueNotFoundException); + await expect(useCase.execute(new CreateCommentCommand(1, 'user-2', 'Hello'))).rejects.toThrow( + IssueNotFoundException, + ); expect(commentRepository.create).not.toHaveBeenCalled(); }); }); diff --git a/src/modules/comment/application/use-cases/create-comment/create-comment.use-case.ts b/src/modules/comment/application/use-cases/create-comment/create-comment.use-case.ts index bd474e4..fcc223d 100644 --- a/src/modules/comment/application/use-cases/create-comment/create-comment.use-case.ts +++ b/src/modules/comment/application/use-cases/create-comment/create-comment.use-case.ts @@ -1,6 +1,12 @@ import { Inject, Injectable } from '@nestjs/common'; -import { COMMENT_REPOSITORY, type ICommentRepository } from '../../../domain/repositories/comment.repository.interface.js'; -import { ISSUE_REPOSITORY, type IIssueRepository } from '../../../../issue/domain/repositories/issue.repository.interface.js'; +import { + COMMENT_REPOSITORY, + type ICommentRepository, +} from '../../../domain/repositories/comment.repository.interface.js'; +import { + ISSUE_REPOSITORY, + type IIssueRepository, +} from '../../../../issue/domain/repositories/issue.repository.interface.js'; import { IssueNotFoundException } from '../../../../issue/domain/exceptions/issue-not-found.exception.js'; import { Comment } from '../../../domain/entities/comment.entity.js'; import { CreateCommentCommand } from './create-comment.command.js'; diff --git a/src/modules/comment/application/use-cases/delete-comment/delete-comment.use-case.spec.ts b/src/modules/comment/application/use-cases/delete-comment/delete-comment.use-case.spec.ts index 7c587ca..0bd669c 100644 --- a/src/modules/comment/application/use-cases/delete-comment/delete-comment.use-case.spec.ts +++ b/src/modules/comment/application/use-cases/delete-comment/delete-comment.use-case.spec.ts @@ -8,7 +8,13 @@ import { CommentEventsService, type CommentEvent } from '../../services/comment- import { CommentAccessService } from '../../services/comment-access.service.js'; import { DeleteCommentUseCase } from './delete-comment.use-case.js'; import { DeleteCommentCommand } from './delete-comment.command.js'; -import { buildComment, buildIssue, mockAuthorExpander, mockCommentRepository, mockIssueRepository } from '../test-helpers.js'; +import { + buildComment, + buildIssue, + mockAuthorExpander, + mockCommentRepository, + mockIssueRepository, +} from '../test-helpers.js'; describe('DeleteCommentUseCase', () => { let commentRepository: ICommentRepository; @@ -46,13 +52,17 @@ describe('DeleteCommentUseCase', () => { it('throws CommentForbiddenException for a non-author', async () => { vi.mocked(commentRepository.findById).mockResolvedValue(buildComment()); - await expect(useCase.execute(new DeleteCommentCommand('comment-1', 'user-2'))).rejects.toThrow(CommentForbiddenException); + await expect(useCase.execute(new DeleteCommentCommand('comment-1', 'user-2'))).rejects.toThrow( + CommentForbiddenException, + ); expect(commentRepository.update).not.toHaveBeenCalled(); }); it('throws CommentNotFoundException when the comment does not exist', async () => { vi.mocked(commentRepository.findById).mockResolvedValue(null); - await expect(useCase.execute(new DeleteCommentCommand('missing', 'user-1'))).rejects.toThrow(CommentNotFoundException); + await expect(useCase.execute(new DeleteCommentCommand('missing', 'user-1'))).rejects.toThrow( + CommentNotFoundException, + ); }); }); diff --git a/src/modules/comment/application/use-cases/delete-comment/delete-comment.use-case.ts b/src/modules/comment/application/use-cases/delete-comment/delete-comment.use-case.ts index 88682db..831a704 100644 --- a/src/modules/comment/application/use-cases/delete-comment/delete-comment.use-case.ts +++ b/src/modules/comment/application/use-cases/delete-comment/delete-comment.use-case.ts @@ -1,5 +1,8 @@ import { Inject, Injectable } from '@nestjs/common'; -import { COMMENT_REPOSITORY, type ICommentRepository } from '../../../domain/repositories/comment.repository.interface.js'; +import { + COMMENT_REPOSITORY, + type ICommentRepository, +} from '../../../domain/repositories/comment.repository.interface.js'; import { DeleteCommentCommand } from './delete-comment.command.js'; import { CommentAuthorExpanderService } from '../../services/comment-author-expander.service.js'; import { CommentEventsService } from '../../services/comment-events.service.js'; diff --git a/src/modules/comment/application/use-cases/list-comments/list-comments.use-case.spec.ts b/src/modules/comment/application/use-cases/list-comments/list-comments.use-case.spec.ts index 0b85d49..080da65 100644 --- a/src/modules/comment/application/use-cases/list-comments/list-comments.use-case.spec.ts +++ b/src/modules/comment/application/use-cases/list-comments/list-comments.use-case.spec.ts @@ -4,7 +4,13 @@ import type { IIssueRepository } from '../../../../issue/domain/repositories/iss import { IssueNotFoundException } from '../../../../issue/domain/exceptions/issue-not-found.exception.js'; import { ListCommentsUseCase } from './list-comments.use-case.js'; import { ListCommentsQuery } from './list-comments.query.js'; -import { buildComment, buildIssue, mockAuthorExpander, mockCommentRepository, mockIssueRepository } from '../test-helpers.js'; +import { + buildComment, + buildIssue, + mockAuthorExpander, + mockCommentRepository, + mockIssueRepository, +} from '../test-helpers.js'; describe('ListCommentsUseCase', () => { let commentRepository: ICommentRepository; diff --git a/src/modules/comment/application/use-cases/list-comments/list-comments.use-case.ts b/src/modules/comment/application/use-cases/list-comments/list-comments.use-case.ts index 951bde3..f3d95dc 100644 --- a/src/modules/comment/application/use-cases/list-comments/list-comments.use-case.ts +++ b/src/modules/comment/application/use-cases/list-comments/list-comments.use-case.ts @@ -1,6 +1,12 @@ import { Inject, Injectable } from '@nestjs/common'; -import { COMMENT_REPOSITORY, type ICommentRepository } from '../../../domain/repositories/comment.repository.interface.js'; -import { ISSUE_REPOSITORY, type IIssueRepository } from '../../../../issue/domain/repositories/issue.repository.interface.js'; +import { + COMMENT_REPOSITORY, + type ICommentRepository, +} from '../../../domain/repositories/comment.repository.interface.js'; +import { + ISSUE_REPOSITORY, + type IIssueRepository, +} from '../../../../issue/domain/repositories/issue.repository.interface.js'; import { IssueNotFoundException } from '../../../../issue/domain/exceptions/issue-not-found.exception.js'; import { ListCommentsQuery } from './list-comments.query.js'; import { CommentDto } from '../../dto/comment.dto.js'; diff --git a/src/modules/comment/application/use-cases/test-helpers.ts b/src/modules/comment/application/use-cases/test-helpers.ts index 798956e..283ac32 100644 --- a/src/modules/comment/application/use-cases/test-helpers.ts +++ b/src/modules/comment/application/use-cases/test-helpers.ts @@ -6,7 +6,9 @@ import { Issue } from '../../../issue/domain/entities/issue.entity.js'; import { CommentAuthorExpanderService } from '../services/comment-author-expander.service.js'; import { CommentApplicationMapper } from '../mappers/comment-application.mapper.js'; -export const buildComment = (overrides: Partial<{ id: string; issueId: number; authorId: string; deletedAt: Date | null }> = {}) => +export const buildComment = ( + overrides: Partial<{ id: string; issueId: number; authorId: string; deletedAt: Date | null }> = {}, +) => Comment.reconstitute({ id: overrides.id ?? 'comment-1', content: 'Original', diff --git a/src/modules/comment/application/use-cases/update-comment/update-comment.use-case.spec.ts b/src/modules/comment/application/use-cases/update-comment/update-comment.use-case.spec.ts index 01dd9b8..90aff6c 100644 --- a/src/modules/comment/application/use-cases/update-comment/update-comment.use-case.spec.ts +++ b/src/modules/comment/application/use-cases/update-comment/update-comment.use-case.spec.ts @@ -7,7 +7,13 @@ import { CommentEventsService } from '../../services/comment-events.service.js'; import { CommentAccessService } from '../../services/comment-access.service.js'; import { UpdateCommentUseCase } from './update-comment.use-case.js'; import { UpdateCommentCommand } from './update-comment.command.js'; -import { buildComment, buildIssue, mockAuthorExpander, mockCommentRepository, mockIssueRepository } from '../test-helpers.js'; +import { + buildComment, + buildIssue, + mockAuthorExpander, + mockCommentRepository, + mockIssueRepository, +} from '../test-helpers.js'; describe('UpdateCommentUseCase', () => { let commentRepository: ICommentRepository; @@ -54,20 +60,26 @@ describe('UpdateCommentUseCase', () => { it('throws CommentForbiddenException for a non-author', async () => { vi.mocked(commentRepository.findById).mockResolvedValue(buildComment()); - await expect(useCase.execute(new UpdateCommentCommand('comment-1', 'user-2', 'Changed'))).rejects.toThrow(CommentForbiddenException); + await expect(useCase.execute(new UpdateCommentCommand('comment-1', 'user-2', 'Changed'))).rejects.toThrow( + CommentForbiddenException, + ); expect(commentRepository.update).not.toHaveBeenCalled(); }); it('throws CommentNotFoundException for a deleted comment', async () => { vi.mocked(commentRepository.findById).mockResolvedValue(buildComment({ deletedAt: new Date() })); - await expect(useCase.execute(new UpdateCommentCommand('comment-1', 'user-1', 'Changed'))).rejects.toThrow(CommentNotFoundException); + await expect(useCase.execute(new UpdateCommentCommand('comment-1', 'user-1', 'Changed'))).rejects.toThrow( + CommentNotFoundException, + ); }); it('throws CommentNotFoundException when the issue is not visible to the user', async () => { vi.mocked(commentRepository.findById).mockResolvedValue(buildComment()); vi.mocked(issueRepository.findById).mockResolvedValue(null); - await expect(useCase.execute(new UpdateCommentCommand('comment-1', 'user-1', 'Changed'))).rejects.toThrow(CommentNotFoundException); + await expect(useCase.execute(new UpdateCommentCommand('comment-1', 'user-1', 'Changed'))).rejects.toThrow( + CommentNotFoundException, + ); }); }); diff --git a/src/modules/comment/application/use-cases/update-comment/update-comment.use-case.ts b/src/modules/comment/application/use-cases/update-comment/update-comment.use-case.ts index b30b127..c294196 100644 --- a/src/modules/comment/application/use-cases/update-comment/update-comment.use-case.ts +++ b/src/modules/comment/application/use-cases/update-comment/update-comment.use-case.ts @@ -1,5 +1,8 @@ import { Inject, Injectable } from '@nestjs/common'; -import { COMMENT_REPOSITORY, type ICommentRepository } from '../../../domain/repositories/comment.repository.interface.js'; +import { + COMMENT_REPOSITORY, + type ICommentRepository, +} from '../../../domain/repositories/comment.repository.interface.js'; import { UpdateCommentCommand } from './update-comment.command.js'; import { CommentDto } from '../../dto/comment.dto.js'; import { CommentAuthorExpanderService } from '../../services/comment-author-expander.service.js'; diff --git a/src/modules/comment/application/use-cases/watch-issue-comments/watch-issue-comments.use-case.spec.ts b/src/modules/comment/application/use-cases/watch-issue-comments/watch-issue-comments.use-case.spec.ts index 2f70ecc..5177dc0 100644 --- a/src/modules/comment/application/use-cases/watch-issue-comments/watch-issue-comments.use-case.spec.ts +++ b/src/modules/comment/application/use-cases/watch-issue-comments/watch-issue-comments.use-case.spec.ts @@ -7,7 +7,8 @@ import { WatchIssueCommentsUseCase } from './watch-issue-comments.use-case.js'; import { WatchIssueCommentsQuery } from './watch-issue-comments.query.js'; import { buildComment, buildIssue, mockIssueRepository } from '../test-helpers.js'; -const dtoForIssue = (issueId: number) => CommentApplicationMapper.toDto(buildComment({ id: `comment-of-${issueId}`, issueId }), new Map()); +const dtoForIssue = (issueId: number) => + CommentApplicationMapper.toDto(buildComment({ id: `comment-of-${issueId}`, issueId }), new Map()); describe('WatchIssueCommentsUseCase', () => { let issueRepository: IIssueRepository; diff --git a/src/modules/comment/application/use-cases/watch-issue-comments/watch-issue-comments.use-case.ts b/src/modules/comment/application/use-cases/watch-issue-comments/watch-issue-comments.use-case.ts index 8970563..ccc3830 100644 --- a/src/modules/comment/application/use-cases/watch-issue-comments/watch-issue-comments.use-case.ts +++ b/src/modules/comment/application/use-cases/watch-issue-comments/watch-issue-comments.use-case.ts @@ -1,6 +1,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { filter, type Observable } from 'rxjs'; -import { ISSUE_REPOSITORY, type IIssueRepository } from '../../../../issue/domain/repositories/issue.repository.interface.js'; +import { + ISSUE_REPOSITORY, + type IIssueRepository, +} from '../../../../issue/domain/repositories/issue.repository.interface.js'; import { IssueNotFoundException } from '../../../../issue/domain/exceptions/issue-not-found.exception.js'; import { WatchIssueCommentsQuery } from './watch-issue-comments.query.js'; import { type CommentEvent, CommentEventsService } from '../../services/comment-events.service.js'; diff --git a/src/modules/comment/domain/repositories/comment.repository.interface.ts b/src/modules/comment/domain/repositories/comment.repository.interface.ts index 1654f14..c865b9a 100644 --- a/src/modules/comment/domain/repositories/comment.repository.interface.ts +++ b/src/modules/comment/domain/repositories/comment.repository.interface.ts @@ -10,7 +10,11 @@ export interface ICommentRepository { * Комментарии задачи от старых к новым, включая удалённые. * Курсорная пагинация: cursor — id последнего полученного комментария. */ - findByIssue(params: { issueId: number; limit: number; cursor?: string }): Promise<{ list: Comment[]; nextCursor: string | null }>; + findByIssue(params: { + issueId: number; + limit: number; + cursor?: string; + }): Promise<{ list: Comment[]; nextCursor: string | null }>; create(comment: Comment): Promise; update(comment: Comment): Promise; } diff --git a/src/modules/comment/infrastructure/persistence/prisma/repositories/comment.prisma-repository.ts b/src/modules/comment/infrastructure/persistence/prisma/repositories/comment.prisma-repository.ts index 08ab71f..691e9a5 100644 --- a/src/modules/comment/infrastructure/persistence/prisma/repositories/comment.prisma-repository.ts +++ b/src/modules/comment/infrastructure/persistence/prisma/repositories/comment.prisma-repository.ts @@ -17,7 +17,11 @@ export class CommentPrismaRepository implements ICommentRepository { return record ? CommentPrismaMapper.toDomain(record) : null; } - async findByIssue(params: { issueId: number; limit: number; cursor?: string }): Promise<{ list: Comment[]; nextCursor: string | null }> { + async findByIssue(params: { + issueId: number; + limit: number; + cursor?: string; + }): Promise<{ list: Comment[]; nextCursor: string | null }> { const limit = Math.max(1, params.limit); // Берём на одну запись больше, чтобы понять, есть ли следующая страница. diff --git a/src/modules/comment/presentation/controllers/comment.controller.ts b/src/modules/comment/presentation/controllers/comment.controller.ts index b26fcef..61398a0 100644 --- a/src/modules/comment/presentation/controllers/comment.controller.ts +++ b/src/modules/comment/presentation/controllers/comment.controller.ts @@ -47,15 +47,27 @@ export class CommentController { ) {} @Get('issues/:issueId/comments') - list(@Param('issueId', ParseIntPipe) issueId: number, @Query() query: ListCommentsDto, @Session() session: UserSession) { + list( + @Param('issueId', ParseIntPipe) issueId: number, + @Query() query: ListCommentsDto, + @Session() session: UserSession, + ) { return this.handleErrors(() => - this.listCommentsUseCase.execute(new ListCommentsQuery(issueId, session.user.id, Number(query.limit), query.cursor)), + this.listCommentsUseCase.execute( + new ListCommentsQuery(issueId, session.user.id, Number(query.limit), query.cursor), + ), ); } @Post('issues/:issueId/comments') - create(@Param('issueId', ParseIntPipe) issueId: number, @Body() dto: CreateCommentRequestDto, @Session() session: UserSession) { - return this.handleErrors(() => this.createCommentUseCase.execute(new CreateCommentCommand(issueId, session.user.id, dto.content))); + create( + @Param('issueId', ParseIntPipe) issueId: number, + @Body() dto: CreateCommentRequestDto, + @Session() session: UserSession, + ) { + return this.handleErrors(() => + this.createCommentUseCase.execute(new CreateCommentCommand(issueId, session.user.id, dto.content)), + ); } /** @@ -66,16 +78,23 @@ export class CommentController { */ @Sse('issues/:issueId/comments/events') @UseGuards(IssueVisibleGuard) - events(@Param('issueId', ParseIntPipe) issueId: number, @Session() session: UserSession): Promise> { + events( + @Param('issueId', ParseIntPipe) issueId: number, + @Session() session: UserSession, + ): Promise> { return this.handleErrors(async () => { - const events$ = await this.watchIssueCommentsUseCase.execute(new WatchIssueCommentsQuery(issueId, session.user.id)); + const events$ = await this.watchIssueCommentsUseCase.execute( + new WatchIssueCommentsQuery(issueId, session.user.id), + ); return events$.pipe(map((event) => ({ type: event.type, data: event.comment }))); }); } @Patch('comments/:id') update(@Param('id') id: string, @Body() dto: UpdateCommentRequestDto, @Session() session: UserSession) { - return this.handleErrors(() => this.updateCommentUseCase.execute(new UpdateCommentCommand(id, session.user.id, dto.content))); + return this.handleErrors(() => + this.updateCommentUseCase.execute(new UpdateCommentCommand(id, session.user.id, dto.content)), + ); } @Delete('comments/:id') diff --git a/src/modules/comment/presentation/guards/issue-visible.guard.ts b/src/modules/comment/presentation/guards/issue-visible.guard.ts index 4409ea0..66f8b8e 100644 --- a/src/modules/comment/presentation/guards/issue-visible.guard.ts +++ b/src/modules/comment/presentation/guards/issue-visible.guard.ts @@ -24,7 +24,9 @@ export class IssueVisibleGuard implements CanActivate { constructor(private readonly commentAccess: CommentAccessService) {} async canActivate(context: ExecutionContext): Promise { - const request = context.switchToHttp().getRequest<{ params: Record; session?: UserSession }>(); + const request = context + .switchToHttp() + .getRequest<{ params: Record; session?: UserSession }>(); const userId = request.session?.user.id; if (!userId) { diff --git a/src/modules/issue/domain/entities/issue.entity.spec.ts b/src/modules/issue/domain/entities/issue.entity.spec.ts index eb6f6d0..64db33c 100644 --- a/src/modules/issue/domain/entities/issue.entity.spec.ts +++ b/src/modules/issue/domain/entities/issue.entity.spec.ts @@ -72,7 +72,7 @@ describe('Issue', () => { assignee: 'user-3', reporter: 'user-1', projectId: 'project-1', - dueDate: null, + dueDate: null, createdAt: now, updatedAt: now, }); @@ -95,7 +95,7 @@ describe('Issue', () => { assignee: null, reporter: 'user-1', projectId: 'project-1', - dueDate: null, + dueDate: null, createdAt: new Date('2026-01-01T00:00:00.000Z'), updatedAt: new Date('2026-01-01T00:00:00.000Z'), }); diff --git a/src/modules/notification/application/services/notification-dispatcher.service.ts b/src/modules/notification/application/services/notification-dispatcher.service.ts index 718796e..f2c0904 100644 --- a/src/modules/notification/application/services/notification-dispatcher.service.ts +++ b/src/modules/notification/application/services/notification-dispatcher.service.ts @@ -1,10 +1,7 @@ import { Inject, Injectable, Logger } from '@nestjs/common'; import { OnEvent } from '@nestjs/event-emitter'; import { NOTIFY_EVENT, type NotifyEventPayload } from '../../domain/events/notify.event.js'; -import { - NOTIFICATION_CHANNEL_SENDERS, - type NotificationChannelSender, -} from '../../domain/channel-sender.interface.js'; +import { NOTIFICATION_CHANNEL_SENDERS, type NotificationChannelSender } from '../../domain/channel-sender.interface.js'; import { NOTIFICATION_PREFERENCE_REPOSITORY, type INotificationPreferenceRepository, @@ -39,7 +36,9 @@ export class NotificationDispatcherService { /** Каналы из payload, отфильтрованные по подпискам; без явных подписок — все каналы включены по умолчанию */ private async resolveChannels(payload: NotifyEventPayload): Promise { const userPreferences = await this.preferences.findByUserId(payload.userId); - const disabledChannels = new Set(userPreferences.filter((preference) => !preference.enabled).map((preference) => preference.channel)); + const disabledChannels = new Set( + userPreferences.filter((preference) => !preference.enabled).map((preference) => preference.channel), + ); const candidateChannels = payload.channels ?? this.senders.map((sender) => sender.channel); return candidateChannels.filter((channel) => !disabledChannels.has(channel)); diff --git a/src/modules/notification/application/services/notifications.service.ts b/src/modules/notification/application/services/notifications.service.ts index 851dab8..6459ab8 100644 --- a/src/modules/notification/application/services/notifications.service.ts +++ b/src/modules/notification/application/services/notifications.service.ts @@ -9,7 +9,10 @@ import { NOTIFICATION_PREFERENCE_REPOSITORY, type INotificationPreferenceRepository, } from '../../domain/repositories/notification-preference.repository.interface.js'; -import { NOTIFICATION_CHANNELS, type NotificationChannelValue } from '../../domain/value-objects/notification-channel.vo.js'; +import { + NOTIFICATION_CHANNELS, + type NotificationChannelValue, +} from '../../domain/value-objects/notification-channel.vo.js'; export interface ResolvedNotificationPreference { channel: NotificationChannelValue; diff --git a/src/modules/notification/presentation/controllers/notification.controller.ts b/src/modules/notification/presentation/controllers/notification.controller.ts index 9b983ea..1117f47 100644 --- a/src/modules/notification/presentation/controllers/notification.controller.ts +++ b/src/modules/notification/presentation/controllers/notification.controller.ts @@ -1,4 +1,15 @@ -import { BadRequestException, Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Put, Post } from '@nestjs/common'; +import { + BadRequestException, + Body, + Controller, + Delete, + Get, + HttpCode, + HttpStatus, + Param, + Put, + Post, +} from '@nestjs/common'; import { Session, type UserSession } from '@thallesp/nestjs-better-auth'; import { NotificationsService } from '../../application/services/notifications.service.js'; import { RegisterDeviceTokenDto } from '../dto/register-device-token.dto.js'; diff --git a/src/modules/project/domain/repositories/project.repository.interface.ts b/src/modules/project/domain/repositories/project.repository.interface.ts index cc65e79..30d41e7 100644 --- a/src/modules/project/domain/repositories/project.repository.interface.ts +++ b/src/modules/project/domain/repositories/project.repository.interface.ts @@ -7,11 +7,7 @@ export const PROJECT_REPOSITORY = Symbol('PROJECT_REPOSITORY'); export interface IProjectRepository { /** Проект виден владельцу и участникам проекта (ProjectMember) */ findById(id: string, userId: string): Promise; - findAll(params: { - limit: number; - page: number; - userId: string; - }): Promise<{ list: Project[]; meta: PaginationMeta }>; + findAll(params: { limit: number; page: number; userId: string }): Promise<{ list: Project[]; meta: PaginationMeta }>; create(project: Project): Promise; update(project: Project): Promise; delete(id: string): Promise;