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

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 tongmg
 * @date 2020-02-21 10：43
 * @description 创建订单使用Response
 */
@ApiModel
@Data
@NoArgsConstructor
public class PostOrderResponse {

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

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

	@ApiModelProperty(name = "orderAmount", value = "订单金额", dataType = "Long" ,example="20.99")
	public Long orderAmount;

	@ApiModelProperty(name = "discountAmount", value = "订单优惠金额", dataType = "Long" ,example="2099")
	public Long discountAmount;

	@ApiModelProperty(name = "hasPay", value = "已支付金额", dataType = "Long" ,example="2099")
	public Long hasPay;

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

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

}
