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.RedactionLogService;
import com.iqser.red.service.persistence.service.v1.api.internal.resources.RedactionLogResource;
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.RedactionLog;

import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
public class RedactionLogInternalController implements RedactionLogResource {

    private final RedactionLogService redactionLogService;


    public RedactionLog getRedactionLog(@PathVariable(DOSSIER_ID_PARAM) String dossierId,
                                        @PathVariable(FILE_ID) String fileId,
                                        @RequestParam(value = "excludedType", required = false) List<String> excludedTypes,
                                        @RequestParam(value = "withManualRedactions", required = false, defaultValue = "true") boolean withManualRedactions,
                                        @RequestParam(value = "includeFalsePositives", required = false, defaultValue = "false") boolean includeFalsePositives) {

        return redactionLogService.getRedactionLog(dossierId, fileId, excludedTypes);
    }

}
