<?php

namespace App\Classes\Modules\Accounting\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Accounting\DataTransferObjects\BankStatementDetailObject;
use App\Models\StatementTransactionOwner;

class UpdatesBankStatementDetails extends AbstractUpdateRecord
{

    /**
     * @param StatementTransactionOwner $model
     * @param BankStatementDetailsObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(StatementTransactionOwner $model, BankStatementDetailObject $object)
    {
        $model->system_references = $object->getSystemReferences();
        $model->pay_for = $object->getPayFor();

        return $this->handler($model);
    }
}
