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

import java.util.List;

import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.Dossier;

@ResponseStatus(value = HttpStatus.OK)
public interface DossierResource {

    String REST_PATH = "/dossier";

    String DOSSIER_ID_PARAM = "dossierId";
    String DOSSIER_ID_PATH_PARAM = "/{" + DOSSIER_ID_PARAM + "}";

    String INCLUDE_DELETED_PARAM = "includeDeleted";
    String INCLUDE_ARCHIVED_PARAM = "includeArchived";


    @GetMapping(value = InternalApi.BASE_PATH + REST_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
    List<Dossier> getAllDossiers(@RequestParam(name = INCLUDE_ARCHIVED_PARAM, defaultValue = "false", required = false) boolean includeArchived,
                                 @RequestParam(name = INCLUDE_DELETED_PARAM, defaultValue = "false", required = false) boolean includeDeleted);


    @GetMapping(value = InternalApi.BASE_PATH + REST_PATH + DOSSIER_ID_PATH_PARAM, produces = MediaType.APPLICATION_JSON_VALUE)
    Dossier getDossierById(@PathVariable(DOSSIER_ID_PARAM) String dossierId,
                           @RequestParam(name = INCLUDE_ARCHIVED_PARAM, defaultValue = "false", required = false) boolean includeArchived,
                           @RequestParam(name = INCLUDE_DELETED_PARAM, defaultValue = "false", required = false) boolean includeDeleted);

}
