namespace StorageService.Infrastructure.Configuration;

/// <summary>
/// EN: Storage settings for MinIO and Aliyun OSS.
/// VI: Cấu hình storage cho MinIO và Aliyun OSS.
/// </summary>
public class StorageSettings
{
    public const string SectionName = "Storage";
    
    /// <summary>EN: Active storage provider (minio or aliyun) / VI: Provider storage đang dùng (minio hoặc aliyun)</summary>
    public string Provider { get; set; } = "minio";
    
    /// <summary>EN: Default bucket name / VI: Tên bucket mặc định</summary>
    public string DefaultBucket { get; set; } = "storage";
    
    /// <summary>EN: Pre-signed URL expiration in seconds / VI: Thời gian hết hạn pre-signed URL (giây)</summary>
    public int PreSignedUrlExpirationSeconds { get; set; } = 3600;
    
    /// <summary>EN: Maximum file size in bytes / VI: Kích thước file tối đa (bytes)</summary>
    public long MaxFileSizeBytes { get; set; } = 104857600; // 100MB
    
    /// <summary>EN: MinIO configuration / VI: Cấu hình MinIO</summary>
    public MinioSettings MinIO { get; set; } = new();
    
    /// <summary>EN: Aliyun OSS configuration / VI: Cấu hình Aliyun OSS</summary>
    public AliyunOssSettings AliyunOSS { get; set; } = new();
}

/// <summary>
/// EN: MinIO-specific settings.
/// VI: Cấu hình riêng cho MinIO.
/// </summary>
public class MinioSettings
{
    /// <summary>EN: MinIO endpoint (host:port) / VI: Endpoint MinIO (host:port)</summary>
    public string Endpoint { get; set; } = "localhost:9000";
    
    /// <summary>EN: Access key / VI: Access key</summary>
    public string AccessKey { get; set; } = string.Empty;
    
    /// <summary>EN: Secret key / VI: Secret key</summary>
    public string SecretKey { get; set; } = string.Empty;
    
    /// <summary>EN: Use SSL/HTTPS / VI: Sử dụng SSL/HTTPS</summary>
    public bool UseSSL { get; set; } = false;
    
    /// <summary>EN: Region (optional) / VI: Region (tùy chọn)</summary>
    public string? Region { get; set; }
}

/// <summary>
/// EN: Aliyun OSS-specific settings.
/// VI: Cấu hình riêng cho Aliyun OSS.
/// </summary>
public class AliyunOssSettings
{
    /// <summary>EN: OSS endpoint / VI: Endpoint OSS</summary>
    public string Endpoint { get; set; } = string.Empty;
    
    /// <summary>EN: Access key ID / VI: Access key ID</summary>
    public string AccessKeyId { get; set; } = string.Empty;
    
    /// <summary>EN: Access key secret / VI: Access key secret</summary>
    public string AccessKeySecret { get; set; } = string.Empty;
    
    /// <summary>EN: Region / VI: Region</summary>
    public string Region { get; set; } = string.Empty;
}
