package com.jsowell.pile.vo.web;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UpdateMemberBalanceDTO {
	/**
	 * 会员id
	 */
	private String memberId;

	/**
	 * 更新类型
	 * 1-进账；2-出账
	 */
	private String type;

	/**
	 * 子类型
	 * 进账：10-充值, 11-赠送, 12-订单结算退款
	 * 出账：20-后管扣款, 21-订单付款, 22-用户退款
	 */
	private String subType;

	/**
	 * 充值/扣款 本金金额
	 */
	private BigDecimal updatePrincipalBalance;

	/**
	 * 充值/扣款 赠送金额
	 */
	private BigDecimal updateGiftBalance;

	/**
	 * 关联订单
	 * 只有支付订单和订单退款时才有值
	 */
	private String relatedOrderCode;

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
				.append("memberId", memberId)
				.append("type", type)
				.append("subType", subType)
				.append("updatePrincipalBalance", updatePrincipalBalance)
				.append("updateGiftBalance", updateGiftBalance)
				.toString();
	}
}
