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.LocalDateTime;
import java.time.LocalTime;
import java.util.List;

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

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

    private String activityName;

    private String activityDesc;

    @JsonFormat(pattern = "HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalTime startTime;

    @JsonFormat(pattern = "HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalTime endTime;

    private Integer discountType;

    private BigDecimal discountValue;

    private BigDecimal minDiscountPrice;

    private Integer applyScope;

    private Integer deviceScope;

    private Integer productScope;

    private String productTypes;

    private String priorityProductTypes;

    private Integer minStock;

    private Integer maxStock;

    private Integer status;

    private Integer autoExecute;

    private Integer notifyOnExecute;

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

    private String creatorName;

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

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

    private Integer deleted;

    @TableField(exist = false)
    private String statusLabel;

    @TableField(exist = false)
    private String statusColor;

    @TableField(exist = false)
    private String discountTypeLabel;

    @TableField(exist = false)
    private String applyScopeLabel;

    @TableField(exist = false)
    private String deviceScopeLabel;

    @TableField(exist = false)
    private String productScopeLabel;

    @TableField(exist = false)
    private List<Long> shopIds;

    @TableField(exist = false)
    private List<String> deviceIds;

    @TableField(exist = false)
    private List<Long> productIds;

    @TableField(exist = false)
    private List<String> productTypeList;

    @TableField(exist = false)
    private List<String> priorityProductTypeList;
}
