package br.gov.sigefp.admin.domain;

import br.gov.sigefp.common.domain.AuditableEntity;
import jakarta.persistence.*;
import lombok.*;

/**
 * Entidade que representa uma permissão do sistema.
 * Formato: módulo:recurso:ação (ex: "admin:user:create", "rh:agent:read")
 */
@Entity
@Table(name = "permissions", indexes = {
    @Index(name = "idx_permission_code", columnList = "code")
})
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Permission extends AuditableEntity {

    @Column(nullable = false, unique = true, length = 100)
    private String code;

    @Column(nullable = false, length = 200)
    private String description;

    @Column(length = 50)
    private String module;
}

