This commit is contained in:
valere
2025-12-31 16:31:53 +01:00
parent afb20fe75f
commit 9001025837
16 changed files with 3508 additions and 20277 deletions

82
server/types/database.ts Normal file
View 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
}