SQLITE 3
This commit is contained in:
82
server/types/database.ts
Normal file
82
server/types/database.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
// Types pour les tables de la base de données
|
||||
|
||||
export interface Box {
|
||||
id: string
|
||||
type: 'compilation' | 'playlist'
|
||||
name: string
|
||||
description?: string
|
||||
state?: string
|
||||
duration: number
|
||||
activeSide?: string
|
||||
color1?: string
|
||||
color2?: string
|
||||
createdAt?: string
|
||||
}
|
||||
|
||||
export interface Side {
|
||||
id: number
|
||||
boxId: string
|
||||
side: string
|
||||
name?: string
|
||||
description?: string
|
||||
duration: number
|
||||
color1?: string
|
||||
color2?: string
|
||||
}
|
||||
|
||||
export interface Artist {
|
||||
id: number
|
||||
name: string
|
||||
url?: string
|
||||
coverId?: string
|
||||
createdAt?: string
|
||||
}
|
||||
|
||||
export interface Track {
|
||||
id: number
|
||||
boxId: string
|
||||
side?: string
|
||||
trackOrder: number
|
||||
title: string
|
||||
artistId?: number
|
||||
start: number
|
||||
link?: string
|
||||
coverId?: string
|
||||
url?: string
|
||||
type: 'compilation' | 'playlist'
|
||||
year?: number
|
||||
date?: string
|
||||
card?: string
|
||||
}
|
||||
|
||||
// Types pour les réponses API
|
||||
|
||||
export interface BoxWithSides extends Box {
|
||||
sides?: Record<string, Omit<Side, 'id' | 'boxId'>>
|
||||
}
|
||||
|
||||
export interface TrackWithArtist extends Track {
|
||||
artistName?: string
|
||||
artistUrl?: string
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
items: T[]
|
||||
pagination: {
|
||||
page: number
|
||||
limit: number
|
||||
total: number
|
||||
totalPages: number
|
||||
}
|
||||
}
|
||||
|
||||
export interface TracksSearchResponse {
|
||||
tracks: TrackWithArtist[]
|
||||
pagination: {
|
||||
page: number
|
||||
limit: number
|
||||
total: number
|
||||
totalPages: number
|
||||
}
|
||||
search?: string
|
||||
}
|
||||
Reference in New Issue
Block a user