package com.starry.admin.modules.clerk.module.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.starry.common.domain.BaseEntity;
import java.math.BigDecimal;
import java.time.LocalDate;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 店员排行对象 play_clerk_ranking_info
 *
 * @author admin
 * @since 2024-05-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("play_clerk_ranking_info")
public class PlayClerkRankingInfoEntity extends BaseEntity<PlayClerkRankingInfoEntity> {

    /**
     * UUID
     */
    private String id;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 店员ID
     */
    private String clerkId;

    /**
     * 是否为历史统计(1:是;0:不是)
     */
    private String historicalStatistics;

    /**
     * 日排名还是周排名（0:每日排名;1:每周排名）
     */
    private String weeklyRanking;

    /**
     * 统计批次
     */
    private Integer serialNumber;

    /**
     * 排序名次
     */
    private Integer rankingIndex;

    /**
     * 开始统计时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate startCountDate;

    /**
     * 结束统计时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate endCountDate;

    /**
     * 订单总数
     */
    private Integer orderNumber;

    /**
     * 订单金额
     */
    private BigDecimal orderMoney;

    /**
     * 续单数
     */
    private Integer orderContinueNumber;

    /**
     * 续单金额
     */
    private BigDecimal orderContinueMoney;

    /**
     * 超时未接单数量
     */
    private Integer ordersExpiredNumber = 0;

    /**
     * 续单比例
     */
    private BigDecimal orderContinueProportion = BigDecimal.ZERO;

    /**
     * 用户数
     */
    private Integer customNumber;

    /**
     * 订单平均价格
     */
    private BigDecimal averageUnitPrice = BigDecimal.ZERO;
    /**
     * 距离前一名相差金额
     */
    private BigDecimal previousMoney;

    /**
     * 统计时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate settlementDate;

}
