<?php

declare(strict_types=1);

namespace App\Framework\MagicLinks\Actions;

use App\Framework\MagicLinks\MagicLinkData;
use App\Framework\MagicLinks\TokenConfig;

interface MagicLinkAction
{
    /**
     * Get the action name
     */
    public function getName(): string;

    /**
     * Get default configuration for this action
     */
    public function getDefaultConfig(): TokenConfig;

    /**
     * Validate the payload for this action
     */
    public function validatePayload(array $payload): bool;

    /**
     * Execute the action
     */
    public function execute(MagicLinkData $magiclinkData, array $context = []): ActionResult;

    /**
     * Get required permissions/roles for this action
     */
    public function getRequiredPermissions(): array;
}
