package com.trade.client.trade.purchasecontract.service;

import com.trade.client.trade.purchasecontract.dto.PurchaseContractSearchDto;
import com.trade.client.trade.purchasecontract.dto.PurchaseContractUploadDto;
import com.trade.common.core.page.GridPage;
import com.trade.service.contract.util.esign.bizprocess.SignedBizProcessor;
import com.trade.service.filestorage.dto.FileAbstractDto;
import com.trade.service.trade.purchasecontract.dto.PurchaseContractDetailDto;
import com.trade.service.trade.purchasecontract.dto.PurchaseContractDto;

import java.util.List;

/**
 * 采购合同表基础表服务接口
 *
 * @author hlb
 * @since 2024-09-07 16:30:10
 */
public interface PurchaseContractService extends SignedBizProcessor {

    /**
     * 创建采购合同(销售合同提交时，自动创建采购合同)
     * 
     * @param salesContractId
     */
    void createPurchaseContract(Long salesContractId);

    /**
     * 获取采购合同列表
     *
     * @param searchDto 采购合同搜索条件
     * @return 采购合同列表
     */
    GridPage<PurchaseContractDto> getPurchaseContractBySearch(PurchaseContractSearchDto searchDto);

    /**
     * 根据id获取采购合同详情
     * 
     * @param id
     * @return
     */
    PurchaseContractDetailDto findPurchaseContractDetailById(Long id);

    /**
     * 编辑采购合同
     *
     * @param operate 操作：保存（save）；或提交（submit）
     * @param purchaseContractDto 实体对象
     * @return 编辑结果
     */
    List<FileAbstractDto> upsertPurchaseContract(String operate, PurchaseContractDetailDto purchaseContractDto);

    /**
     * 上传采购合同
     *
     * @param uploadDto
     * @return 上传结果
     */
    Boolean uploadPurchaseContract(PurchaseContractUploadDto uploadDto);

    /**
     * 采购合同（含承诺函）电子签章
     * 
     * @param purchaseContractId
     * @return
     */
    Boolean esignPurchaseContract(Long purchaseContractId);
}
