package com.zsElectric.boot.business.model.form;

import java.io.Serial;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;

/**
 * 优惠劵表单对象
 *
 * @author zsElectric
 * @since 2025-12-15 09:38
 */
@Getter
@Setter
@Schema(description = "优惠劵表单对象")
public class CouponForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "优惠劵编号")
    @NotNull(message = "优惠劵编号不能为空")
    private Long id;

    @Schema(description = "优惠劵模板编号")
    @NotNull(message = "优惠劵模板编号不能为空")
    private Long templateId;

    @Schema(description = "优惠劵名")
    @Size(max=50, message="优惠劵名长度不能超过50个字符")
    private String name;

    @Schema(description = "优惠码状态1-未使用2-已使用3-已失效")
    private Integer status;

    @Schema(description = "用户编号")
    @NotNull(message = "用户编号不能为空")
    private Long userId;

    @Schema(description = "领取类型(1-用户主动领取2-后台自动发放)")
    private Integer takeType;

    @Schema(description = "设置满多少金额可用，单位：分")
    @NotNull(message = "设置满多少金额可用，单位：分不能为空")
    private Integer usePrice;

    @Schema(description = "生效结束时间")
    @NotNull(message = "生效结束时间不能为空")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime validEndTime;

    @Schema(description = "优惠金额，单位：分")
    @NotNull(message = "优惠金额，单位：分不能为空")
    private Integer discountPrice;

    @Schema(description = "使用订单号")
    private Long useOrderId;

    @Schema(description = "使用时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime useTime;

    @Schema(description = "优惠劵描述")
    @Size(max=512, message="优惠劵描述长度不能超过512个字符")
    private String description;

    @Schema(description = "创建者")
    private Long createBy;

    @Schema(description = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "更新者")
    private Long updateBy;

    @Schema(description = "更新时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "逻辑删除（0-未删除 1-已删除）")
    @TableLogic
    private Integer isDeleted;


}
