package com.iqser.red.service.persistence.management.v1.processor.service.layoutparsing;

import java.util.Map;

import org.springframework.stereotype.Service;

import com.iqser.red.service.persistence.management.v1.processor.entity.dossier.DossierEntity;

@Service
public class LayoutParsingRequestIdentifierService {

    private enum IdentifierNames {
        DOSSIER_ID,
        FILE_ID,
        PRIORITY,
        DOSSIER_TEMPLATE_ID
    }


    public String parseDossierId(Map<String, String> identifiers) {

        return identifiers.get(IdentifierNames.DOSSIER_ID.name());
    }


    public String parseFileId(Map<String, String> identifiers) {

        return identifiers.get(IdentifierNames.FILE_ID.name());
    }


    public Boolean parsePriority(Map<String, String> identifiers) {

        return Boolean.parseBoolean(identifiers.get(IdentifierNames.PRIORITY.name()));
    }


    public Map<String, String> buildIdentifier(String dossierId, String fileId, boolean priority) {

        return Map.of(IdentifierNames.DOSSIER_ID.name(), dossierId, IdentifierNames.FILE_ID.name(), fileId, IdentifierNames.PRIORITY.name(), String.valueOf(priority));
    }

}
