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
This commit is contained in:
@@ -135,6 +135,36 @@ namespace DataConnection.REST.Implementations
|
||||
return await CreateEntityAsync(entityName, entityData, cancellationToken);
|
||||
}
|
||||
|
||||
public virtual async Task<List<Dictionary<string, object>>> FindEntitiesByKeysAsync(string entityName, Dictionary<string, object> keyFields, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Default implementation - returns empty list
|
||||
// Derived classes should override this method for service-specific entity search logic
|
||||
await Task.CompletedTask;
|
||||
return new List<Dictionary<string, object>>();
|
||||
}
|
||||
|
||||
public virtual async Task<bool> DeleteEntityAsync(string entityName, string entityId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Default implementation - returns false (not supported)
|
||||
// Derived classes should override this method for service-specific entity deletion logic
|
||||
await Task.CompletedTask;
|
||||
return false;
|
||||
} public virtual async Task<Dictionary<string, object>?> UpdateEntityAsync(string entityName, string entityId, Dictionary<string, object> entityData, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Default implementation - returns null (not supported)
|
||||
// Derived classes should override this method for service-specific entity update logic
|
||||
await Task.CompletedTask;
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual async Task<List<Dictionary<string, object>>> FindEntitiesByRequiredFieldsAsync(string entityName, Dictionary<string, object> requiredFields, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Default implementation - returns empty list (not supported)
|
||||
// Derived classes should override this method for service-specific duplicate detection logic
|
||||
await Task.CompletedTask;
|
||||
return new List<Dictionary<string, object>>();
|
||||
}
|
||||
|
||||
public virtual async Task<bool> AuthenticateAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Default implementation for basic authentication (already handled in ConfigureHttpClient)
|
||||
|
||||
Reference in New Issue
Block a user