feat: Aggiunto sistema completo di gestione profili per Data Coupler
- Creata nuova libreria Components con componenti Blazor riutilizzabili * ProfileSelector: dropdown per selezione profili salvati * ProfileSaver: componente per salvare configurazioni correnti come profili * ProfileManagement: modale per gestione profili salvati * ProfileQuickActions: bottoni azioni rapide per operazioni sui profili - Esteso CredentialManager con entità e servizi per DataCouplerProfile * Aggiunto modello DataCouplerProfile con configurazioni mapping e metadati * Implementata migrazione Entity Framework per memorizzazione profili * Creato DataCouplerProfileService per operazioni CRUD * Aggiunto CredentialDbContextFactory per operazioni database design-time - Migliorato componente principale DataCoupler con integrazione profili * Integrata funzionalità caricamento/salvataggio profili * Aggiunto selettore profili nella parte superiore dell'interfaccia * Mantenuta retrocompatibilità con funzionalità esistenti * Migliorata esperienza utente con gestione configurazioni salvate - Aggiornata struttura progetto e dipendenze * Aggiunto progetto Components alla soluzione * Aggiornati riferimenti progetti e import * Rimosso progetto obsoleto TestDatabaseFix Questo aggiornamento migliora significativamente il flusso di lavoro permettendo agli utenti di salvare, caricare e gestire configurazioni complete di accoppiamento dati come
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CredentialManager.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Modello per salvare le configurazioni dei profili di Data Coupler
|
||||
/// </summary>
|
||||
public class DataCouplerProfile
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(500)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
// Configurazione Fonte Dati
|
||||
[Required]
|
||||
[MaxLength(20)]
|
||||
public string SourceType { get; set; } = string.Empty; // "database" o "file"
|
||||
|
||||
public int? SourceCredentialId { get; set; }
|
||||
|
||||
[MaxLength(200)]
|
||||
public string? SourceSchema { get; set; }
|
||||
|
||||
[MaxLength(200)]
|
||||
public string? SourceTable { get; set; }
|
||||
|
||||
[MaxLength(500)]
|
||||
public string? SourceFilePath { get; set; }
|
||||
|
||||
// Configurazione Destinazione
|
||||
[Required]
|
||||
[MaxLength(20)]
|
||||
public string DestinationType { get; set; } = string.Empty; // "database" o "rest"
|
||||
|
||||
public int? DestinationCredentialId { get; set; }
|
||||
|
||||
[MaxLength(200)]
|
||||
public string? DestinationSchema { get; set; }
|
||||
|
||||
[MaxLength(200)]
|
||||
public string? DestinationTable { get; set; }
|
||||
|
||||
[MaxLength(500)]
|
||||
public string? DestinationEndpoint { get; set; }
|
||||
|
||||
// Mapping dei campi salvato come JSON
|
||||
[MaxLength(4000)]
|
||||
public string? FieldMappingJson { get; set; }
|
||||
|
||||
// Metadati
|
||||
[MaxLength(100)]
|
||||
public string? CreatedBy { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime? LastUsedAt { get; set; }
|
||||
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
// Relazioni opzionali con le credenziali
|
||||
[ForeignKey(nameof(SourceCredentialId))]
|
||||
public virtual CredentialEntity? SourceCredential { get; set; }
|
||||
|
||||
[ForeignKey(nameof(DestinationCredentialId))]
|
||||
public virtual CredentialEntity? DestinationCredential { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
namespace CredentialManager.Models;
|
||||
|
||||
/// <summary>
|
||||
/// DTO per la creazione/aggiornamento di un profilo DataCoupler
|
||||
/// </summary>
|
||||
public class DataCouplerProfileDto
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
|
||||
// Informazioni sorgente
|
||||
public string SourceType { get; set; } = string.Empty;
|
||||
public int? SourceCredentialId { get; set; }
|
||||
public string? SourceSchema { get; set; }
|
||||
public string? SourceTable { get; set; }
|
||||
public string? SourceFilePath { get; set; }
|
||||
|
||||
// Informazioni destinazione
|
||||
public string DestinationType { get; set; } = string.Empty;
|
||||
public int? DestinationCredentialId { get; set; }
|
||||
public string? DestinationSchema { get; set; }
|
||||
public string? DestinationTable { get; set; }
|
||||
public string? DestinationEndpoint { get; set; }
|
||||
|
||||
// Mapping dei campi
|
||||
public List<FieldMappingDto>? FieldMappings { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DTO per il mapping dei campi
|
||||
/// </summary>
|
||||
public class FieldMappingDto
|
||||
{
|
||||
public string SourceField { get; set; } = string.Empty;
|
||||
public string DestinationField { get; set; } = string.Empty;
|
||||
public string? DataType { get; set; }
|
||||
public bool IsKey { get; set; }
|
||||
public bool IsRequired { get; set; }
|
||||
public string? DefaultValue { get; set; }
|
||||
public string? Transformation { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DTO per la visualizzazione di un profilo nella lista
|
||||
/// </summary>
|
||||
public class DataCouplerProfileSummaryDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
public string SourceType { get; set; } = string.Empty;
|
||||
public string? SourceName { get; set; }
|
||||
public string DestinationType { get; set; } = string.Empty;
|
||||
public string? DestinationName { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? LastUsedAt { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user