<?php

namespace App\Listeners;

use App\Helpers\FirstParty\Purchase\CreditsPurchaseHelper;
use App\Helpers\FirstParty\Purchase\SubscriptionHelper;
use App\Helpers\FirstParty\Purchase\WatermarkUsageHelper;
use Laravel\Cashier\Events\WebhookReceived;

class StripeEventListener
{
    /**
     * Create the event listener.
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     */
    public function handle(WebhookReceived $event): void
    {
        SubscriptionHelper::handleWebhookEvents($event);
        CreditsPurchaseHelper::handleWebhookEvents($event);
        WatermarkUsageHelper::handleWatermarkUsageWebhookEvents($event);
    }
}
