package com.cyksj.model.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ejlchina.searcher.bean.DbIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

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

/**
 * 项目名: yhlxj2
 * 文件名: UserBenefits
 * 创建者: JavaZou
 * 创建时间:2024/9/23 14:02
 */
@Getter
@Setter
public class UserBenefits extends BaseEntity {

	/**
	 * 权益类型
	 */
	private Type type;

	/**
	 * 生效平台
	 */
	private Long goodsId;

	/**
	 * 实物套餐权益 生效套餐ids
	 */
	@TableField(updateStrategy = FieldStrategy.IGNORED)
	private String comboSkuIds;

	/**
	 * 续费减免生效规格（购买那个规格可享受权益）
	 */
	private Long skuId;

	/**
	 * 续费减免配置str
	 */
	@TableField(updateStrategy = FieldStrategy.IGNORED)
	private String renewConfig;

	/**
	 * 续费减免配置 传入参数
	 */
	@DbIgnore
	@TableField(exist = false)
	private List<RenewConfig> renewConfigList;

	/**
	 * 描述
	 */
	@TableField(updateStrategy = FieldStrategy.IGNORED)
	private String description;

	/**
	 * 续费减免前几次减免
	 */
	private Integer startRenew;

	private Integer sorted;

	private Boolean status;

	@Getter
	@AllArgsConstructor
	public enum Type {
		RENEW("续费减免"),
		CERT("大学生认证"),
		COMBO("套餐优惠"),
		WELFARE("福利放送"),
		;
		private String desc;
	}

	@Getter
	@Setter
	public static class RenewConfig {
		/**
		 * 名词
		 */
		private Integer index;

		/**
		 * 减免金额
		 */
		private BigDecimal reduce;
	}
}
