// <copyright file="DatabaseBackupOptions.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>

namespace Jellyfin.Database.Implementations.DbConfiguration;

/// <summary>
/// Options to configure database backup behavior.
/// </summary>
public class DatabaseBackupOptions
{
    /// <summary>
    /// Gets or sets the path to the pg_dump executable.
    /// If not specified, will search in system PATH.
    /// </summary>
    /// <remarks>
    /// Examples:
    /// - Windows: "C:\\Program Files\\PostgreSQL\\16\\bin\\pg_dump.exe"
    /// - Linux: "/usr/bin/pg_dump"
    /// - Use "pg_dump" to search in PATH.
    /// </remarks>
    public string? PgDumpPath { get; set; }

    /// <summary>
    /// Gets or sets the path to the pg_restore executable.
    /// If not specified, will search in system PATH.
    /// </summary>
    public string? PgRestorePath { get; set; }

    /// <summary>
    /// Gets or sets the backup format.
    /// </summary>
    /// <remarks>
    /// Valid values:
    /// - "custom" (default): Custom compressed format (pg_restore compatible)
    /// - "plain": Plain SQL script
    /// - "directory": Directory format
    /// - "tar": Tar archive format.
    /// </remarks>
    public string BackupFormat { get; set; } = "custom";

    /// <summary>
    /// Gets or sets a value indicating whether to include large objects (blobs) in backup.
    /// </summary>
    public bool IncludeBlobs { get; set; } = true;

    /// <summary>
    /// Gets or sets the compression level (0-9, where 9 is maximum compression).
    /// Only applies to custom and directory formats.
    /// </summary>
    public int CompressionLevel { get; set; } = 6;

    /// <summary>
    /// Gets or sets additional pg_dump arguments.
    /// </summary>
    /// <remarks>
    /// Example: "--verbose --exclude-table-data=public.logs".
    /// </remarks>
    public string? AdditionalArguments { get; set; }

    /// <summary>
    /// Gets or sets the timeout in seconds for backup operations.
    /// </summary>
    public int TimeoutSeconds { get; set; } = 1800; // 30 minutes

    /// <summary>
    /// Gets or sets a value indicating whether to enable verbose output.
    /// </summary>
    public bool VerboseOutput { get; set; } = true;

    /// <summary>
    /// Gets or sets the number of parallel jobs for pg_dump (if format is 'directory').
    /// </summary>
    public int? ParallelJobs { get; set; }
}
