package com.czg.order.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 实体类。
 *
 * @author zs
 * @since 2025-03-07
 */
@Data

@NoArgsConstructor
@AllArgsConstructor
@Table("tb_shop_order_statistic")
public class ShopOrderStatistic implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Auto)
    private Integer id;

    /**
     * 销售额
     */
    private BigDecimal saleAmount = BigDecimal.ZERO;

    /**
     * 销售数量
     */
    private Long saleCount = 0L;

    /**
     * 优惠金额
     */
    private BigDecimal discountAmount = BigDecimal.ZERO;

    /**
     * 优惠笔数
     */
    private Long discountCount = 0L;

    /**
     * 退款金额
     */
    private BigDecimal refundAmount = BigDecimal.ZERO;

    /**
     * 退款笔数
     */
    private Long refundCount = 0L;

    /**
     * 微信支付笔数
     */
    private Long wechatPayCount = 0L;

    /**
     * 微信支付金额
     */
    private BigDecimal wechatPayAmount = BigDecimal.ZERO;

    /**
     * 支付宝支付笔数
     */
    private Long aliPayCount = 0L;

    /**
     * 支付宝支付金额
     */
    private BigDecimal aliPayAmount = BigDecimal.ZERO;

    /**
     * 挂账支付笔数
     */
    private Long creditPayCount = 0L;

    /**
     * 挂账支付金额
     */
    private BigDecimal creditPayAmount = BigDecimal.ZERO;

    /**
     * 会员支付笔数
     */
    private Long memberPayCount = 0L;

    /**
     * 会员支付金额
     */
    private BigDecimal memberPayAmount = BigDecimal.ZERO;

    /**
     * 主扫支付笔数
     */
    private Long scanPayCount = 0L;

    /**
     * 主扫支付金额
     */
    private BigDecimal scanPayAmount = BigDecimal.ZERO;

    /**
     * 被扫支付笔数
     */
    private Long backScanPayCount = 0L;

    /**
     * 被扫支付金额
     */
    private BigDecimal backScanPayAmount = BigDecimal.ZERO;

    /**
     * 被扫支付笔数
     */
    private Long h5PayCount = 0L;

    /**
     * 被扫支付金额
     */
    private BigDecimal h5PayAmount = BigDecimal.ZERO;

    /**
     * 现金支付笔数
     */
    private Long cashPayCount = 0L;
    /**
     * 现金支付金额
     */
    private BigDecimal cashPayAmount = BigDecimal.ZERO;
    /**
     * 充值金额
     */
    private BigDecimal rechargeAmount = BigDecimal.ZERO;
    /**
     * 充值退款金额
     */
    private BigDecimal rechargeRefundAmount = BigDecimal.ZERO;
    /**
     * 客单价
     */
    private BigDecimal customerUnitPrice = BigDecimal.ZERO;
    /**
     * 翻台率
     */
    private BigDecimal tableTurnoverRate = BigDecimal.ZERO;
    /**
     * 新增会员数
     */
    private Long newMemberCount = 0L;
    /**
     * 店铺id
     */
    @JSONField(serialize = false)
    private Long shopId;
    /**
     * 创建时间
     */
    @JSONField(serialize = false, format = "yyyy-MM-dd")
    private LocalDate createDay;
    /**
     * 最近一次统计时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

}
