<?php

declare(strict_types=1);

namespace App\Framework\Notification\Media;

/**
 * Media Capabilities
 *
 * Defines what media types a driver supports
 */
final readonly class MediaCapabilities
{
    public function __construct(
        public bool $supportsPhoto = false,
        public bool $supportsVideo = false,
        public bool $supportsAudio = false,
        public bool $supportsDocument = false,
        public bool $supportsLocation = false,
        public bool $supportsVoice = false
    ) {
    }

    /**
     * Create capabilities with all features enabled
     */
    public static function all(): self
    {
        return new self(
            supportsPhoto: true,
            supportsVideo: true,
            supportsAudio: true,
            supportsDocument: true,
            supportsLocation: true,
            supportsVoice: true
        );
    }

    /**
     * Create capabilities with no features (text only)
     */
    public static function none(): self
    {
        return new self();
    }

    /**
     * Create capabilities for typical messaging apps
     */
    public static function messaging(): self
    {
        return new self(
            supportsPhoto: true,
            supportsVideo: true,
            supportsAudio: true,
            supportsDocument: true,
            supportsLocation: true,
            supportsVoice: true
        );
    }

    /**
     * Create capabilities for email-like systems
     */
    public static function email(): self
    {
        return new self(
            supportsPhoto: true,
            supportsDocument: true
        );
    }

    /**
     * Check if any media type is supported
     */
    public function hasAnyMediaSupport(): bool
    {
        return $this->supportsPhoto
            || $this->supportsVideo
            || $this->supportsAudio
            || $this->supportsDocument
            || $this->supportsLocation
            || $this->supportsVoice;
    }
}
