package com.neusoft.smart.pos.dto.org.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

@ApiModel
@Data
public class TableWithDishesRequest {
    
    @ApiModelProperty(value = "创建时间")
    protected Date createTime;
    
    @ApiModelProperty(value = "菜单列表")
    protected List<Menu> menuList = new ArrayList<>();
    
    @ApiModelProperty(value = "总计")
    protected BigDecimal totalPrice;
    
    @ApiModelProperty(value = "总计数量")
    protected Integer totalCount;
    
    @ApiModelProperty(value = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date paymentTime;
    
    @ApiModelProperty(value = "支付金额")
    private BigDecimal paymentAmount;
    
    @ApiModelProperty(value = "订单编号")
    private String orderNum;
    
    @ApiModelProperty(value = "支付类型")
    private Integer paymentType;
    
    @ApiModelProperty(value = "菜单来源 : pos  WeChat")
    private String dishesSource = "WeChat";
    
    @ApiModelProperty(name = "discountAmount", value = "订单优惠金额", dataType = "BigDecimal", example = "0.00")
    private BigDecimal discountAmount;
    
    @ApiModelProperty(name = "discountRate", value = "订单优惠率", dataType = "BigDecimal", example = "0.00")
    private BigDecimal discountRate;
    
    @ApiModelProperty(name = "memberDiscountRate", value = "会员优惠率", dataType = "BigDecimal", example = "0.00")
    private BigDecimal memberDiscountRate;
    
    @Data
    @ApiModel
    public static class Menu {
    
        @ApiModelProperty(value = "菜品id")
        protected Integer menuId;
        
        @ApiModelProperty(value = "菜品名")
        protected String name;
        
        @ApiModelProperty(value = "菜品价格")
        protected BigDecimal price;
        
        @ApiModelProperty(value = "图片")
        protected String image;
        
        @ApiModelProperty(value = "数量")
        protected Integer count;
        
        @ApiModelProperty(value = "已选口味")
        protected List<Flavor> selectedFlavors;
    
        @ApiModelProperty(value = "类别id")
        protected Integer categoryId;
        
        @ApiModelProperty(value = "类别名称")
        protected String category;
        
        @ApiModelProperty(value = "餐桌名称")
        protected String tableName;
    }
    
    @Data
    @ApiModel
    public static class Flavor {
        
        private Integer flavorId;
        
        private String flavor;
        
        private String remark;
    }
}
