// Package services provides service client interfaces for inter-service communication.
package services

import (
	"context"
)

// AuthzServiceClient is the interface for communicating with the Authz Service.
type AuthzServiceClient interface {
	// Authorize checks if a user has a specific permission and returns an error if not.
	Authorize(ctx context.Context, userID, permission string) error

	// HasPermission checks if a user has a specific permission.
	HasPermission(ctx context.Context, userID, permission string) (bool, error)

	// GetUserPermissions returns all permissions for a user.
	GetUserPermissions(ctx context.Context, userID string) ([]Permission, error)

	// GetUserRoles returns all roles for a user.
	GetUserRoles(ctx context.Context, userID string) ([]Role, error)
}

// Permission represents a permission in the system.
type Permission struct {
	ID          string `json:"id"`
	Code        string `json:"code"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

// Role represents a role in the system.
type Role struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Permissions []string `json:"permissions"` // Permission codes
}
