package de.oaa.xxx.subscription;

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

import java.time.LocalDate;
import java.util.UUID;

@Getter
@Setter
@Entity
@Table(name = "user_subscription")
public class UserSubscriptionEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    @Column(name = "subscription_id")
    private UUID subscriptionId;

    @Column(name = "user_id", nullable = false)
    private UUID userId;

    @Column(name = "subscribed_at", nullable = false)
    private LocalDate subscribedAt;

    @Column(name = "valid_until", nullable = false)
    private LocalDate validUntil;

    @Enumerated(EnumType.STRING)
    @Column(name = "subscription_type", nullable = false, length = 30)
    private SubscriptionType subscriptionType;

    @Column(name = "cancellable_from")
    private LocalDate cancellableFrom;
}
