package com.ym.mec.biz.service;

import com.ym.mec.biz.dal.entity.SellOrder;
import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
import com.ym.mec.biz.dal.entity.SubjectChange;
import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
import com.ym.mec.biz.dal.page.SubjectChangeQueryInfo;
import com.ym.mec.common.page.PageInfo;
import com.ym.mec.common.service.BaseService;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface SubjectChangeService extends BaseService<Integer, SubjectChange> {

    SubjectChange getChangeInfo(Integer id);

    /**
     * 支付声部更换费用
     *
     * @param id
     * @param amount
     * @param isUseBalancePayment
     * @return
     */
    Map payChange(Integer id, BigDecimal amount, Boolean isUseBalancePayment,Boolean isRepay) throws Exception;

    /**
     * 添加声部更换
     * @param subjectChange
     * @return
     */
    SubjectChange addChange(SubjectChange subjectChange);

    /**
     * 取消声部更换
     * @param id
     * @return
     */
    SubjectChange cancel(Integer id);

    /**
     *
     * @param studentId
     * @param musicGroupId
     * @return
     */
    SubjectChange getStudentOriginal(Integer studentId,String musicGroupId);


    /**
     * 订单回调
     * @param order
     */
    Boolean orderCallback(StudentPaymentOrder order);

    /**
     * 获取更换列表
     * @param queryInfo
     * @return
     */
    PageInfo<SubjectChange> getPageList(SubjectChangeQueryInfo queryInfo);

    /**
     * 更新成本差
     * @param id
     * @return
     */
    SubjectChange updateCostMargin(Integer id,BigDecimal costMargin);


    /**
     * 添加
     * @param orderId
     * @param musicGroupId
     * @param goodsIds
     * @param totalAmount
     * @param balance
     * @return
     */
    List<SellOrder> addSellOrder(Long orderId, String musicGroupId, List<Integer> goodsIds, BigDecimal totalAmount, BigDecimal balance,KitGroupPurchaseTypeEnum kitGroupPurchaseType);
}
