package com.zsElectric.boot.business.service;

import com.zsElectric.boot.business.model.entity.UserOrderInfo;
import com.zsElectric.boot.business.model.form.UserOrderInfoForm;
import com.zsElectric.boot.business.model.form.applet.AppLevelOrderForm;
import com.zsElectric.boot.business.model.form.applet.AppUserPayForm;
import com.zsElectric.boot.business.model.query.UserOrderInfoQuery;
import com.zsElectric.boot.business.model.query.applet.AppUserOrderInfoQuery;
import com.zsElectric.boot.business.model.vo.UserOrderInfoVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.util.Map;

/**
 * 用户支付订单信息服务类
 *
 * @author zsElectric
 * @since 2025-12-16 16:25
 */
public interface UserOrderInfoService extends IService<UserOrderInfo> {

    /**
     * 用户支付订单信息分页列表
     *
     * @return {@link IPage<UserOrderInfoVO>} 用户支付订单信息分页列表
     */
    IPage<UserOrderInfoVO> getUserOrderInfoPage(UserOrderInfoQuery queryParams);

    /**
     * 获取用户支付订单信息表单数据
     *
     * @param id 用户支付订单信息ID
     * @return 用户支付订单信息表单数据
     */
    UserOrderInfoForm getUserOrderInfoFormData(Long id);

    /**
     * 新增用户支付订单信息
     *
     * @param formData 用户支付订单信息表单对象
     * @return 是否新增成功
     */
    boolean saveUserOrderInfo(UserOrderInfoForm formData);

    /**
     * 修改用户支付订单信息
     *
     * @param id       用户支付订单信息ID
     * @param formData 用户支付订单信息表单对象
     * @return 是否修改成功
     */
    boolean updateUserOrderInfo(Long id, UserOrderInfoForm formData);

    /**
     * 删除用户支付订单信息
     *
     * @param ids 用户支付订单信息ID，多个以英文逗号(,)分割
     * @return 是否删除成功
     */
    boolean deleteUserOrderInfos(String ids);

    AppUserPayForm createOrder(AppLevelOrderForm appLevelOrderForm);

    AppUserPayForm payOrder(String orderId);

    String orderQuery(String orderNo) throws Exception;

    Map<String, String> wechatPayNotify(HttpServletRequest request, HttpServletResponse response);

    String cancelOrder(String orderId);

    String refundOrder() throws Exception;

    Map<String, Object> refundCallback(HttpServletRequest request, HttpServletResponse response);

    IPage<UserOrderInfoVO> getTicketRecords(AppUserOrderInfoQuery queryParams);
}
