package models

import (
	"github.com/google/uuid"
	"github.com/uptrace/bun"
)

type PermissionToRole struct {
	bun.BaseModel `bun:"table:permissions_to_roles"`

	PermissionAction   string    `bun:"action,pk"`
	PermissionResource string    `bun:"resource,pk"`
	RoleID             uuid.UUID `bun:"type:uuid,pk"`

	Permission *Permission `bun:"rel:belongs-to"`
	Role       *Role       `bun:"rel:belongs-to,join:role_id=id"`
}
