Files
Data-Coupler/CredentialManager/Services/IRecordAssociationService.cs
T
Alessio 51c61eabf7 feat: Implementa gestione intelligente della chiave sorgente con rilevamento PK
- Aggiunge rilevamento automatico Primary Key per connessioni database
- Rimuove completamente il fallback automatico per lato sorgente
- Implementa selezione manuale obbligatoria per file e sorgenti non-DB
- Migliora UI con suggerimenti intelligenti e feedback visivo
- Aggiunge validazione multi-livello (UI, pre-transfer, runtime)
- Introduce metodo GetPrimaryKeyFieldAsync in IDatabaseManager
- Modifica GenerateSourceKey per richiedere sempre campo specifico
- Implementa controllo IsTransferButtonEnabled per validazione form

Breaking changes:
- La generazione automatica delle chiavi sorgente è stata rimossa
- Il campo chiave sorgente è ora obbligatorio quando si usa il sistema associazioni

Fixes: Risolve problema di discovery schema vuoto con selezione database
2025-06-28 02:05:59 +02:00

55 lines
1.7 KiB
C#

using CredentialManager.Models;
namespace CredentialManager.Services;
/// <summary>
/// Interfaccia per il servizio di gestione delle associazioni record
/// </summary>
public interface IRecordAssociationService
{
/// <summary>
/// Salva una nuova associazione tra record sorgente e destinazione
/// </summary>
Task<int> SaveAssociationAsync(RecordAssociation association);
/// <summary>
/// Cerca un'associazione esistente tramite chiave sorgente
/// </summary>
Task<RecordAssociation?> FindAssociationAsync(string sourceName, string sourceKey, string destinationEntity);
/// <summary>
/// Ottiene tutte le associazioni per una sorgente specifica
/// </summary>
Task<List<RecordAssociation>> GetAssociationsBySourceAsync(string sourceName, string sourceType);
/// <summary>
/// Ottiene tutte le associazioni per un'entità di destinazione specifica
/// </summary>
Task<List<RecordAssociation>> GetAssociationsByDestinationAsync(string destinationEntity, string restCredentialName);
/// <summary>
/// Ottiene tutte le associazioni attive
/// </summary>
Task<List<RecordAssociation>> GetAllActiveAssociationsAsync();
/// <summary>
/// Aggiorna un'associazione esistente
/// </summary>
Task<bool> UpdateAssociationAsync(RecordAssociation association);
/// <summary>
/// Disattiva un'associazione (soft delete)
/// </summary>
Task<bool> DeactivateAssociationAsync(int id);
/// <summary>
/// Elimina definitivamente un'associazione
/// </summary>
Task<bool> DeleteAssociationAsync(int id);
/// <summary>
/// Pulisce le associazioni obsolete (opzionale)
/// </summary>
Task<int> CleanupOldAssociationsAsync(TimeSpan olderThan);
}