// Package grpc provides gRPC client implementations for service clients.
package grpc

import (
	"context"
	"fmt"

	"git.dcentral.systems/toolz/goplt/pkg/registry"
	"git.dcentral.systems/toolz/goplt/pkg/services"
)

// AuthzClient implements AuthzServiceClient using gRPC.
// This is a stub implementation - will be fully implemented when proto files are generated in Phase 4.
type AuthzClient struct {
	registry registry.ServiceRegistry
}

// NewAuthzClient creates a new gRPC client for the Authz Service.
func NewAuthzClient(reg registry.ServiceRegistry) (services.AuthzServiceClient, error) {
	return &AuthzClient{
		registry: reg,
	}, nil
}

// Authorize checks if a user has a specific permission and returns an error if not.
func (c *AuthzClient) Authorize(ctx context.Context, userID, permission string) error {
	return fmt.Errorf("not implemented: proto files not yet generated")
}

// HasPermission checks if a user has a specific permission.
func (c *AuthzClient) HasPermission(ctx context.Context, userID, permission string) (bool, error) {
	return false, fmt.Errorf("not implemented: proto files not yet generated")
}

// GetUserPermissions returns all permissions for a user.
func (c *AuthzClient) GetUserPermissions(ctx context.Context, userID string) ([]services.Permission, error) {
	return nil, fmt.Errorf("not implemented: proto files not yet generated")
}

// GetUserRoles returns all roles for a user.
func (c *AuthzClient) GetUserRoles(ctx context.Context, userID string) ([]services.Role, error) {
	return nil, fmt.Errorf("not implemented: proto files not yet generated")
}
