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

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

import java.math.BigDecimal;

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("t_subscription_plan")
public class SubscriptionPlan extends BaseEntity{
    /**
     * 组织id
     */
    private Long organizationId;

    /**
     * 订阅命名
     */
    private String name;

    /**
     * 当前订阅开始时间
     */
    private Long currentPeriodStart;

    /**
     * 当前订阅结束时间
     */
    private Long currentPeriodEnd;

    /**
     * 当前订阅总的子账号数量
     */
    private Integer accountNum;

    /**
     * 当前订阅可用积分上限
     */
    private BigDecimal creditLimit;

    /**
     * 当前订阅已使用积分
     */
    private BigDecimal creditUsage;

    /**
     * 管理员账户id
     */
    private Long adminAccId;

    @TableLogic(value = "0", delval = "1")
    private Integer isDeleted;

    /**
     * 删除人的用户id
     */
    private Long deleteBy;

    /**
     * 状态
     */
    private String status;

    // 在类内部定义的枚举
    @Getter
    public enum SubscriptionStatus {
        PENDING("待激活", 0),
        ACTIVE("已激活", 1),
        EXPIRED("已过期", 2),
        CANCELLED("已取消", 3);

        private final String desc;
        private final int code;

        SubscriptionStatus(String desc, int code) {
            this.desc = desc;
            this.code = code;
        }
    }

}
