Skip to content

Feat/boards#71

Draft
maksberegovoi wants to merge 12 commits into
devfrom
feat/boards
Draft

Feat/boards#71
maksberegovoi wants to merge 12 commits into
devfrom
feat/boards

Conversation

@maksberegovoi
Copy link
Copy Markdown
Collaborator

No description provided.

@maksberegovoi maksberegovoi requested a review from soorq May 8, 2026 18:49
ApiResponse({
status: 201,
description: 'Представление создано',
type: BoardViewResponse.Output,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мы даем ActionResponse, либо, расширяем, НО, в круде мы не отдаем конкретный пейлоад, зачем?
Держим 1 стиль, success, message -> фронт проверяет, if success then getDataSame()
Исправляй

ApiResponse({
status: 200,
description: 'Представление обновлено',
type: BoardViewResponse.Output,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Также, выше описывал

ApiResponse({
status: 200,
description: 'Представление удалено',
type: Boolean,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

При удаление ресурса мы делаем просто ActionResponse dto

constructor(
@Inject('IBoardsRepository')
private readonly boardsRepo: IBoardsRepository,
private readonly boardAccess: BoardAccessPolicy,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нейминг держи относительно сущности, образно, если полиси проверяет доступ, делай как policyAccess, по импорту понятно что за бизнес-сущность

public async execute(id: string, boardId: string, userId: string): Promise<boolean> {
await this.boardAccess.validateViewAccess(id, userId, boardId);

return this.boardsRepo.removeView(id);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не забывай, статус и мессейдж, фронт ждет!

@@ -0,0 +1,259 @@
import { Inject, Injectable } from '@nestjs/common';
import { IBoardsRepository } from '../../../domain/repository';
import {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не забывай import type, тут конфиг линта настроить бы надо, на этот рул

@Param('id') id: string,
@Param('boardId') boardId: string,
@GetUserId() userId: string,
): Promise<BoardView | null> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет смысла явно указывать тип, он излишен, сваггер будет опираться на выведение декораторе тип

ApiResponse({
status: 201,
description: 'Колонка создана',
type: BoardColumnResponse.Output,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ActionResponse опять же

async findAll(
@Param('boardId') boardId: string,
@GetUserId() userId: string,
): Promise<BoardColumn[]> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

типы явно опять

ApiResponse({
status: 201,
description: 'Доска успешно создана',
type: BoardResponse.Output,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ActionResponse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants