package com.iqser.red.service.persistence.service.v1.api.shared.mongo.document;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Change;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.DuplicatedTextRange;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Engine;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryState;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryType;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.ManualChange;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Position;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldDefaults;

@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Document(collection = "entity-log-entries")
public class EntityLogEntryDocument {

    @Id
    @EqualsAndHashCode.Include
    String id;
    String entryId;
    String entityLogId;
    String type;
    EntryType entryType;
    EntryState state;
    String value;
    String reason;
    String matchedRule;
    String legalBasis;

    List<Integer> containingNodeId;
    String closestHeadline;
    String section;

    List<Position> positions = new ArrayList<>();

    String textBefore;
    String textAfter;

    int startOffset;
    int endOffset;

    boolean imageHasTransparency;

    boolean dictionaryEntry;
    boolean dossierDictionaryEntry;

    boolean excluded;

    int paragraphPageIdx;

    List<Change> changes = new ArrayList<>();

    List<ManualChange> manualChanges = new ArrayList<>();

    Set<Engine> engines = new HashSet<>();

    Set<String> reference = new HashSet<>();

    Set<String> importedRedactionIntersections = new HashSet<>();

    List<DuplicatedTextRange> duplicatedTextRanges;

}
