Files
Data-Coupler/CredentialManager/Models/DataCouplerProfileDto.cs
T
Alessio 7d2961702c feat: Aggiunta gestione nome database sorgente nei profili DataCoupler
 Nuove funzionalità:
- Aggiunto campo SourceDatabaseName nella tabella DataCouplerProfiles
- Implementato recupero automatico del nome database dalle credenziali
- Migliorata applicazione profili con supporto database specifico
- Aggiornata logica di connessione database con selezione database

🔧 Modifiche tecniche:
- Aggiunta migration per colonna SourceDatabaseName
- Estesi modelli DataCouplerProfile e DataCouplerProfileDto
- Aggiornato DataCouplerProfileService per gestire nuovo campo
- Modificato ProfileSaver per recupero automatico database name
- Implementato metodo ConnectToDatabaseWithSpecificDatabase

🐛 Correzioni:
- Migliorata gestione connessioni database multi-database
- Corretta formattazione codice e spaziature
- Rimosse linee vuote eccessive nel codice sorgente

🧪
2025-07-05 18:10:09 +02:00

68 lines
2.3 KiB
C#

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? SourceCredentialName { get; set; }
public string? SourceDatabaseName { 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? DestinationCredentialName { 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; }
// Configurazione chiave sorgente e associazioni
public string? SourceKeyField { get; set; }
public bool UseRecordAssociations { 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; }
}