package co.yixiang.yshop.module.product.controller.admin.productcoupon.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import static co.yixiang.yshop.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 商品优惠券创建 Request VO")
@Data
@ToString(callSuper = true)
public class ProductCouponUpdateReqVO {

    @Schema(description = "优惠券id", required = true, example = "1")
    @NotNull(message = "优惠券id不能为空")
    private Long id;

    @Schema(description = "优惠券名称", required = true, example = "1")
    private String couponName;

    @Schema(description = "优惠券面值", required = true, example = "1")
    private BigDecimal couponValue;

    @Schema(description = "优惠券类型：1、满减券，2、折扣券", required = true, example = "1")
    private Integer couponType;

    @Schema(description = "满减门槛", required = true, example = "1")
    private BigDecimal threshold;

    @Schema(description = "折扣", required = true, example = "1")
    private BigDecimal discount;

    @Schema(description = "优惠券范围类型：1、所有商品，2、选中商品", required = true, example = "1")
    private Integer couponScope;

    @Schema(description = "范围值", required = true, example = "1")
    private String[] ids;

    @Schema(description = "优惠券数量", required = true, example = "1")
    private Long number;

    @Schema(description = "领取限制类型 1 无限制 2限制次数", required = true, example = "1")
    private Integer receiveType;

    @Schema(description = "限制每人领取数量", required = true, example = "1")
    private Long limitNumber;

    @Schema(description = "过期类型：1、按时间，2、按天数", required = true, example = "1")
    private Integer expirationType;

    @Schema(description = "生效时间", required = true, example = "1")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime takingEffectTime;

    @Schema(description = "过期时间", required = true, example = "1")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime expirationTime;

    @Schema(description = "过期天数", required = true, example = "1")
    private Long expirationDay;

    @Schema(description = "备注", required = true, example = "1")
    private String remark;
}
