package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 优惠券时间段规则表
 * </p>
 *
 * @author zhangchen
 * @since 2025-08-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "LifeDiscountCouponQuantumRules对象", description = "优惠券时间段规则表")
public class LifeDiscountCouponQuantumRules extends Model<LifeDiscountCouponQuantumRules> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "优惠券id")
    @TableField("discount_coupon_id")
    private Integer discountCouponId;

    @ApiModelProperty(value = "时间段规则类型（可用时间段：available_time_quantum，不可用时间段：unavailable_time_quantum）")
    @TableField("time_quantum_type")
    private String timeQuantumType;

    @ApiModelProperty(value = "删除状态")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private Date createdTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private Date updatedTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField(value = "created_user_id", fill = FieldFill.INSERT)
    private Integer createdUserId;

    @ApiModelProperty(value = "修改人ID")
    @TableField(value = "updated_user_id", fill = FieldFill.INSERT_UPDATE)
    private Integer updatedUserId;

    @ApiModelProperty(value = "开始时间段")
    @TableField(value = "begin_time_quantum", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime beginTimeQuantum;

    @ApiModelProperty(value = "结束时间段")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @TableField(value = "end_time_quantum", fill = FieldFill.INSERT)
    private LocalDateTime  endTimeQuantum;
    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
