package com.snack.server.module.coupon.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

/**
 * 优惠券模板 VO
 */
@Data
@Schema(description = "优惠券模板")
public class CouponVO implements Serializable {

    @Schema(description = "优惠券 ID")
    private Long id;

    @Schema(description = "优惠券名称")
    private String name;

    @Schema(description = "类型：0-满减券 1-折扣券 2-无门槛券")
    private Integer type;

    @Schema(description = "类型文本")
    private String typeText;

    @Schema(description = "满减面值 / 折扣率")
    private BigDecimal amount;

    @Schema(description = "最低使用金额")
    private BigDecimal minAmount;

    @Schema(description = "折扣券最高抵扣金额")
    private BigDecimal maxDiscount;

    @Schema(description = "发放总量（-1 表示不限量）")
    private Integer total;

    @Schema(description = "剩余可领取数量")
    private Integer remain;

    @Schema(description = "已领取数量")
    private Integer received;

    @Schema(description = "每人限领数量")
    private Integer perLimit;

    @Schema(description = "状态：0-未上线 1-已上线 2-已结束")
    private Integer status;

    @Schema(description = "状态文本")
    private String statusText;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "领取开始时间")
    private LocalDateTime startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "领取截止时间")
    private LocalDateTime endTime;

    @Schema(description = "领取后有效天数")
    private Integer validDays;

    @Schema(description = "使用说明")
    private String description;

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

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