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

View File

@@ -1,7 +1,7 @@
import { Tag } from 'src/database';
import { TagResponseDto } from 'src/dtos/tag.dto';
import { TagItem } from 'src/types';
const parent = Object.freeze<TagItem>({
const parent = Object.freeze<Tag>({
id: 'tag-parent',
createdAt: new Date('2021-01-01T00:00:00Z'),
updatedAt: new Date('2021-01-01T00:00:00Z'),
@@ -10,7 +10,7 @@ const parent = Object.freeze<TagItem>({
parentId: null,
});
const child = Object.freeze<TagItem>({
const child = Object.freeze<Tag>({
id: 'tag-child',
createdAt: new Date('2021-01-01T00:00:00Z'),
updatedAt: new Date('2021-01-01T00:00:00Z'),

View File

@@ -5,6 +5,7 @@ import {
AuthApiKey,
AuthUser,
Library,
Memory,
Partner,
SidecarWriteAsset,
User,
@@ -12,7 +13,7 @@ import {
} from 'src/database';
import { AuthDto } from 'src/dtos/auth.dto';
import { AssetStatus, AssetType, MemoryType, Permission, UserStatus } from 'src/enum';
import { ActivityItem, MemoryItem, OnThisDayData } from 'src/types';
import { ActivityItem, OnThisDayData } from 'src/types';
export const newUuid = () => randomUUID() as string;
export const newUuids = () =>
@@ -196,7 +197,7 @@ const libraryFactory = (library: Partial<Library> = {}) => ({
...library,
});
const memoryFactory = (memory: Partial<MemoryItem> = {}) => ({
const memoryFactory = (memory: Partial<Memory> = {}) => ({
id: newUuid(),
createdAt: newDate(),
updatedAt: newDate(),