package de.thpeetz.kontor.models.media;

import java.util.Date;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import jakarta.persistence.Version;
import jakarta.validation.constraints.NotEmpty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "media_article", indexes = @Index(columnList = "url"), uniqueConstraints = @UniqueConstraint(columnNames = {
        "url" }))
public class MediaArticle {

    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    private String id;

    @Version
    private int version;

    @Column(name = "created_date")
    private Date createdDate;

    @Column(name = "last_modified_date", nullable = true)
    private Date lastModifiedDate;

    @NotEmpty
    private String url;

    @Column
    private boolean review;

    @Column(nullable = true)
    private String title;
}
