<?php

namespace App\Observers;

use App\Models\FeedPurchase;

class FeedPurchaseObserver
{
    /**
     * Handle the FeedPurchase "deleted" event.
     */
    public function deleted(FeedPurchase $feedPurchase): void
    {
        $feedPurchase->revertFeedStock();
    }

    /**
     * Handle the FeedPurchase "force deleted" event.
     */
    public function forceDeleted(FeedPurchase $feedPurchase): void
    {
        $feedPurchase->revertFeedStock();
    }

    /**
     * Handle the FeedPurchase "restored" event.
     */
    public function restored(FeedPurchase $feedPurchase): void
    {
        $feedPurchase->updateFeedStock();
    }
}
