refactor: database types (#19624)

This commit is contained in:
Jason Rasmussen
2025-06-30 13:19:16 -04:00
committed by GitHub
parent 09cbc5d3f4
commit e60bc3c304
99 changed files with 518 additions and 889 deletions

View File

@@ -1,5 +1,4 @@
import { Selectable } from 'kysely';
import { Albums, Exif as DatabaseExif } from 'src/db';
import { MapAsset } from 'src/dtos/asset-response.dto';
import {
AlbumUserRole,
@@ -13,6 +12,8 @@ import {
UserAvatarColor,
UserStatus,
} from 'src/enum';
import { AlbumTable } from 'src/schema/tables/album.table';
import { ExifTable } from 'src/schema/tables/exif.table';
import { UserMetadataItem } from 'src/types';
export type AuthUser = {
@@ -193,7 +194,7 @@ export type SharedLink = {
userId: string;
};
export type Album = Selectable<Albums> & {
export type Album = Selectable<AlbumTable> & {
owner: User;
assets: MapAsset[];
};
@@ -239,7 +240,7 @@ export type Session = {
pinExpiresAt: Date | null;
};
export type Exif = Omit<Selectable<DatabaseExif>, 'updatedAt' | 'updateId'>;
export type Exif = Omit<Selectable<ExifTable>, 'updatedAt' | 'updateId'>;
export type Person = {
createdAt: Date;