/*
 *      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.api.service;

import org.springblade.modules.finance.entity.OrderGrant;
import org.springblade.modules.finance.entity.PlatformAuthorization;
import org.springblade.modules.shopping.entity.Consign;
import org.springblade.modules.system.entity.UserApp;

import java.util.List;

/**
 * 商品规格值表 服务类
 *
 * @author BladeX
 * @since 2022-02-13
 */
public interface ITradeService {

    /**
	 * 	用户仓单收款
	 * 	 1、向用户打款
	 * 	 2、修改寄售订单金额
	 * @param consign 用户信息
	 */
	void transfer(Consign consign);

	/**
	 * 用户仓单收款
	 * 1、向用户打款
	 * 2、修改寄售订单金额
	 * @param user 用户
	 * @param transAmount 金额
	 * @param orderConsignId 寄售（进货）Id
	 */
	void transfer(UserApp user, String transAmount, Long orderConsignId, Consign consign);

	/**
	 * 寄售用户
	 * 平台收取用户订单
	 * @param consignId 用户ID
	 * @return List
	 */
	boolean platformReceipt(Long consignId);

	/**
	 * 预授解冻
	 * 1.查询用户已预约的预授订单 状态为1的数据
	 * 2.用户解冻
	 */
	void orderGrant(List<OrderGrant> list);

	/**
	 * 预授解冻
	 * 1.查询用户已预约的预授订单 状态为1的数据
	 * 2.用户解冻
	 */
	void platFormUnfreeze(List<PlatformAuthorization> list);

	/**
	 * 解冻用户预授权金额
	 * @param authNo 授权号
	 * @param amount 金额
	 * @return boolean
	 */
	boolean payUnfreeze(String authNo, Double amount);
}
