package org.kar.karideo.model;

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.model.GenericDataSoftDelete;

import com.fasterxml.jackson.annotation.JsonInclude;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;

@Table(name = "season")
@DataIfNotExists
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Season extends GenericDataSoftDelete {
	@Column(nullable = false, length = 0)
	@Schema(description = "Name of the media (this represent the title)")
	public String name;
	@Column(length = 0)
	@Schema(description = "Description of the media")
	public String description;
	@Column(nullable = false)
	@Schema(description = "series parent ID")
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = Series.class)
	public Long parentId;
	@Schema(description = "List of Id of the specific covers")
	@DataJson()
	@Nullable
	public List<ObjectId> covers = null;
}