package com.cool.store.response;

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

import java.math.BigDecimal;


@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrderSummaryResponse {
    @ApiModelProperty("废弃")
    private String profit_total_amount;
    @ApiModelProperty("废弃")
    private String order_valid_count;
    @ApiModelProperty("废弃")
    private String refund_total_amount;
    @ApiModelProperty("废弃")
    private String order_refund_count;

    @ApiModelProperty("pos收银系统数据")
    private PosData pos_data;

    @ApiModelProperty("平台外卖数据（美团+饿了么）")
    private TakeawayData takeaway_data;

    @ApiModelProperty("APP数据")

    private WenmaAppData wenma_app_data;

    @ApiModelProperty("废弃")
    private Boolean is_cache;
    @ApiModelProperty("废弃")
    private Integer cache_refresh_time;
}

// POS数据实体类
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
class PosData {
    @ApiModelProperty("废弃")
    private Integer order_refund_count;
    @ApiModelProperty("废弃")
    private  String projected_income;

    @ApiModelProperty("实收总金额必需 所选时间内实际收入=订单总金额+存储总金额-优惠总金额-退款总金额")
    private BigDecimal profit_total_amount;

    @ApiModelProperty("订单总金额必需 所选时间内所有订单的金额总额（为优惠前金额，此金额包含配送费和其他形式费用）")
    private BigDecimal  pay_success_total_amount;

    @ApiModelProperty("储值总金额")
    private BigDecimal  recharge_total_amount;

    @ApiModelProperty("优惠总金额")
    private BigDecimal  discount_total_amount;

    @ApiModelProperty("退款总金额")
    private BigDecimal  refund_total_amount;

    @ApiModelProperty("商家承担优惠金额必需 统计时间内，收银系统中，外部优惠活动的商家承担优惠")
    private BigDecimal  out_discount_merchant_contribute_total_amount;

    @ApiModelProperty("配送费支出必需 小程序外卖的配送费支出")
    private BigDecimal  logistics_cost_price_total_amount;

    @ApiModelProperty("补贴总金额 补贴活动中给店家补贴金额")
    private BigDecimal  subsidy_total_amount;

    @ApiModelProperty("有效订单笔数  统计时间内有效订单（已经支付订单数量-退款订单数量）")
    private Integer order_valid_num;
}

// 外卖数据实体类
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
class TakeawayData {
    @ApiModelProperty("废弃")
    private BigDecimal  order_refund_count;
    @ApiModelProperty("废弃")
    private BigDecimal  refund_total_amount;
    @ApiModelProperty("废弃")
    private BigDecimal  total_deliver_fee;
    @ApiModelProperty("预计收入 统计时间内，今日下单订单的预收之和，不包含已取消和全额退款订单")
    private BigDecimal  total_pre_income;
    @ApiModelProperty("营业额 统计时间内，包含商品销售额、餐盒费、自配送费之和")
    private BigDecimal  total_sales_price;
    @ApiModelProperty("有效订单笔数 统计时间内，今日下单订单数量，不包含取消订单与全部退款订单")
    private Integer total_valid_order_sum;
    @ApiModelProperty("商品销售额 统计时间内，有效订单的商品价格之和")
    private BigDecimal  total_goods_sales_price;
    @ApiModelProperty("餐盒费 统计时间内，有效订单的餐盒费之和")
    private BigDecimal  total_box_price;
    @ApiModelProperty("自配送费 统计时间内，有效订单的自配送订单的配送费之和")
    private BigDecimal  total_original_deliver_fee;
    @ApiModelProperty("平台各个汇总数据")
    private SummaryData summary_data;
}

// 汇总数据实体类
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
class SummaryData {
    @ApiModelProperty("美团")
    private PlatformData meituan;
    @ApiModelProperty("饿了么")
    private PlatformData eleme;
}

// 平台数据实体类
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
class PlatformData {
    @ApiModelProperty("预计收入")
    private BigDecimal  pre_income;
    @ApiModelProperty("营业额")
    private BigDecimal  sales_price;
    @ApiModelProperty("有效订单数")
    private Integer valid_order_sum;
    @ApiModelProperty("商品销售额")
    private BigDecimal  goods_sales_price;
    @ApiModelProperty("餐盒费")
    private BigDecimal  box_price;
    @ApiModelProperty("自配送费")
    private BigDecimal  deliver_fee;
    @ApiModelProperty("废弃字段（仅饿了么使用,美团未使用)")
    private BigDecimal  original_deliver_fee;
    @ApiModelProperty("废弃字段")
    private BigDecimal cost_price;

}

// 文马APP数据实体类
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
class WenmaAppData {
    @ApiModelProperty("预计收入  APP订单预计收入")
    private BigDecimal  total_pre_income;
    @ApiModelProperty("有效订单数 ")
    private Integer valid_order_sum;
    @ApiModelProperty("菜品总金额  APP订单菜品总金额")
    private BigDecimal  goods_sales_price;
    @ApiModelProperty("退款总金额  所选时间内退款订单的金额总额")
    private BigDecimal  refund_total_amount;
    @ApiModelProperty("优惠总金额  APP订单优惠总金额")
    private BigDecimal  discount_total_price;
    @ApiModelProperty("废弃")
    private BigDecimal  total_sales_price;
    @ApiModelProperty("废弃")
    private BigDecimal  order_refund_count;
}