package com.iqser.red.service.persistence.management.v1.processor.entity.configuration;

import java.time.OffsetDateTime;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;

import com.iqser.red.service.persistence.management.v1.processor.entity.dossier.DossierTemplateEntity;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.configuration.HorizontalTextAlignment;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.configuration.VerticalTextAlignment;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.configuration.WatermarkOrientation;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@Entity
@Table(name = "watermark_configuration")
@NoArgsConstructor
@AllArgsConstructor
public class WatermarkEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    @Column
    private String name;
    @Column
    private boolean enabled;
    @Column(updatable = false, insertable = false, name = "dossier_template_id")
    private String dossierTemplateId;
    @Column(length = 4000)
    private String text;
    @Column
    private String hexColor;
    @Column
    private int opacity;
    @Column
    private int fontSize;
    @Column
    private String fontType;
    @Column
    private String createdBy;
    @Column
    private OffsetDateTime dateAdded;
    @Column
    private OffsetDateTime dateModified;
    @Column
    @Enumerated(EnumType.STRING)
    private WatermarkOrientation orientation;
    @Column
    @Enumerated(EnumType.STRING)
    private HorizontalTextAlignment horizontalTextAlignment;
    @Column
    @Enumerated(EnumType.STRING)
    private VerticalTextAlignment verticalTextAlignment;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "dossier_template_id")
    private DossierTemplateEntity dossierTemplate;

}
