<?php

namespace App\Classes\Modules\Unity\Processors;

use Config;
use Illuminate\Support\Facades\Http;
use App\Classes\Modules\Unity\Services\UpdatesContractEntity;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use Illuminate\Http\Request;

class AssignContractEntityProcessor
{
    private $updatesContractEntity;

    private $fetchesCompany;

    public function __construct( UpdatesContractEntity $updatesContractEntity, FetchesCompany $fetchesCompany)
    {
        $this->updatesContractEntity = $updatesContractEntity;
        $this->fetchesCompany = $fetchesCompany;
    }

    public function execute(string $contractEntities, array $obligations){

        $responses = [];

        foreach($obligations as $obligation){
            $responses[] = $this->updatesContractEntity->execute($obligation->hash_id, [$contractEntities]);
        }

        return $responses;
    }
}
