package ru.soune.nocopy.entity.referral;


import jakarta.persistence.*;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import java.time.LocalDateTime;

@Entity
@Table(name = "referrals")
@Data
public class Referral {
    @Id
    private Long userId;

    @Column(name = "referral_link", unique = true, nullable = false)
    private String referralLink;

    @Column(name = "inviter_id")
    private Long inviterId = 0L;

    @Column(name = "level_id")
    private String levelId = "bronze";

    @Column(name = "total_income")
    private int totalIncome = 0;

    @Column(name = "available_income")
    private int availableIncome = 0;

    @Column(name = "is_active")
    private boolean isActive = false;

    @CreatedDate
    @Column(name = "created_at", updatable = false, nullable = false)
    private LocalDateTime createdAt = LocalDateTime.now();

    @Column(name = "hold_balance")
    private int holdBalance = 0;
}
