package com.ai.da.mapper.primary.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_product_coupons")
@NoArgsConstructor
public class ProductCoupons extends BaseEntity{
    // 优惠券id
    private String couponId;
    // 优惠券有效期的截止日期
    private Long redeemBy;
    // 绑定的推广码id
    private String promotionCodeId;
    // 对应的推广码
    private String promotionCode;
    // 优惠券有效期开始时间
    private Long startTime;
    // 最大兑换次数
    private Long maxRedemptions;
    // 优惠券的折扣
    private float percentOff;
    // 佣金比例
    private float commissionRate;
    // 合作者
    private String cooperator;
    // 使用了该优惠券支付的总金额
    private BigDecimal  totalEarnings = BigDecimal.ZERO;
    // 佣金
    private BigDecimal commission = BigDecimal.ZERO;
    // 已付佣金
    private BigDecimal  paidCommission = BigDecimal.ZERO;
    // 未付佣金
    private BigDecimal  unpaidCommission = BigDecimal.ZERO;
    // 备注
    private String remark;

    @TableLogic
    private Integer isDeleted = 0;

    public ProductCoupons(String couponId, Long redeemBy, String promotionCodeId, String promotionCode, Long maxRedemptions, float percentOff, float commissionRate, String cooperator, String remark) {
        this.couponId = couponId;
        this.redeemBy = redeemBy;
        this.promotionCodeId = promotionCodeId;
        this.promotionCode = promotionCode;
        this.maxRedemptions = maxRedemptions;
        this.percentOff = percentOff;
        this.cooperator = cooperator;
        this.remark = remark;
        this.commissionRate = commissionRate;
    }
}
