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

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
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 = "管理后台 - 营销政策 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MarketingRespVO {

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

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

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

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

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

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

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

    @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;

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

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

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

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

    @Schema(description = "可用时间类型", example = "1")
    @ExcelProperty("可用时间类型")
    private Integer limitTime;

    @Schema(description = "可用开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDateTime startTime;
    @Schema(description = "可用结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDateTime endTime;

    @Schema(description = "可用数量类型")
    @ExcelProperty("可用数量类型")
    private Integer limitNum;

    @Schema(description = "可用数量或金额类型", example = "1")
    private Integer orderNumOrAmount;

    @Schema(description = "可用数量")
    @ExcelProperty("可用数量")
    private BigDecimal useNumOrAmount;

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

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

    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    //供应商
    @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 List<ProductSpecVO> productSpecList;

    @Schema(description = "附件地址")
    private String fileUrl;

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

}