first commit

This commit is contained in:
2026-10-03 13:40:26 +02:00
parent 732a5b5a16
commit 566f415fa7
555 changed files with 62704 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
import { Injectable } from '@nestjs/common';
import { CommandBus, QueryBus } from '@nestjs/cqrs';
import { CommentReadModel } from '@task-stream/api/tracker/domain';
import { AddCommentCommand } from './commands/add-comment.command';
import { CommandResult } from './commands/command-result';
import { DeleteCommentCommand } from './commands/delete-comment.command';
import { EditCommentCommand } from './commands/edit-comment.command';
import { Page } from './ports/find-issues.repository';
import { GetCommentsQuery } from './queries/get-comments.query';
@Injectable()
export class CommentsService {
constructor(
private readonly commandBus: CommandBus,
private readonly queryBus: QueryBus,
) {}
add(actorId: string, issueId: string, body: string): Promise<CommandResult> {
return this.commandBus.execute(
new AddCommentCommand(actorId, issueId, body),
);
}
edit(
actorId: string,
commentId: string,
body: string,
): Promise<CommandResult> {
return this.commandBus.execute(
new EditCommentCommand(actorId, commentId, body),
);
}
delete(actorId: string, commentId: string): Promise<CommandResult> {
return this.commandBus.execute(
new DeleteCommentCommand(actorId, commentId),
);
}
list(
viewerId: string,
issueId: string,
limit?: number,
offset?: number,
): Promise<Page<CommentReadModel>> {
return this.queryBus.execute(
new GetCommentsQuery(viewerId, issueId, limit, offset),
);
}
}