package com.yc.ship.module.trade.service.order;


import com.yc.ship.framework.common.pojo.CommonResult;
import com.yc.ship.framework.security.core.LoginUser;
import com.yc.ship.module.trade.api.dto.GuideRefundConfirmRespDTO;
import com.yc.ship.module.trade.api.dto.GuideRefundReqDTO;
import com.yc.ship.module.trade.api.dto.GuideRefundRespDTO;
import com.yc.ship.module.trade.dal.dataobject.order.TradeOrderDO;

import java.util.Date;

/**
 * &#064;Description 订单交易业务处理service接口
 * &#064;Author qsl
 * &#064;Date 2025/2/27 15:03
 */
public interface TradeOrderBizService {

    /**
     * 更新订单锁
     */
    String UPDATE_CONFIRM_ORDER_LOCK = "confirmOrder:update:lock:%d";
    String UPDATE_SUPP_TICKET_LOCK = "suppTicket:update:lock:%d";
    String UPDATE_SUPP_TICKET_DETAIL_LOCK = "suppTicketDetail:update:lock:%d";
    String UPDATE_GUIDE_REFUND_LOCK = "guideRefund:update:lock:%d";

    void updatePlatAmountAfterProcessSuccess(TradeOrderDO tradeOrderDO);

    void updatePlatAmountAfterMergeSuccess(TradeOrderDO tradeOrderDO);

    void updatePlatAmountAfterRefund(TradeOrderDO tradeOrderDO);

    CommonResult<?> confirmOrder(LoginUser loginUser, Long orderId, Integer type, Integer sendSms);

    void handleConfirmOrderMessage(Long orderId);

    CommonResult<?> autoRefundByOverdue(String overdueDay);

    String finishOrder(Date taskDate);

    GuideRefundConfirmRespDTO getAndValidateGuideRefundData(GuideRefundReqDTO guideRefundReqDTO);

    GuideRefundConfirmRespDTO confirmChangeOrderDueToGuideRefund(GuideRefundReqDTO guideRefundReqDTO);

    GuideRefundRespDTO changeOrderDueToGuideRefund(GuideRefundReqDTO guideRefundReqDTO);
}
