<?php

declare(strict_types=1);

namespace App\Framework\Database\Backup;

/**
 * Retention policy for backup cleanup
 */
final readonly class BackupRetentionPolicy
{
    public function __construct(
        public int $maxAgeDays = 30,
        public int $maxCount = 10,
        public bool $keepDaily = true,
        public bool $keepWeekly = true,
        public bool $keepMonthly = true
    ) {
    }

    /**
     * Default retention policy for production
     */
    public static function production(): self
    {
        return new self(
            maxAgeDays: 90,
            maxCount: 50,
            keepDaily: true,
            keepWeekly: true,
            keepMonthly: true
        );
    }

    /**
     * Retention policy for development
     */
    public static function development(): self
    {
        return new self(
            maxAgeDays: 7,
            maxCount: 5,
            keepDaily: false,
            keepWeekly: false,
            keepMonthly: false
        );
    }

    /**
     * Conservative retention policy
     */
    public static function conservative(): self
    {
        return new self(
            maxAgeDays: 365,
            maxCount: 100,
            keepDaily: true,
            keepWeekly: true,
            keepMonthly: true
        );
    }

    /**
     * Minimal retention policy
     */
    public static function minimal(): self
    {
        return new self(
            maxAgeDays: 3,
            maxCount: 3,
            keepDaily: false,
            keepWeekly: false,
            keepMonthly: false
        );
    }
}
