package shop.alien.entity.store.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import shop.alien.entity.store.LifeDiscountCouponQuantumRules;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 优惠券表DTO
 * </p>
 *
 * @author ssk
 * @since 2025-02-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="LifeDiscountCoupon对象", description="优惠券表")
public class LifeDiscountCouponVo {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    private Integer id;

    @ApiModelProperty(value = "用户券id")
    private Integer userCouponId;

    @ApiModelProperty(value = "商铺id")
    private String storeId;

    @ApiModelProperty(value = "用户id")
    private String userId;

    @ApiModelProperty(value = "券id")
    private Integer couponId;

    @ApiModelProperty(value = "代金券id（来自life_coupon时使用）")
    private String voucherId;

    @ApiModelProperty(value = "是否可领")
    private boolean canReceived;

    @ApiModelProperty(value = "已领取数量")
    private Integer quantityClaimed;

    @ApiModelProperty(value = "好友赠券场景下，本店作为送出方已向好友发放的合计张数（life_discount_coupon_store_friend.single_qty；friend_store_user_id 归属本店、release_type=1）")
    private Integer ownedQuantity;

    @ApiModelProperty(value = "券名称")
    private String name;

    @ApiModelProperty(value = "面值")
    private BigDecimal nominalValue;

    @ApiModelProperty(value = "有效期（天）")
    private Integer expirationDate;

    @ApiModelProperty(value = "领取后是否长期有效：0-否，1-是")
    private Integer longTermValid;

    @ApiModelProperty(value = "开始日期")
    private LocalDate startDate;

    @ApiModelProperty(value = "结束日期")
    private LocalDate endDate;

    @ApiModelProperty(value = "库存（优惠券数量）")
    private Integer singleQty;

    @ApiModelProperty(value = "发行数量是否不限：0-否，1-是")
    private Integer unlimitedQty;

    @ApiModelProperty(value = "补充说明")
    private String supplementaryInstruction;

    @ApiModelProperty(value = "领取状态：0：关闭领取，1：开启领取")
    private Integer getStatus;

    @ApiModelProperty(value = "限制领取数量")
    private Integer restrictedQuantity;

    @ApiModelProperty(value = "最低消费")
    private BigDecimal minimumSpendingAmount;

    @ApiModelProperty(value = "类型   1-优惠券  2-红包")
    private Integer type;

    @ApiModelProperty(value = "状态：商家券列表为(0进行中/1已结束/…)；getUserCouponList 为用户券状态(0待使用/1已使用/2已作废)")
    private Integer status;

    @ApiModelProperty(value = "优惠券状态文案，用于前端展示：进行中/已结束/未开始/已暂停/已售罄/草稿")
    private String statusDesc;

    @ApiModelProperty(value = "收藏可领（0：否，1：是）")
    private Integer attentionCanReceived;

    @ApiModelProperty(value = "是否可用")
    private boolean disabledStatus;

    @ApiModelProperty(value = "禁用规则简介")
    private String forbiddenRule;

    @ApiModelProperty(value = "周中禁用规则")
    private List<String> weeklyDisabledList;

    @ApiModelProperty(value = "节假日禁用规则")
    private List<String> holidayDisabledList;

    @ApiModelProperty(value = "优惠券领取规则  每日一领：day，每周一领：week，每月一领：month，每年一领：year，自定义：customize")
    private String claimRule;

    @ApiModelProperty(value = "店铺名称")
    private String storeName;

    @ApiModelProperty(value = "发布状态")
    private Integer releaseType;

    @ApiModelProperty(value = "赠送券id")
    private String giveCouponId;

    @ApiModelProperty(value = "到达使用时间")
    private Integer reachUseTimeFlag;

    @ApiModelProperty(value = "经营板块id(词典表 键为 business_section)")
    private Integer businessSection;

    @ApiModelProperty(value = "经营板块名称")
    private String businessSectionName;

    @ApiModelProperty(value = "自定义领取规则数量")
    private Integer claimRuleCustomizeValue;

    @ApiModelProperty(value = "适用范围，0，适用，1不适用")
    private Integer applicationScope;

    @ApiModelProperty(value = "适用范围内容")
    private String applicationScopeValue;

    @ApiModelProperty(value = "指定天数")
    private String specifiedDay;

    @ApiModelProperty(value = "是否可以叠加其他优惠券使用，0，是，1否")
    private Integer isOverlay;

    @ApiModelProperty(value = "是否通用，0，是，1否")
    private Integer isCommon;

    @ApiModelProperty(value = "指定时间段可用")
    private List<LifeDiscountCouponQuantumRules> availableTimeQuantum;

    @ApiModelProperty(value = "自定义时间段不可用")
    private List<LifeDiscountCouponQuantumRules> customizeUnavailableTimeQuantum;

    @ApiModelProperty(value = "开始领取时间")
    private LocalDate beginGetDate;

    @ApiModelProperty(value = "结束领取时间")
    private LocalDate endGetDate;

    @ApiModelProperty(value = "优惠券状态：0-草稿，1-正式，2-已失效")
    private Integer couponStatus;

    @ApiModelProperty(value = "有效期")
    private LocalDate validDate;

    @ApiModelProperty(value = "到期日期")
    private LocalDate expirationTime;

    @ApiModelProperty(value = "优惠券类型：1-满减券，2-折扣券")
    private Integer couponType;

    @ApiModelProperty(value = "折扣率（0-100，用于折扣券，例如80表示8折）")
    private BigDecimal discountRate;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time")
    @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
    private Date createdTime;

}
