<?php

namespace App\Classes\Modules\Banks\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Bank;
use App\Models\BankLog;

class CreatesBankLog extends AbstractUpdateRecord
{
    /**
     * @param Bank $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Bank $object) {
        $model = new BankLog();
        $model->bank_id = $object->id;
        $model->company_id = $object->company_id;
        $model->reference = $object->reference;
        $model->bank_name = $object->bank_name;
        $model->holder_name = $object->holder_name;
        $model->account_no = $object->account_no;
        $model->bank_branch = $object->bank_branch;
        $model->swift = $object->swift;
        $model->snap = $object->snap;
        $model->type = $object->type;
        $model->country_id = $object->country_id;
        return $this->handler($model);

    }
}