package com.izouma.nineth.dto.wallet;

import com.izouma.nineth.domain.PaymentInfo;
import com.izouma.nineth.domain.WalletRenewOrder;
import com.izouma.nineth.enums.FundChangeType;
import com.izouma.nineth.enums.PayMethod;
import com.izouma.nineth.enums.PayStatus;
import com.izouma.nineth.service.UserFundChangeLogService;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;

/**
 * 支付结果视图
 */
@Data
public class PayResultDTO {

    /**
     * 用户ID
     */
    private Long userId;


    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 资金账户ID
     */
    private Long userFundAccountId;


    /**
     * 支付方式
     */
    private PayMethod payMethod;

    /**
     * 支付状态
     */
    private PayStatus status;

    /**
     * 支付金额
     */
    private BigDecimal payAmt;

    /**
     * 商品标题
     */
    private String goodsTitle;


    /**
     * 失效时间
     */
    private String timeExpire;

    /**
     * 支付平台
     */
    private String payPlatform;

    /**
     * 变动类型
     */
    private FundChangeType changeType;

    /**
     * 二次确认token
     *
     */
    private String token;


    private Long orderId;

    private Long giftOrderId;


    public PayResultDTO(PaymentInfo paymentInfo){
        BeanUtils.copyProperties(paymentInfo, this);
        this.changeType = FundChangeType.PAYMENT;
    }


    public PayResultDTO(WalletRenewOrder walletRenewOrder){
        BeanUtils.copyProperties(walletRenewOrder, this);
        this.changeType = FundChangeType.RENEW;
    }


}
