package org.kar.karusic.model;

import java.time.LocalDate;
import java.util.List;

import org.bson.types.ObjectId;
import org.kar.archidata.annotation.DataIfNotExists;
import org.kar.archidata.annotation.DataJson;
import org.kar.archidata.dataAccess.options.CheckJPA;
import org.kar.archidata.model.Data;
import org.kar.archidata.model.GenericDataSoftDelete;

import com.fasterxml.jackson.annotation.JsonInclude;

import dev.morphia.annotations.Entity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import jakarta.persistence.Column;
import jakarta.persistence.Table;

@Entity("Album")
@Table(name = "album")
@DataIfNotExists
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Album extends GenericDataSoftDelete {
	public static class AlbumChecker extends CheckJPA<Album> {
		public AlbumChecker() {
			super(Album.class);
		}
	}

	@Column(length = 256)
	public String name = null;
	@Column(length = 0)
	public String description = null;
	@Schema(description = "List of Id of the specific covers")
	@DataJson(targetEntity = Data.class)
	@Nullable
	public List<ObjectId> covers = null;
	public LocalDate publication = null;
}
