package com.xmomen.module.order.model;

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

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import com.xmomen.module.order.model.CreateOrder.OrderItem;

import lombok.Data;

public @Data class WxCreateOrder implements Serializable {

    // 订单类型，默认为0
    @NotNull
    private Integer orderType = 0;
    

    private String orderNo;
    

    private Integer orderSource = 1;


    private String name;


    private String memberCode;


    private String phone;


    private Integer paymentMode;


    private Integer otherPaymentMode;


    private String paymentRelationNo;

    // 收货人电话，不能为空
    @NotNull
    @NotBlank
    private String consigneePhone;


    // 收货人姓名，不能为空
    @NotNull
    @NotBlank
    private String consigneeName;


    // 收货人地址，不能为空
    @NotNull
    @NotBlank
    private String consigneeAddress;


    private String remark;


    private Integer discount;


    private Integer createUserId;

    private Date appointmentTime;

    private BigDecimal discountPrice;

    private BigDecimal totalPrice;
    

    private List<OrderItem> orderItemList;

    // 订单项
    public static class OrderItem implements Serializable {
        // 订单项ID，不能为空
        @NotNull
        private Integer orderItemId;
        // 订单项数量，不能为空
        @NotNull
        private BigDecimal itemQty;

        public Integer getOrderItemId() {
            return orderItemId;
        }

        public void setOrderItemId(Integer orderItemId) {
            this.orderItemId = orderItemId;
        }

        public BigDecimal getItemQty() {
            return itemQty;
        }

        public void setItemQty(BigDecimal itemQty) {
            this.itemQty = itemQty;
        }
    }
}
