package com.example.PhotoGallery.Models;

import java.util.List;

import jakarta.persistence.CollectionTable;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.Table;
import lombok.*;

@Entity
@Table(name = "Photos")
@Data
public class Photo {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(nullable = false)
    private String title;

    @Column(length = 255)
    private String description;

    @ElementCollection
    @CollectionTable(name = "photo_tags", 
                    joinColumns = @JoinColumn(name = "photo_id"))
    @Column(name = "tag")
    private List<String> tags;

    @Column
    private Integer width;

    @Column
    private Integer height;

    @Column(unique = true, nullable = false)
    private String fileName;

    @Column(unique = true, nullable = false)
    private String filePath;

    @Column(unique = true, nullable = false)
    private String thumbnailPath;

    @Column
    private String mimeType;

    @Column
    private String colourSpace;

    @Column
    private String copyRight;

    @Column
    private Double file_size;

    @Column
    private boolean isFavourite;

}
