/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.finance.service;

import org.springblade.common.enums.AfterSalesTypeEnum;
import org.springblade.modules.api.request.AfterSalesRequest;
import org.springblade.modules.finance.entity.AfterSales;
import org.springblade.modules.finance.vo.AfterSalesVO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

/**
 * 售后表 服务类
 *
 * @author BladeX
 * @since 2023-06-15
 */
public interface IAfterSalesService extends IService<AfterSales> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param afterSales
	 * @return
	 */
	IPage<AfterSalesVO> selectAfterSalesPage(IPage<AfterSalesVO> page, AfterSalesVO afterSales);


	void add(Long orderId, String reason, AfterSalesTypeEnum typeEnum);

	void refund(Long afterSalesId);

    void submit(AfterSalesRequest request);

    void cancel(String afterSalesNo);

	/**
	 * 同意售后
	 * @param afterSalesNo
	 */
	void agree(String afterSalesNo);

	/**
	 * 拒绝售后
	 * @param afterSalesNo
	 */
	void refuse(String afterSalesNo, String refuseReason);

	void bindLogisticsNo(String afterSalesNo, String logisticsNo);

	IPage<AfterSalesVO> getUserAfterSalesList(IPage<Object> page, Long userId, Integer state);

	AfterSalesVO getUserAfterSalesDetail(Long afterSalesId);

	List<AfterSalesVO> getByGrouponIds(List<Long> longs);

	List<AfterSalesVO> getByGrouponId(Long grouponId, Long selfTakeId);

	/**
	 * 完成售后
	 */
	void finish(AfterSales afterSales);

	void confirm(Long orderId, Long afterSalesId);

    void refundSubmit(AfterSalesRequest request);

    void applyGrouponAfterRefund(Long orderId);
}
