refactoring types / get types directly from drizzle

This commit is contained in:
Michi 2025-09-27 15:32:18 +02:00
parent 6ed53835ff
commit 0a3636fda8
6 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,5 @@
import { type InferSelectModel, type InferInsertModel } from 'drizzle-orm';
import { attraction } from '../db/schema';
export type Attraction = InferInsertModel<typeof attraction>
export type AttractionSelect = InferSelectModel<typeof attraction>

View file

@ -0,0 +1,5 @@
import { type InferSelectModel, type InferInsertModel } from 'drizzle-orm';
import { attractionNotification } from '../db/schema';
export type AttractionNotification = InferInsertModel<typeof attractionNotification>
export type AttractionNotificationSelect = InferSelectModel<typeof attractionNotification>

5
api/src/types/logbook.ts Normal file
View file

@ -0,0 +1,5 @@
import { type InferSelectModel, type InferInsertModel } from 'drizzle-orm';
import { logbook } from '../db/schema';
export type Logbook = InferInsertModel<typeof logbook>
export type LogbookSelect = InferSelectModel<typeof logbook>

View file

@ -0,0 +1,5 @@
import { type InferSelectModel, type InferInsertModel } from 'drizzle-orm';
import { notificationMethod } from '../db/schema';
export type NotificationMethod = InferInsertModel<typeof notificationMethod>
export type NotificationMethodSelect = InferSelectModel<typeof notificationMethod>

View file

@ -0,0 +1,5 @@
import { type InferSelectModel, type InferInsertModel } from 'drizzle-orm';
import { themepark } from '../db/schema';
export type Themepark = InferInsertModel<typeof themepark>
export type ThemeparkSelect = InferSelectModel<typeof themepark>

5
api/src/types/user.ts Normal file
View file

@ -0,0 +1,5 @@
import { type InferSelectModel, type InferInsertModel } from 'drizzle-orm';
import { user } from '../db/schema';
export type User = InferInsertModel<typeof user>
export type UserSelect = InferSelectModel<typeof user>