Ignore:
Timestamp:
02/14/26 18:21:18 (5 months ago)
Author:
Dimitar Arsov <dimitararsov04@…>
Branches:
main
Children:
ce45c7a
Parents:
f5bc95e
Message:

save playlist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/utils/types.ts

    rf5bc95e r85512ff  
    11export interface User {
    2         username: string;
    3         fullName: string;
    4         email?: string;
    5         profilePhoto?: string | null;
    6         isAdmin: boolean;
    7         isArtist: boolean;
     2  username: string;
     3  fullName: string;
     4  email?: string;
     5  profilePhoto?: string | null;
     6  isAdmin: boolean;
     7  isArtist: boolean;
    88}
    99
    1010export interface ArtistContribution {
    11         id: number;
    12         title: string;
    13         genre: string;
    14         role: string;
    15         entityType: string;
    16         isLikedByCurrentUser: boolean;
    17         cover?: string | null;
    18         link?: string | null;
     11  id: number;
     12  title: string;
     13  genre: string;
     14  role: string;
     15  entityType: string;
     16  isLikedByCurrentUser: boolean;
     17  cover?: string | null;
     18  link?: string | null;
    1919}
    2020
    2121export interface MusicalEntity {
    22         id: number;
    23         title: string;
    24         genre: string;
    25         type: string;
    26         releasedBy: string;
    27         artistUsername?: string;
    28         cover?: string | null;
    29         isLikedByCurrentUser?: boolean;
     22  id: number;
     23  title: string;
     24  genre: string;
     25  type: string;
     26  releasedBy: string;
     27  artistUsername?: string;
     28  cover?: string | null;
     29  isLikedByCurrentUser?: boolean;
    3030}
    3131
    3232export interface Song extends MusicalEntity {
    33         type: "SONG";
    34         album?: string;
    35         albumId?: number;
    36         link?: string;
     33  type: "SONG";
     34  album?: string;
     35  albumId?: number;
     36  link?: string;
    3737}
    3838
    3939export interface Album extends MusicalEntity {
    40         type: "ALBUM";
    41         songs: Song[];
     40  type: "ALBUM";
     41  songs: Song[];
    4242}
    4343
    4444export interface Playlist {
    45         id: number;
    46         name: string;
    47         cover: string;
    48         creatorName: string;
    49         songsInPlaylist: Song[];
    50         isSavedByCurrentUser: boolean;
     45  id: number;
     46  name: string;
     47  cover: string;
     48  creatorName: string;
     49  creatorUsername: string;
     50  songsInPlaylist: Song[];
     51  isSavedByCurrentUser: boolean;
    5152}
    5253
    5354export interface BaseNonAdminUser {
    54         username: string;
    55         fullName: string;
    56         userType: string;
    57         profilePhoto: string;
    58         followers: number;
    59         following: number;
    60         isFollowedByCurrentUser: boolean;
     55  username: string;
     56  fullName: string;
     57  userType: string;
     58  profilePhoto: string;
     59  followers: number;
     60  following: number;
     61  isFollowedByCurrentUser: boolean;
    6162}
    6263
     
    6667
    6768export interface SidebarProps {
    68         isOpen: boolean;
    69         onClose: () => void;
     69  isOpen: boolean;
     70  onClose: () => void;
     71}
     72
     73export interface CreatePlaylistModalProps {
     74  isOpen: boolean;
     75  onClose: () => void;
     76  onSubmit: (playlistName: string) => void;
    7077}
    7178
    7279export interface SongContribution {
    73         artistName: string;
    74         role: string;
     80  artistName: string;
     81  role: string;
    7582}
    7683
    7784export interface SongReview {
    78         id: {
    79                 listenerId: number;
    80                 musicalEntityId: number;
    81         };
    82         author: string;
    83         authorUsername: string;
    84         grade: number;
    85         comment: string;
     85  id: {
     86    listenerId: number;
     87    musicalEntityId: number;
     88  };
     89  author: string;
     90  authorUsername: string;
     91  grade: number;
     92  comment: string;
    8693}
    8794
    8895export interface SongDetail extends MusicalEntity {
    89         type: "SONG";
    90         album?: string | null;
    91         link?: string | null;
    92         contributions: SongContribution[];
    93         reviews: SongReview[];
     96  type: "SONG";
     97  album?: string | null;
     98  link?: string | null;
     99  contributions: SongContribution[];
     100  reviews: SongReview[];
    94101}
    95102
    96103export interface BasicSong {
    97         id: number;
    98         title: string;
    99         artist: string;
    100         artistUsername?: string;
    101         cover?: string;
    102         link?: string;
    103         album?: string;
    104         albumId?: number;
     104  id: number;
     105  title: string;
     106  artist: string;
     107  artistUsername?: string;
     108  cover?: string;
     109  link?: string;
     110  album?: string;
     111  albumId?: number;
    105112}
    106113
    107114export interface BasicPlaylist {
    108         id: number;
    109         name: string;
    110         songCount: number;
     115  id: number;
     116  name: string;
     117  songCount: number;
    111118}
    112119
    113120export interface CatalogItem {
    114         id: number;
    115         title: string;
    116         genre: string;
    117         cover: string | null;
    118         type: "SONG" | "ALBUM";
    119         releaseDate: string;
     121  id: number;
     122  title: string;
     123  genre: string;
     124  cover: string | null;
     125  type: "SONG" | "ALBUM";
     126  releaseDate: string;
    120127}
    121128
    122129export interface Contributor {
    123         id: number;
    124         fullName: string;
    125         role: string;
     130  id: number;
     131  fullName: string;
     132  role: string;
    126133}
    127134
    128135export interface ArtistSearchResult {
    129         id: number;
    130         username: string;
    131         fullName: string;
    132         profilePhoto?: string;
     136  id: number;
     137  username: string;
     138  fullName: string;
     139  profilePhoto?: string;
    133140}
    134141
    135142export interface SongEntry {
    136         title: string;
    137         link: string;
    138         contributors: Contributor[];
     143  title: string;
     144  link: string;
     145  contributors: Contributor[];
    139146}
Note: See TracChangeset for help on using the changeset viewer.