package ru.soune.nocopy.entity.tarif;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

@Entity
@Table(name = "tariff_info")
@AllArgsConstructor
@NoArgsConstructor
@Getter @Setter
public class TariffInfo {

    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    private String id;

    @Column(name = "status", nullable = false)
    @Enumerated(EnumType.STRING)
    private TariffStatus status;

    @Column(name = "start_tariff")
    private LocalDateTime startTariff;

    @Column(name = "end_tariff")
    private LocalDateTime endTariff;

    @Column(name = "tokens")
    private Integer tokens;

    @Column(name = "bought_tokens")
    private Integer boughtTokens = 0;

    @ManyToOne
    @JoinColumn(name = "tariff_id")
    private Tariff tariff;

    @Column(name = "auto_renewal")
    private boolean autoRenewal = false;

    @Column(name = "payment_method_id")
    private String paymentMethodId;
}