package com.yc.ship.module.trade.controller.admin.order.vo.market;

import com.yc.ship.module.trade.controller.admin.order.vo.rule.ProductSpecVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import static com.yc.ship.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;


@Schema(description = "管理后台 - 营销政策新增/修改 Request VO")
@Data
public class MarketingSaveReqVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "5198")
    private Long id;

    @Schema(description = "名称", example = "张三")
    private String name;

    @Schema(description = "政策类型", example = "2")
    private Integer policyType;

    @Schema(description = "政策执行标准")
    private Integer policyStandard;

    @Schema(description = "是否启用", example = "1")
    private Integer useStatus;

    @Schema(description = "政策开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDateTime policyStartTime;

    @Schema(description = "政策结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDateTime policyEndTime;

    @Schema(description = "是否指定产品")
    private Integer isProduct;

    @Schema(description = "满金额或者满张数类型，1是满数量，2是满金额")
    private Integer amountOrNum;

    @Schema(description = "满张数")
    private Integer fullNum;

    @Schema(description = "赠送张数")
    private Integer giveNum;

    @Schema(description = "满金额")
    private BigDecimal fullAmount;

    @Schema(description = "赠送金额")
    private BigDecimal giveAmount;

    @Schema(description = "打折比例", example = "32276")
    private BigDecimal discount;

    @Schema(description = "优惠劵金额")
    private BigDecimal coupon;

    @Schema(description = "政策内容")
    private String content;

    @Schema(description = "时间限制（0当次可用，1当次后可用）")
    private Integer limitTime;
    //规则
    @Schema(description = "数量限制（0票可用张数，1可用金额）")
    private Integer limitNum;
    @Schema(description = "按照比列使用还是最多数量（1，比列，2数量），-1表示不限")
    private Integer orderNumOrAmount;
    @Schema(description = "按下单人数或下单金额使用数量或金额")
    private BigDecimal useNumOrAmount;
    @Schema(description = "可用开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDateTime startTime;
    @Schema(description = "可用结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDateTime endTime;
    //供应商
    @Schema(description = "供应商ID")
    private Long supplierId;
    @Schema(description = "供应商资源ID")
    private Long resourceId;
    //分销商
    @Schema(description = "门店ID")
    private List<Long> storeIds;
    @Schema(description = "分销商ID")
    private List<Long> distributorIds;

    @Schema(description = "规格类型")
    private String specType;
    @Schema(description = "指定产品集合")
    private List<Long> productIds;

    @Schema(description = "指定产品集合")
    private List<ProductSpecVO> productSpecList;

    /**
     * 赠送产品ID
     */
    @Schema(description = "赠送产品ID")
    private Long giveProductId;

    /**
     * 赠送产品规格
     */
    @Schema(description = "赠送产品规格")
    private String giveSpecType;

}