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

import java.util.ArrayList;
import java.util.List;

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

import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLogLegalBasis;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Document(collection = "entity-logs")
public class EntityLogDocument {

    @Id
    @EqualsAndHashCode.Include
    private String id;

    private String dossierId;
    private String fileId;

    private long analysisVersion;

    private int analysisNumber;

    @DBRef
    private List<EntityLogEntryDocument> entityLogEntryDocuments = new ArrayList<>();

    private List<EntityLogLegalBasis> legalBasis = new ArrayList<>();

    private long dictionaryVersion = -1;
    private long dossierDictionaryVersion = -1;

    private long rulesVersion = -1;
    private long legalBasisVersion = -1;

}
