<?php

namespace App\Modules\Report\Booking\Application\LeadBySellerMonthly;

use App\Modules\Group\Domain\IdGroup;
use App\Modules\Report\Booking\Domain\BySellerMonthly\BySellerMonthlyReportBookingGroupBy;
use App\Modules\Report\Booking\Domain\BySellerMonthly\BySellerMonthlyReportBookingShowBy;
use App\Modules\Shared\Domain\Bus\Query\QueryHandler;
use App\Modules\Shared\Domain\DateEnd;
use App\Modules\Shared\Domain\DateStart;

final class ReportLeadBySellerMonthlyQueryHandler implements QueryHandler
{
    public function __construct(
        private ByLeadSellerMonthlyReporter $reporter
    ) {}

    public function __invoke(ReportLeadBySellerMonthlyQuery $query): ReportLeadBySellerMonthlyResponse
    {
        return new ReportLeadBySellerMonthlyResponse(
            $this->reporter->__invoke(
                new DateStart($query->dateStart),
                new DateEnd($query->dateEnd),
                $query->showBy,
                $query->statuses,
                $query->admin
            )
        );
    }
}
