package com.example.video_downloader.entity;

import jakarta.persistence.*;
import lombok.Data;
import lombok.ToString;

import java.util.List;

@Data
@ToString
@Entity
@Table(name = "playlists")

public class Playlist {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "playlist_name", nullable = false)
    private String playlistName;
    
    @Column
    private String url;

    @Enumerated(EnumType.STRING)
    private StatusEnum status;

    @ManyToMany
    @JoinTable(
            name = "video_playlist",
            joinColumns = @JoinColumn(name = "playlist_id"),
            inverseJoinColumns = @JoinColumn(name = "video_id")
    )
    private List<Video> videos;

}
