package com.cpop.mall.business.entity;

import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 商城订单表 实体类。
 *
 * @author DB
 * @since 2023-10-24
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_mall_order", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class Order extends BaseEntity implements Serializable {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中:5:订单取消;6:过期)
     */
    private Integer orderStatus;

    /**
     * 上一个状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中:5:订单取消;6:过期)
     */
    private Integer previousStatus;

    /**
     * 外部订单号
     */
    private String outOrderNo;

    /**
     * 总金额
     */
    private BigDecimal totalAmount;

    /**
     * 总积分
     */
    private Long totalPoint;

    /**
     * 品牌id
     */
    private String brandId;

    /**
     * 模板id
     */
    private String templateId;

    /**
     * 产品名
     */
    private String productNames;

    /**
     * 下单用户id
     */
    private String payUserId;

    /**
     * 下单人真实姓名
     */
    private String payUserName;

    /**
     * 收货人名
     */
    private String receiveName;

    /**
     * 收货人电话
     */
    private String receivePhone;

    /**
     * 收货地址
     */
    private String receiveAddress;

    /**
     * 物流订单号
     */
    private String logisticsOrder;

    /**
     * 支付方式(0:微信支付;1:积分支付)
     */
    private Integer payType;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 是否评价(0否1是)
     */
    private String haveEvaluate;

    /**
     * 逻辑删除（0否1是）
     */
    @Column(isLogicDelete = true)
    private Boolean isDelete;

}
