<?php

declare(strict_types=1);

namespace App\Framework\Pagination\ValueObjects;

/**
 * Pagination type enumeration
 */
enum PaginationType: string
{
    case OFFSET = 'offset';
    case CURSOR = 'cursor';

    /**
     * Check if this is offset-based pagination
     */
    public function isOffset(): bool
    {
        return $this === self::OFFSET;
    }

    /**
     * Check if this is cursor-based pagination
     */
    public function isCursor(): bool
    {
        return $this === self::CURSOR;
    }

    /**
     * Get human-readable description
     */
    public function getDescription(): string
    {
        return match ($this) {
            self::OFFSET => 'Offset-based pagination with page numbers',
            self::CURSOR => 'Cursor-based pagination for large datasets',
        };
    }

    /**
     * Get recommended use case
     */
    public function getUseCase(): string
    {
        return match ($this) {
            self::OFFSET => 'Small to medium datasets where total count is needed',
            self::CURSOR => 'Large datasets or real-time data where performance is critical',
        };
    }
}
