package ru.kirillius.pf.sdn.entity;

import jakarta.persistence.*;
import lombok.*;
import ru.kirillius.pf.sdn.api.Networking.NetworkScope;
import ru.kirillius.pf.sdn.api.Networking.Subscriptions.Subscription;


@Entity
@Table(name = "subscription_cache")
@Getter
@Setter
@NoArgsConstructor
@Builder
@AllArgsConstructor
public class SubscriptionCacheEntry implements Subscription {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

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

    @Column(nullable = false, columnDefinition = "TEXT")
    @Convert(converter = NetworkScopeConverter.class)
    private NetworkScope scope;
}
