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.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.legalbasis.LegalBasis;

public interface LegalBasisMappingResource {

    String LEGAL_BASIS_PATH = "/legalBasis";
    String VERSION_PATH = "/version";
    String DOSSIER_TEMPLATE_PARAMETER_NAME = "dossierTemplateId";
    String DOSSIER_TEMPLATE_PATH_VARIABLE = "/{" + DOSSIER_TEMPLATE_PARAMETER_NAME + "}";


    @ResponseBody
    @ResponseStatus(value = HttpStatus.OK)
    @GetMapping(value = InternalApi.BASE_PATH + LEGAL_BASIS_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
    List<LegalBasis> getLegalBasisMapping(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId);


    @ResponseStatus(HttpStatus.OK)
    @GetMapping(value = InternalApi.BASE_PATH + LEGAL_BASIS_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE + VERSION_PATH)
    long getVersion(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId);

}
