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

19
src/tag/tag.mapper.ts Normal file
View File

@@ -0,0 +1,19 @@
import { TagResponseDto } from './dto/tag-response.dto';
import { TagRow } from './tag.types';
/** Преобразует строки БД tag в стабильный DTO для API. */
export function createTagResponse(rows: TagRow[]): TagResponseDto {
return {
items: rows.map((row) => ({
id: row.id,
name: row.name,
tagGroup: row.tag_group,
min: row.min,
max: row.max,
comment: row.comment,
unitOfMeasurement: row.unit_of_measurement,
edgeIds: row.edge_ids ?? [],
precision: row.precision,
})),
};
}