package com.iqser.red.service.persistence.v1.internal.api.controller;

import java.util.List;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.iqser.red.service.persistence.management.v1.processor.service.EntityLogService;
import com.iqser.red.service.persistence.service.v1.api.internal.resources.EntityLogResource;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;

import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
public class EntityLogInternalController implements EntityLogResource {

    private final EntityLogService entityLogService;


    @Override
    public EntityLog getEntityLog(@PathVariable(DOSSIER_ID) String dossierId,
                                  @PathVariable(FILE_ID) String fileId,
                                  @RequestParam(value = "excludedType", required = false, defaultValue = "") List<String> excludedTypes,
                                  @RequestParam(value = "includeUnprocessed", required = false, defaultValue = FALSE) boolean includeUnprocessed) {

        return entityLogService.getEntityLog(dossierId, fileId, excludedTypes, includeUnprocessed);
    }

}
