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

import static com.knecon.fforesight.databasetenantcommons.providers.utils.MagicConverter.convert;

import java.util.List;

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

import com.iqser.red.service.persistence.management.v1.processor.service.persistence.DossierAttributePersistenceService;
import com.iqser.red.service.persistence.service.v1.api.internal.resources.DossierAttributesResource;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.DossierAttribute;

import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
public class DossierAttributesInternalController implements DossierAttributesResource {

    private final DossierAttributePersistenceService dossierAttributePersistenceService;


    @Override
    public List<DossierAttribute> getDossierAttributes(@PathVariable(DOSSIER_ID_PARAM) String dossierId) {

        return convert(dossierAttributePersistenceService.getDossierAttributes(dossierId), DossierAttribute.class);
    }

}

