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 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 = "component-logs")
public class ComponentLogDocument {

    @Id
    @EqualsAndHashCode.Include
    String id; // dossierId/fileId = componentLogId

    String dossierId;
    String fileId;

    int analysisNumber;
    long componentRulesVersion = -1;

    @DBRef
    List<ComponentLogEntryDocument> componentLogEntryDocuments = new ArrayList<>();

}
