package com.trade.client.trade.purchase.service;

import com.trade.client.trade.purchase.dto.PurchaseContractSearchDto;
import com.trade.client.trade.purchase.dto.PurchaseContractUploadDto;
import com.trade.common.core.page.GridPage;
import com.trade.service.purchase.dto.PurchaseContractDetailDto;
import com.trade.service.purchase.dto.PurchaseContractDto;
import org.springframework.web.bind.annotation.RequestBody;

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

    /**
     * 创建采购合同(销售合同提交时，自动创建采购合同)
     * 
     * @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 编辑结果
     */
    Boolean upsertPurchaseContract(String operate, PurchaseContractDetailDto purchaseContractDto);

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