refactor: database types (#17468)

This commit is contained in:
Jason Rasmussen
2025-04-08 12:40:03 -04:00
committed by GitHub
parent ac65d46ec6
commit 4794eeca88
9 changed files with 44 additions and 39 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsEnum, IsInt, IsObject, IsPositive, ValidateNested } from 'class-validator';
import { Memory } from 'src/database';
import { AssetResponseDto, mapAsset } from 'src/dtos/asset-response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { AssetEntity } from 'src/entities/asset.entity';
import { MemoryType } from 'src/enum';
import { MemoryItem } from 'src/types';
import { Optional, ValidateBoolean, ValidateDate, ValidateUUID } from 'src/validation';
class MemoryBaseDto {
@@ -89,7 +89,7 @@ export class MemoryResponseDto {
assets!: AssetResponseDto[];
}
export const mapMemory = (entity: MemoryItem, auth: AuthDto): MemoryResponseDto => {
export const mapMemory = (entity: Memory, auth: AuthDto): MemoryResponseDto => {
return {
id: entity.id,
createdAt: entity.createdAt,
+2 -2
View File
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsHexColor, IsNotEmpty, IsString } from 'class-validator';
import { TagItem } from 'src/types';
import { Tag } from 'src/database';
import { Optional, ValidateHexColor, ValidateUUID } from 'src/validation';
export class TagCreateDto {
@@ -51,7 +51,7 @@ export class TagResponseDto {
color?: string;
}
export function mapTag(entity: TagItem): TagResponseDto {
export function mapTag(entity: Tag): TagResponseDto {
return {
id: entity.id,
parentId: entity.parentId ?? undefined,