import type { RiskRule } from '@/domain/entities/risk-rule';
import type { Credential } from '@/domain/entities/credential';
import type { Role } from '@/domain/entities/role';

export interface SecurityRepository {
  listRiskRules(params?: Record<string, string>): Promise<RiskRule[]>;
  getRiskRuleById(id: string): Promise<RiskRule>;
  createRiskRule(rule: Omit<RiskRule, 'id' | 'createdAt' | 'updatedAt'>): Promise<RiskRule>;
  updateRiskRule(id: string, data: Partial<RiskRule>): Promise<RiskRule>;
  removeRiskRule(id: string): Promise<void>;

  listCredentials(params?: Record<string, string>): Promise<Credential[]>;
  getCredentialById(id: string): Promise<Credential>;
  createCredential(credential: Omit<Credential, 'id' | 'createdAt' | 'updatedAt' | 'associatedServers'>): Promise<Credential>;
  updateCredential(id: string, data: Partial<Credential>): Promise<Credential>;
  removeCredential(id: string): Promise<void>;

  listRoles(): Promise<Role[]>;
  getPermissionMatrix(): Promise<{ roles: Role[]; allPermissions: string[] }>;
  updateRolePermissions(roleId: string, permissions: string[]): Promise<void>;
}
