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

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

import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.DossierTemplate;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.importexport.ImportDossierTemplateRequest;

public interface DossierTemplateResource {

    String DOSSIER_TEMPLATE_PATH = "/dossier-template";

    String IMPORT_PATH = "/import";

    String DOSSIER_TEMPLATE_ID_PARAM = "dossierTemplateId";

    String DOSSIER_ID_PATH_PARAM = "/{" + DOSSIER_TEMPLATE_ID_PARAM + "}";

    @ResponseBody
    @PostMapping(value = InternalApi.BASE_PATH + DOSSIER_TEMPLATE_PATH + IMPORT_PATH, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    DossierTemplate importDossierTemplate(@RequestBody ImportDossierTemplateRequest request);

    @GetMapping(value = InternalApi.BASE_PATH + DOSSIER_TEMPLATE_PATH + DOSSIER_ID_PATH_PARAM, produces = MediaType.APPLICATION_JSON_VALUE)
    DossierTemplate getDossierTemplateById(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId);

}
