package org.qinan.safetyeval.app.change.executor.query;

import lombok.AllArgsConstructor;
import org.qinan.safetyeval.client.change.response.QualFilingMaterialChangeCo;
import org.qinan.safetyeval.infrastructure.convertor.QualFilingMaterialChangeDoConvertor;
import org.qinan.safetyeval.infrastructure.persistence.domainobject.QualFilingMaterialChangeDO;
import org.qinan.safetyeval.infrastructure.persistence.queryservice.QualFilingMaterialChangeQueryService;
import org.springframework.stereotype.Component;

/**
 * 备案申请材料-变更查询执行器
 *
 * @author ltq
 * @date 2026-07-02 10:04:07
 */
@Component
@AllArgsConstructor
public class QualFilingMaterialChangeListQueryExe {

    private final QualFilingMaterialChangeQueryService qualFilingMaterialChangeQueryService;
    private final QualFilingMaterialChangeDoConvertor qualFilingMaterialChangeDoConvertor;

    /**
     * 根据ID查找备案申请材料-变更对象
     *
     * @param id 备案申请材料-变更ID
     * @return
     */
    public QualFilingMaterialChangeCo execute(Long id) {
        QualFilingMaterialChangeDO qualFilingMaterialChangeDO = qualFilingMaterialChangeQueryService.getById(id);
        return qualFilingMaterialChangeDoConvertor.converDoToCo(qualFilingMaterialChangeDO);
    }

}
