package com.cf.imes.module.system.service.funds.purchase;

import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.module.system.controller.admin.funds.purchase.vo.OrgEarliestPurchaseProductRespVO;
import com.cf.imes.module.system.controller.admin.funds.purchase.vo.PurchaseRecordPageReqVO;
import com.cf.imes.module.system.controller.admin.funds.purchase.vo.PurchaseRecordRespVO;
import com.cf.imes.module.system.dal.dataobject.funds.purchase.PurchaseRecordDO;

import java.math.BigDecimal;

/**
 * @author 软件购买接口
 */
public interface PurchaseService {
    /**
     * 查询购买记录
     *
     * @param id
     * @return
     */
    PurchaseRecordDO getRecord(Long id);

    /**
     * 查询购买记录分页
     *
     * @param pageReqVO
     * @return
     */
    PageResult<PurchaseRecordRespVO> getPurchaseRecord(PurchaseRecordPageReqVO pageReqVO);

    /**
     * 创建购买记录
     *
     * @param purchaseRecordDO
     */
    void createRecord(PurchaseRecordDO purchaseRecordDO);

    /**
     * 更新购买记录为可开票
     *
     * @param purchaseRecordId
     * @param organId
     */
    void updateRecordInvoicable(Long purchaseRecordId, Long organId);

    /**
     * 查询组织下最早购买产品定价规则
     *
     * @param organId
     * @return
     */
    OrgEarliestPurchaseProductRespVO getOrgEarliestProductDetail(Long organId);

    /**
     * 查询可开票金额
     *
     * @param organId
     * @return
     */
    BigDecimal getInvoicingAmount(Long organId);
}
