package com.ruoyi.loanpricing.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.loanpricing.domain.dto.CorporateLoanPricingCreateDTO;
import com.ruoyi.loanpricing.domain.dto.PersonalLoanPricingCreateDTO;
import com.ruoyi.loanpricing.domain.entity.LoanPricingWorkflow;
import com.ruoyi.loanpricing.domain.vo.LoanPricingWorkflowListVO;
import com.ruoyi.loanpricing.domain.vo.LoanPricingWorkflowVO;

import java.util.List;
import java.util.Map;

/**
 * 利率定价流程Service接口
 *
 * @author ruoyi
 * @date 2025-01-19
 */
public interface ILoanPricingWorkflowService
{
    /**
     * 发起个人客户利率定价流程
     *
     * @param dto 个人客户发起DTO
     * @return 结果
     */
    public LoanPricingWorkflow createPersonalLoanPricing(PersonalLoanPricingCreateDTO dto);

    /**
     * 发起企业客户利率定价流程
     *
     * @param dto 企业客户发起DTO
     * @return 结果
     */
    public LoanPricingWorkflow createCorporateLoanPricing(CorporateLoanPricingCreateDTO dto);

    /**
     * 查询利率定价流程编辑数据
     *
     * @param serialNum 业务方流水号
     * @return 编辑用流程数据
     */
    public LoanPricingWorkflow selectEditableLoanPricingBySerialNum(String serialNum);

    /**
     * 编辑个人客户利率定价流程
     *
     * @param serialNum 业务方流水号
     * @param dto 个人客户编辑DTO
     * @return 更新后的流程数据
     */
    public LoanPricingWorkflow updatePersonalLoanPricing(String serialNum, PersonalLoanPricingCreateDTO dto);

    /**
     * 编辑企业客户利率定价流程
     *
     * @param serialNum 业务方流水号
     * @param dto 企业客户编辑DTO
     * @return 更新后的流程数据
     */
    public LoanPricingWorkflow updateCorporateLoanPricing(String serialNum, CorporateLoanPricingCreateDTO dto);

    /**
     * 查询利率定价流程列表
     *
     * @param loanPricingWorkflow 利率定价流程信息
     * @return 利率定价流程集合
     */
    public List<LoanPricingWorkflow> selectLoanPricingList(LoanPricingWorkflow loanPricingWorkflow);

    /**
     * 分页查询利率定价流程列表
     *
     * @param page 分页参数
     * @param loanPricingWorkflow 利率定价流程信息
     * @return 分页结果
     */
    public IPage<LoanPricingWorkflowListVO> selectLoanPricingPage(Page<LoanPricingWorkflowListVO> page, LoanPricingWorkflow loanPricingWorkflow);

    /**
     * 查询利率定价流程详情
     *
     * @param serialNum 业务方流水号
     * @return 利率定价流程
     */
    public LoanPricingWorkflowVO selectLoanPricingBySerialNum(String serialNum);

    /**
     * 设定执行利率
     *
     * @param serialNum   业务方流水号
     * @param executeRate 执行利率
     * @return 是否成功
     */
    public boolean setExecuteRate(String serialNum, String executeRate);

    /**
     * 解密历史流程客户名称和证件号码密文字段
     *
     * @return 迁移统计
     */
    public Map<String, Long> decryptWorkflowSensitiveFields();
}
