package com.yc.ship.module.marketing.controller.admin.coupon.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yc.ship.framework.excel.core.annotations.DictFormat;
import com.yc.ship.framework.excel.core.convert.DictConvert;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

@Schema(description = "管理后台 - 优惠券 Response VO")
@Data
@ExcelIgnoreUnannotated
public class CouponRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19248")
    @ExcelProperty("ID")
    private Long id;

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

    @Schema(description = "优惠券二维码")
    @ExcelProperty("优惠券二维码")
    private String qrCode;

    @Schema(description = "优惠券类型", example = "1")
    @ExcelProperty(value = "优惠券类型", converter = DictConvert.class)
    @DictFormat("coupon_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer type;

    @Schema(description = "使用渠道")
    @ExcelProperty(value = "使用渠道", converter = DictConvert.class)
    @DictFormat("coupon_use_channel") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer useChannel;

    @Schema(description = "使用后领下一张")
    @ExcelProperty(value = "使用后领下一张", converter = DictConvert.class)
    @DictFormat("yes_no") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer useAfter;

    @Schema(description = "审核状态")
    @ExcelProperty(value = "审核状态", converter = DictConvert.class)
    @DictFormat("coupon_audit_state") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer auditState;

    @Schema(description = "可派发状态")
    @ExcelProperty(value = "可派发状态", converter = DictConvert.class)
    @DictFormat("common_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer state;

    @Schema(description = "使用说明", example = "你说的对")
    @ExcelProperty("使用说明")
    private String description;

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

    @Schema(description = "门槛费（满减的满金额）")
    @ExcelProperty("门槛费（满减的满金额）")
    private BigDecimal basic;

    @Schema(description = "金额，折扣")
    @ExcelProperty("金额，折扣")
    private BigDecimal quota;

    @Schema(description = "最大减免")
    @ExcelProperty("最大减免")
    private BigDecimal maximum;

    @Schema(description = "是否多券同用")
    @ExcelProperty("是否多券同用")
    private Integer multiple;

    @Schema(description = "有效类型（1、固定时间。2、相对时间）", example = "1")
    @ExcelProperty("有效类型（1、固定时间。2、相对时间）")
    private Integer effectiveType;

    @Schema(description = "有效开始时间")
    @ExcelProperty("有效开始时间")
    private LocalDateTime effectiveStart;

    @Schema(description = "有效结束时间")
    @ExcelProperty("有效结束时间")
    private LocalDateTime effectiveEnd;

    @Schema(description = "动态有效时长（分钟数）")
    @ExcelProperty("动态有效时长（分钟数）")
    private Integer effectiveTime;

    @Schema(description = "有效期终止日期")
    @ExcelProperty("有效期终止日期")
    private LocalDateTime maxEffectiveTime;

    @Schema(description = "派发开始时间")
    @ExcelProperty("派发开始时间")
    private LocalDateTime deliverStart;

    @Schema(description = "派发结束时间")
    @ExcelProperty("派发结束时间")
    private LocalDateTime deliverEnd;

    @Schema(description = "派发用户群体类型", example = "1")
    @ExcelProperty("派发用户群体类型")
    private Integer deliverUserGroupType;

    @Schema(description = "派发用户群体")
    @ExcelProperty("派发用户群体")
    private String deliverUserGroup;

    @Schema(description = "派发总量")
    @ExcelProperty("派发总量")
    private Integer number;

    @Schema(description = "单用户最大派发量")
    private Integer singleUserMax;

    @Schema(description = "单日最大派发量")
    private Integer singleDayMax;

    @Schema(description = "已领用/已使用")
    private String getAndUseNum;

    @Schema(description = "创建者")
    private String creator;

}