first commit

This commit is contained in:
Первов Артем
2026-06-19 08:18:52 +03:00
commit 05a9e0e535
61 changed files with 11950 additions and 0 deletions

18
src/edge/edge.mapper.ts Normal file
View File

@@ -0,0 +1,18 @@
import { EdgeResponseDto } from './dto/edge-response.dto';
import { EdgeRow } from './edge.types';
/** Преобразует строки БД edge в стабильный DTO для API. */
export function createEdgeResponse(rows: EdgeRow[]): EdgeResponseDto {
return {
items: rows.map((row) => ({
id: row.id,
name: row.name,
parentId: row.parent_id,
tagIds: row.tag_ids ?? [],
tagCount: row.tag_count,
currentTagCount: row.current_tag_count,
liveTagCount: row.live_tag_count,
lastDataAt: row.last_data_at,
})),
};
}