package com.fzm.mall.server.front.order.model.po;

import com.fzm.mall.server.front.constant.MALLGlobalConfig;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class TranDto {

	/**
	 * 用户资产-转赠
	 */
	public static final Integer USER_ASSET_TRANSFER = 1;

	public static final Integer COIN_TYPE_NFT_OUT = 1;

	public static final Integer COIN_TYPE_NFT_IN = 2;

	private Integer id;
	
	//品牌方回收地址
	private String recoAddr;

	private String hash;
	
	private String fromAddr;
	
	private String toAddr;
	
	private BigDecimal amount;
	
	private String coin;
	
	//单价
	private BigDecimal price;
	
	//是否直接提货
	private Boolean delivery;
	
	//提货方式 1:自提  2：邮寄
	private Integer deliveryMode;
	
	private Long updateTime;
	//是否走链
	private Boolean isChain;

	private String tableId;

	private Integer tableType;
	//1:转让
	private Integer type;

	private Long tokenId;

	private String key;

	/**
	 * 1.外部nft;2.内部nft；3.内部普通
	 */
	private Integer coinType;

	public void initTokenId(String tokenIdStr) {
		String tokenId = tokenIdStr.replace(MALLGlobalConfig.GOODS_NFT_PREFIX,"");
		setTokenId(Long.valueOf(tokenId));
	}
}
