package com.seer.teach.mall.response;

import com.baomidou.mybatisplus.annotation.TableField;
import com.seer.teach.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

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

@Getter
@Setter
@ToString
@Schema(name = "OrderResp", description = "商城订单")
public class OrderChildResp extends BaseEntity {

    @Schema(description = "子订单Id")
    private Integer id;

    /**
     * 下单用户Id
     */
    @Schema(description = "下单用户Id")
    private Integer userId;

    /**
     * 下单时间
     */
    @Schema(description = "下单时间")
    private LocalDateTime orderTime;

    /**
     * 收货地址Id
     */
    @Schema(description = "收货地址Id")
    private Integer addressId;

    @Schema(description = "收货人姓名")
    private String consignee;

    @Schema(description = "省份")
    @TableField("province")
    private String province;

    @Schema(description = "城市")
    @TableField("city")
    private String city;

    @Schema(description = "区/县")
    @TableField("district")
    private String district;

    @Schema(description = "详细地址")
    private String address;

    @Schema(description = "联系电话")
    private String mobile;

    @Schema(description = "(下单用户)订单备注")
    private String postscript;

    @Schema(description = "(后端使用)商家备注")
    private String remark;

    /**
     * 子订单编号
     */
    @Schema(description = "子订单编号")
    private String childOrderSn;

    /**
     * 关联父订单ID
     */
    @Schema(description = "关联父订单ID")
    private Integer parentOrderId;

    /**
     * 商家ID
     */
    @Schema(description = "商家ID")
    private Integer merchantUserId;

    /**
     * 子订单实际支付金额
     */
    @Schema(description = "子订单实际支付金额")
    private BigDecimal actualPrice;

    /**
     * 子订单总价（含运费）
     */
    @Schema(description = "子订单总价（含运费）")
    private BigDecimal orderPrice;

    /**
     * 商品总价
     */
    @Schema(description = "商品总价")
    private BigDecimal goodsPrice;

    /**
     * 订单总学豆
     */
    @Schema(description = "订单总学豆")
    private BigDecimal orderTotalCoin;

    /**
     * 子订单支付状态：0-待支付，1-已支付，2-退款中，3-退款完成
     */
    @Schema(description = "子订单支付状态：0-待支付，1-已支付，2-退款中，3-退款完成")
    private Integer payStatus;

    /**
     * 支付渠道编码
     */
    @Schema(description = "支付渠道编码")
    private String payChannelCode;

    /**
     * 子订单状态
     */
    @Schema(description = "子订单状态")
    private Integer orderStatus;

    /**
     * 评价状态，1：已评价，0：为评价
     */
    @Schema(description = "评价状态，1：已评价，0：为评价")
    private Integer commentStatus;

    /**
     * 售后状态
     */
    @Schema(description = "售后状态")
    private Integer afterSaleStatus;

    /**
     * 发货时间
     */
    @Schema(description = "发货时间")
    private Date deliveryTime;

    /**
     * 发货人ID
     */
    @Schema(description = "发货人ID")
    private Integer deliveryUserId;

    /**
     * 发货人的姓名
     */
    @Schema(description = "发货人的姓名")
    private String deliveryRealName;

    /**
     * 发货人的联系方式
     */
    @Schema(description = "发货人的联系方式")
    private String deliveryUserMobile;


    /**
     * 重量，单位kg，范围0.01-30 默认0.02）
     */
    @Schema(description = "重量，单位kg，范围0.01-30 默认0.02）")
    private String weight;

    /**
     * 商品体积，单位：m^3 平米
     */
    @Schema(description = "商品体积，单位：m^3 平米")
    private String volume;

    /**
     * 物流公司编码
     */
    @Schema(description = "物流公司编码")
    private String logisticsCode;

    /**
     * 物流单号（子订单独立发货，对应一个物流单号）
     */
    @Schema(description = "物流单号（子订单独立发货，对应一个物流单号）")
    private String shippingNo;

    /**
     * 物流公司（如“极兔速运”）
     */
    @Schema(description = "物流公司（如“极兔速运”）")
    private String logisticsCompany;

    /**
     * 发货时间
     */
    @Schema(description = "发货时间")
    private LocalDateTime shipTime;

    /**
     * 确认收货时间
     */
    @Schema(description = "确认收货时间")
    private LocalDateTime confirmTime;

    private String unionId;

    /**
     * 商品集合
     */
    @Schema(description = "商品集合")
    List<OrderItemResp> orderItems;
}
