package click.kamil.springstatemachineexporter.analysis.enricher;

import click.kamil.springstatemachineexporter.analysis.model.AnalysisResult;
import click.kamil.springstatemachineexporter.analysis.model.CodebaseMetadata;
import click.kamil.springstatemachineexporter.analysis.service.CodebaseIntelligenceProvider;
import click.kamil.springstatemachineexporter.ast.common.CodebaseContext;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

@Slf4j
public class PropertyEnricher implements AnalysisEnricher {

    @Override
    public void enrich(AnalysisResult result, CodebaseContext context, CodebaseIntelligenceProvider intelligence) {
        log.info("Enriching {} with properties", result.getName());
        
        Map<String, Map<String, String>> properties = intelligence.resolveProperties();
        
        result.addMetadata(CodebaseMetadata.builder()
                .properties(properties)
                .build());
    }
}
