package com.neusoft.smart.pos.dto.trade.response;

import com.neusoft.smart.pos.constants.DictionaryConstant;
import com.neusoft.smart.pos.framework.utils.LocalDateTimeUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author zcf
 * @date 2018-11-28 10：43
 * @description 资金预授权订单生成使用Response
 */
@ApiModel
@Data
@NoArgsConstructor
public class PostGrantOrderResponse {

	@ApiModelProperty(name = "grantOrderNumber", value = "订单编号", dataType = "String" ,example="810825487965")
	public String grantOrderNumber;

	@ApiModelProperty(name = "seqNo", value = "当日订单序号", dataType = "BigDecimal" ,example="1")
	public Integer seqNo;

	@ApiModelProperty(name = "grantAmount", value = "授权金额", dataType = "BigDecimal" ,example="20.99")
	public BigDecimal grantAmount;

	@ApiModelProperty(name = "payCode", value = "第三方支付二维码", dataType = "String" ,example="weixin：//wxpay/s/An4baqw")
	public String payCode = "";

	@ApiModelProperty(name = "grantStatus", value = "授权状态@1:授权处理中@2:已授权@3:已解冻@4:已撤销", dataType = "String" ,example="1")
	public String grantStatus = DictionaryConstant.PAY_GRANT_STATUS_CLZ.getCode();

	@ApiModelProperty(name = "createdAt", value = "创建时间", dataType = "String" ,example="2018-05-26 18:55:45")
	public String createdAt;

	@ApiModelProperty(name = "grantTime", value = "授权完成时间", dataType = "String" ,example="2018-07-09 09:40:53")
	public String grantTime;

	public void setCreatedAt(Date createdAt) {
		this.createdAt = LocalDateTimeUtils.convertLocalDateTimeToString(LocalDateTimeUtils.convertDateToLocalDateTime(createdAt),LocalDateTimeUtils.DEFAULT_DATETIME_FORMAT);
	}
}
