using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace qdr.app.studiou.orders2printpack.EmailStorage
{
///
/// Configuration class for the EmailStorageProcessor containing all necessary
/// settings for TSS (Temporary Shared Storage) API and SMTP server connectivity.
/// This class is designed to be serialized/deserialized from JSON configuration files.
///
public class EmailProcessorConfiguration
{
#region TSS API Configuration
///
/// API key for accessing the Temporary Shared Storage (TSS) service.
/// This key is required for file upload operations to the shared storage.
///
[JsonPropertyName("tss-api-key")]
[JsonRequired]
public string TssAPIKey { get; set; } = string.Empty;
///
/// Base URL for the Temporary Shared Storage (TSS) API endpoint.
/// Should include the protocol (https://) and domain.
///
[JsonPropertyName("tss-url")]
[JsonRequired]
public string TssUrl { get; set; } = string.Empty;
#endregion
#region SMTP Server Configuration
///
/// SMTP server hostname or IP address for sending emails.
/// Examples: smtp.gmail.com, mail.company.com, 192.168.1.100
///
[JsonPropertyName("smtp-server")]
[JsonRequired]
public string SmtpServer { get; set; } = string.Empty;
///
/// SMTP server port number for email communication.
/// Common ports: 25 (plain), 587 (STARTTLS), 465 (SSL/TLS)
/// Defaults to 587 which is the standard submission port with STARTTLS.
///
[JsonPropertyName("smtp-server-port")]
[JsonRequired]
public int SmtpServerPort { get; set; } = 587; // Default SMTP submission port
///
/// Username for SMTP server authentication.
/// This is typically an email address or account name depending on the server.
///
[JsonPropertyName("smtp-server-user")]
[JsonRequired]
public string SmtpServerUser { get; set; } = string.Empty;
///
/// Password for SMTP server authentication.
/// For security, consider using app-specific passwords when available.
/// This value should be kept secure and not logged.
///
[JsonPropertyName("smtp-server-pwd")]
[JsonRequired]
public string SmtpServerPassword { get; set; } = string.Empty;
///
/// Indicates whether to enable SSL/TLS encryption for SMTP communication.
/// Defaults to true for security. Most modern SMTP servers require encryption.
///
[JsonPropertyName("smtp-enable-ssl")]
public bool SmtpEnableSsl { get; set; } = true; // Default to secure connection
#endregion
}
}