namespace CredentialManager.Models;
///
/// DTO per la creazione/aggiornamento di un profilo DataCoupler
///
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? SourceCustomQuery { 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? FieldMappings { get; set; }
// Default values per campi destinazione (FieldName -> (Value, Type))
public Dictionary? DefaultValues { get; set; }
// External ID Relationships per Salesforce
public List? ExternalIdRelationships { get; set; }
// Configurazione chiave sorgente e associazioni
public string? SourceKeyField { get; set; }
public bool UseRecordAssociations { get; set; }
}
///
/// DTO per il mapping dei campi
///
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; }
///
/// Lista di relazioni External ID associate a questo campo (per Salesforce)
///
public List? ExternalIdRelationships { get; set; }
}
///
/// DTO per External ID Relationship (Salesforce)
///
public class ExternalIdRelationshipDto
{
///
/// Nome della relazione (es. "Account__r")
///
public string RelationshipName { get; set; } = string.Empty;
///
/// Nome dell'oggetto correlato (es. "Account")
///
public string RelatedObjectName { get; set; } = string.Empty;
///
/// Campo External ID dell'oggetto correlato (es. "Country__c")
///
public string ExternalIdField { get; set; } = string.Empty;
///
/// Campo sorgente da cui prendere il valore per l'External ID
///
public string SourceField { get; set; } = string.Empty;
}
/// /// DTO per i valori di default
///
public class DefaultValueDto
{
public object? Value { get; set; }
public string? Type { get; set; }
}
/// /// DTO per la visualizzazione di un profilo nella lista
///
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; }
}