<?php

declare(strict_types=1);

namespace App\Framework\Core\Events;

use App\Framework\Core\ValueObjects\Duration;
use App\Framework\Core\ValueObjects\Timestamp;
use App\Framework\Http\Request;
use App\Framework\Http\Response;

final readonly class AfterHandleRequest
{
    public readonly Timestamp $timestamp;

    public function __construct(
        public Request $request,
        public Response $response,
        public Duration $processingTime,
        ?Timestamp $timestamp = null,
        public array $context = []
    ) {
        $this->timestamp = $timestamp ?? Timestamp::now();
    }
}
