package com.printhub.printhub.entity.security;

import jakarta.persistence.*;

@Entity
@Table(name = "permissions", uniqueConstraints = @UniqueConstraint(columnNames = { "module_id", "action" }))
public class Permission {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "module_id", nullable = false)
    private Module module;

    public Module getModule() {
        return module;
    }

    @Column(nullable = false)
    private String action;

    public String getAction() {
        return action;
    }
    
}
