<?php

/**
 * Outgoing Webhook Architecture — Contract
 *
 * Prepared for the next version of Licenzo.
 * Implementations will handle dispatching webhook payloads to registered
 * external endpoints for each domain event.
 *
 * Do NOT implement this interface yet — it defines the event vocabulary
 * and dispatch contract that future webhook delivery will follow.
 */

namespace Licenzo\Contracts;

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

interface WebhookDispatchable
{
    public const EVENT_LICENSE_CREATED = 'license.created';
    public const EVENT_LICENSE_ACTIVATED = 'license.activated';
    public const EVENT_LICENSE_DEACTIVATED = 'license.deactivated';
    public const EVENT_LICENSE_EXPIRED = 'license.expired';
    public const EVENT_LICENSE_TRANSFERRED = 'license.transferred';

    public const EVENT_SUBSCRIPTION_CREATED = 'subscription.created';
    public const EVENT_SUBSCRIPTION_ACTIVATED = 'subscription.activated';
    public const EVENT_SUBSCRIPTION_PAUSED = 'subscription.paused';
    public const EVENT_SUBSCRIPTION_RESUMED = 'subscription.resumed';
    public const EVENT_SUBSCRIPTION_CANCELED = 'subscription.canceled';
    public const EVENT_SUBSCRIPTION_EXPIRED = 'subscription.expired';
    public const EVENT_SUBSCRIPTION_RENEWED = 'subscription.renewed';

    public const EVENT_PAYMENT_SUCCEEDED = 'payment.succeeded';
    public const EVENT_PAYMENT_FAILED = 'payment.failed';

    public const EVENT_ACTIVATION_LIMIT_REACHED = 'activation.limit_reached';

    public function dispatch(string $event, array $payload): void;

    public function isEnabled(): bool;
}
