<?php

declare(strict_types=1);

namespace App\Listeners\Posts;

use App\Events\Posts\PostCommented;
use App\Services\XPService;

class AwardXpForPostCommented
{
    public function __construct(private readonly XPService $xp) {}

    public function handle(PostCommented $event): void
    {
        $this->xp->awardCommentCreated((int) $event->commenter->id, (int) $event->comment->id, 'post');
    }
}
