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:
@@ -42,9 +42,7 @@ namespace DataConnection.REST.Interfaces
|
||||
/// <param name="entityData">The data for the new entity as key-value pairs.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>The created entity data or null if creation failed.</returns>
|
||||
Task<Dictionary<string, object>?> CreateEntityAsync(string entityName, Dictionary<string, object> entityData, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
Task<Dictionary<string, object>?> CreateEntityAsync(string entityName, Dictionary<string, object> entityData, CancellationToken cancellationToken = default); /// <summary>
|
||||
/// Creates a new entity or updates an existing one (upsert operation).
|
||||
/// </summary>
|
||||
/// <param name="entityName">The name of the entity to upsert.</param>
|
||||
@@ -53,6 +51,41 @@ namespace DataConnection.REST.Interfaces
|
||||
/// <returns>The upserted entity data or null if operation failed.</returns>
|
||||
Task<Dictionary<string, object>?> UpsertEntityAsync(string entityName, Dictionary<string, object> entityData, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Searches for entities matching the specified key fields.
|
||||
/// </summary>
|
||||
/// <param name="entityName">The name of the entity to search.</param>
|
||||
/// <param name="keyFields">The key fields and their values to search for.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>A list of matching entities.</returns>
|
||||
Task<List<Dictionary<string, object>>> FindEntitiesByKeysAsync(string entityName, Dictionary<string, object> keyFields, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an entity by its ID or unique identifier.
|
||||
/// </summary>
|
||||
/// <param name="entityName">The name of the entity to delete.</param>
|
||||
/// <param name="entityId">The ID or unique identifier of the entity to delete.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>True if deletion was successful, false otherwise.</returns>
|
||||
Task<bool> DeleteEntityAsync(string entityName, string entityId, CancellationToken cancellationToken = default); /// <summary>
|
||||
/// Updates an existing entity by its ID with the provided data.
|
||||
/// </summary>
|
||||
/// <param name="entityName">The name of the entity to update.</param>
|
||||
/// <param name="entityId">The ID or unique identifier of the entity to update.</param>
|
||||
/// <param name="entityData">The data to update as key-value pairs.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>The updated entity data or null if update failed.</returns>
|
||||
Task<Dictionary<string, object>?> UpdateEntityAsync(string entityName, string entityId, Dictionary<string, object> entityData, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Searches for entities matching the specified required fields to detect duplicates.
|
||||
/// </summary>
|
||||
/// <param name="entityName">The name of the entity to search.</param>
|
||||
/// <param name="requiredFields">The required fields and their values to search for.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>A list of matching entities.</returns>
|
||||
Task<List<Dictionary<string, object>>> FindEntitiesByRequiredFieldsAsync(string entityName, Dictionary<string, object> requiredFields, CancellationToken cancellationToken = default);
|
||||
|
||||
// Add other methods as needed (PUT, DELETE, PATCH, etc.)
|
||||
// Consider adding methods for handling raw HttpResponseMessage or string responses
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user