package com.haha.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

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

@Data
@TableName("t_timed_discount_record")
public class TimedDiscountRecord implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long activityId;

    private String activityName;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    private LocalDate executeDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime executeTime;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long shopId;

    private String shopName;

    private String deviceId;

    private String deviceName;

    private Integer totalProducts;

    private Integer priorityProducts;

    private Integer totalStock;

    private BigDecimal originalValue;

    private BigDecimal discountValue;

    private BigDecimal savedValue;

    private Integer status;

    private String errorMessage;

    private Integer executeDuration;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime createTime;

    @TableField(exist = false)
    private String statusLabel;

    @TableField(exist = false)
    private String statusColor;
}
