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

import com.neusoft.smart.pos.framework.bean.PaginationExtendBean;
import com.neusoft.smart.pos.framework.utils.LocalDateTimeUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @author zcf
 * @date 2018-12-29 09：39
 * @description 商户门店日报统计查询使用Response
 */
@ApiModel
@Data
public class GetMemberOrdersResponse {


	@ApiModelProperty(name = "orderAmount", value = "订单总金额", dataType = "list")
	public BigDecimal totalAmount;

	@ApiModelProperty(name = "paginationExtendBean", value = "订单分页数据", dataType = "Object")
	public PaginationExtendBean<MemberOrder> paginationExtendBean;

	@Data
	@ApiModel
	public static class MemberOrder{
		
		@ApiModelProperty(name = "orgId", value = "集团ID", dataType = "Integer" ,example="1")
		public Integer orgId;
		
		@ApiModelProperty(name = "shopId", value = "门店ID", dataType = "Integer" ,example="1")
		public Integer shopId;

		private String tradeId;

		@ApiModelProperty(name = "shopName", value = "门店名称", dataType = "String" ,example="门店名称")
		public String shopName = "";
		
		@ApiModelProperty(name = "orderNumber", value = "订单编号", dataType = "String" ,example="1")
		public String orderNumber = "";
		
		@ApiModelProperty(name = "serialNo", value = "POS机SN编号", dataType = "String" ,example="1")
		public String serialNo = "";
		
		@ApiModelProperty(name = "deviceName", value = "设备名称", dataType = "String" ,example="1")
		public String deviceName = "";
		
		@ApiModelProperty(name = "customerName", value = "收银员名称", dataType = "String" ,example="1")
		public String customerName = "";
		
		@ApiModelProperty(name = "orderAmount", value = "订单金额", dataType = "BigDecimal" ,example="1")
		public BigDecimal orderAmount;
		
		@ApiModelProperty(name = "realPayAmount", value = "实付金额", dataType = "BigDecimal" ,example="1")
		public BigDecimal realPayAmount;
		
		@ApiModelProperty(name = "payAmount", value = "应付金额", dataType = "BigDecimal" ,example="1")
		public BigDecimal payAmount;
		
		@ApiModelProperty(name = "discountAmount", value = "优惠金额", dataType = "BigDecimal" ,example="1")
		public BigDecimal discountAmount;
		
		@ApiModelProperty(name = "balance", value = "员工卡余额", dataType = "BigDecimal" ,example="1")
		public BigDecimal balance;
		
		@ApiModelProperty(name = "payType", value = "支付方式", dataType = "String" ,example="1")
		public String payType = "";
		
		@ApiModelProperty(name = "payTypeName", value = "支付方式名称", dataType = "String" ,example="1")
		public String payTypeName = "";
		
		@ApiModelProperty(name = "orderType", value = "订单类型", dataType = "String" ,example="1")
		public String orderType = "";
		
		@ApiModelProperty(name = "orderTypeName", value = "订单类型名称", dataType = "String" ,example="1")
		public String orderTypeName = "";
		
		@ApiModelProperty(name = "orderStatus", value = "订单状态", dataType = "String" ,example="1")
		public String orderStatus = "";
		
		@ApiModelProperty(name = "orderStatusName", value = "订单状态名称", dataType = "String" ,example="1")
		public String orderStatusName = "";
		
		@ApiModelProperty(name = "memberPoint", value = "会员积分", dataType = "Integer" ,example="1")
		public Integer memberPoint;
		
		@ApiModelProperty(name = "createdAt", value = "创建时间", dataType = "String" ,example="2018-12-29 10:34:18")
		public String createdAt = "";
		
		@ApiModelProperty(name = "orderDetails", value = "订单详情", dataType = "List")
		public List<MemberOrderDetail> orderDetails;
		
		public void setScore(Integer score) {
			this.memberPoint = score;
		}
		
		public void setCreatedAt(Date createdAt) {
			this.createdAt = LocalDateTimeUtils.convertLocalDateTimeToString(LocalDateTimeUtils.convertDateToLocalDateTime(createdAt),LocalDateTimeUtils.DEFAULT_DATETIME_FORMAT);
		}
		
		public void setCreatedBy(String createdBy) {
			this.customerName = createdBy;
		}
	}
	
	@Data
	@ApiModel
	public static class MemberOrderDetail{
		
		@ApiModelProperty(name = "itemName", value = "菜品名称", dataType = "String" ,example="菜品名称")
		public String itemName = "";
		
		@ApiModelProperty(name = "categoryName", value = "菜品所属类别名称", dataType = "String" ,example="1")
		public String categoryName = "";
		
		@ApiModelProperty(name = "categoryNumber", value = "商品所属类别编号", dataType = "String" ,example="1")
		public String categoryNumber = "";
		
		@ApiModelProperty(name = "unitPrice", value = "商品单价", dataType = "BigDecimal" ,example="1")
		public BigDecimal unitPrice;
		
		@ApiModelProperty(name = "quantity", value = "商品数量", dataType = "BigDecimal" ,example="1")
		public BigDecimal quantity;
		
		@ApiModelProperty(name = "finalPrice", value = "商品总价", dataType = "BigDecimal" ,example="1")
		public BigDecimal finalPrice;
		
	}
}
