package com.imprimelibros.erp.pdf; import org.springframework.stereotype.Service; @Service public class TemplateRegistry { private final PdfModuleConfig config; public TemplateRegistry(PdfModuleConfig config) { this.config = config; } public String resolve(DocumentType type, String templateId) { String key = type.name() + ":" + templateId; String keyAlt = type.name() + "_" + templateId; // compatibilidad con properties if (config.getTemplates() == null) return null; String value = config.getTemplates().get(key); if (value == null) value = config.getTemplates().get(keyAlt); return value; } }