package com.jeesharp.business.modules.finance.payrefund.service;

import com.jeesharp.business.modules.finance.payrefund.entity.PayRefundOrder;
import com.jeesharp.business.modules.finance.payrefund.vo.PayRefundOrderQueryVO;
import com.jeesharp.framework.mybatis.core.service.BaseInterface;

import java.math.BigDecimal;

/**
 * 支付退款单领域服务接口。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
public interface PayRefundOrderService extends BaseInterface<PayRefundOrder, PayRefundOrderQueryVO> {

    PayRefundOrder getByOutRefundNo(String outRefundNo);

    BigDecimal sumSuccessRefundAmountByMallOrderId(String mallOrderId);

    PayRefundOrder findActiveByAfterSaleId(String afterSaleId);

    /**
     * 新增退款单（禁止预置主键走 update）。
     */
    PayRefundOrder createRefundOrder(PayRefundOrder order);

    /**
     * 更新退款单（须已存在）。
     */
    void updateRefundOrder(PayRefundOrder order);
}
