package com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped;

import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;

import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.Rectangle;

import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class ManualRedactionEntry extends BaseAnnotation {

    private String type;
    private String value;
    private String reason;
    private String legalBasis;
    private String section;
    private boolean rectangle;
    private boolean addToDictionary;
    private boolean addToDossierDictionary;
    private List<Rectangle> positions = new ArrayList<>();
    private String textBefore;
    private String textAfter;
    private String sourceId;


    @Builder
    public ManualRedactionEntry(String annotationId,
                                String fileId,
                                String user,
                                AnnotationStatus status,
                                OffsetDateTime requestDate,
                                OffsetDateTime processedDate,
                                OffsetDateTime softDeletedTime,
                                String value,
                                String textBefore,
                                String textAfter,
                                boolean rectangle,
                                boolean addToDictionary,
                                boolean addToDossierDictionary,
                                String legalBasis,
                                String section,
                                String reason,
                                String type,
                                List<Rectangle> positions,
                                String sourceId) {

        super(annotationId, fileId, user, status, requestDate, processedDate, softDeletedTime);
        this.textBefore = textBefore;
        this.textAfter = textAfter;
        this.value = value;
        this.rectangle = rectangle;
        this.addToDictionary = addToDictionary;
        this.addToDossierDictionary = addToDossierDictionary;
        this.legalBasis = legalBasis;
        this.section = section;
        this.reason = reason;
        this.type = type;
        this.positions = positions != null ? positions : new ArrayList<>();
        this.sourceId = sourceId;
    }

}
