mirror of
https://github.com/immich-app/immich.git
synced 2025-12-26 17:25:00 +03:00
refactor: database types (#17468)
This commit is contained in:
6
server/test/fixtures/tag.stub.ts
vendored
6
server/test/fixtures/tag.stub.ts
vendored
@@ -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'),
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user