namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems;

public class DatabaseConnectionDefinition
{
    /// <summary>Gets or sets the primary key.</summary>
    public int Id { get; set; }
    /// <summary>Gets or sets the human-readable connection name.</summary>
    public string Name { get; set; }
    /// <summary>Gets or sets the ADO.NET connection string for this database.</summary>
    public string ConnectionString { get; set; }
    /// <summary>Gets or sets the maximum number of retry attempts for transient failures.</summary>
    public int MaxRetries { get; set; }
    /// <summary>Gets or sets the delay between retry attempts.</summary>
    public TimeSpan RetryDelay { get; set; }

    /// <summary>Initializes a new <see cref="DatabaseConnectionDefinition"/> with the required name and connection string.</summary>
    /// <param name="name">The human-readable connection name.</param>
    /// <param name="connectionString">The ADO.NET connection string.</param>
    public DatabaseConnectionDefinition(string name, string connectionString)
    {
        Name = name ?? throw new ArgumentNullException(nameof(name));
        ConnectionString = connectionString ?? throw new ArgumentNullException(nameof(connectionString));
    }
}
