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

import lombok.AllArgsConstructor;
import org.qinan.safetyeval.client.change.response.QualFilingCommitmentChangeCo;
import org.qinan.safetyeval.infrastructure.convertor.QualFilingCommitmentChangeDoConvertor;
import org.qinan.safetyeval.infrastructure.persistence.domainobject.QualFilingCommitmentChangeDO;
import org.qinan.safetyeval.infrastructure.persistence.queryservice.QualFilingCommitmentChangeQueryService;
import org.springframework.stereotype.Component;

/**
 * 法定代人承诺书-变更查询执行器
 *
 * @author ltq
 * @date 2026-07-02 09:38:30
 */
@Component
@AllArgsConstructor
public class QualFilingCommitmentChangeListQueryExe {

    private final QualFilingCommitmentChangeQueryService qualFilingCommitmentChangeQueryService;
    private final QualFilingCommitmentChangeDoConvertor qualFilingCommitmentChangeDoConvertor;

    /**
     * 根据ID查找法定代人承诺书-变更对象
     *
     * @param id 法定代人承诺书-变更ID
     * @return
     */
    public QualFilingCommitmentChangeCo execute(Long id) {
        QualFilingCommitmentChangeDO qualFilingCommitmentChangeDO = qualFilingCommitmentChangeQueryService.getById(id);
        return qualFilingCommitmentChangeDoConvertor.converDoToCo(qualFilingCommitmentChangeDO);
    }

}
