package com.cyksj.model.views;

import com.cyksj.model.entity.UserBenefits;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

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

/**
 * 项目名: yhlxj2
 * 文件名: UserBenefitsFrontView
 * 创建者: JavaZou
 * 创建时间:2024/9/23 15:34
 */
@Getter
@Setter
@SearchBean(tables = "user_benefits ub left join goods_don g on g.id = ub.goods_id" +
		" left join goods_don_sku sku on sku.id = ub.sku_id",
		where = "ub.status is true",
		orderBy = "ub.sorted asc")
public class UserBenefitsFrontView {
	@DbField("ub.id")
	private Long id;

	/**
	 * 权益类型
	 */
	@DbField("ub.type")
	private UserBenefits.Type type;

	/**
	 * 生效平台
	 */
	@DbField("ub.goods_id")
	private Long goodsId;

	@DbField("g.title")
	private String title;

	@DbField("g.logo")
	private String goodsLogo;

	/**
	 * 实物套餐权益 生效套餐ids
	 */
	@DbField("ub.combo_sku_ids")
	private String comboSkuIds;

	/**
	 * 实物套餐信息
	 */
	@DbIgnore
	private List<GoodsDonSkuFrontView> comboSkuInfo;

	/**
	 * 续费减免生效规格（购买那个规格可享受权益）
	 */
	@DbField("ub.sku_id")
	private Long skuId;

	@DbField("sku.spec_val")
	private String specVal;

	@DbField("sku.price")
	private BigDecimal price;

	/**
	 * 续费减免配置
	 */
	@DbField("ub.renew_config")
	private String renewConfig;

	/**
	 * 续费减免配置
	 */
	@DbIgnore
	private List<UserBenefits.RenewConfig> renewConfigList;

	/**
	 * 图片撇脂
	 */
	@DbField("ub.img_config")
	private String imgConfig;

	/**
	 * 续费减免前几次减免
	 */
	@DbField("ub.start_renew")
	private Integer startRenew;

	@DbField("ub.description")
	private String description;

	/**
	 * 是否符合条件
	 */
	@DbIgnore
	private Boolean isFh;

	/**
	 * 使用过套餐权益
	 */
	@DbIgnore
	private Boolean isComboUsed;

	/**
	 * 续费次数
	 */
	@DbIgnore
	private Integer renewCount;

	/**
	 * 用户认证优惠券详情
	 */
	@DbIgnore
	private List<CouponUserView> couponUserViews;

	/**
	 * 认证优惠券展示
	 */
	@DbIgnore
	private List<CouponView> couponViews;

	@DbIgnore
	private String goodsSpecJson;
}
