<?php

namespace App\Classes\Modules\PackingLists\Services\Containers;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Models\Container;

class UpdatesContainer extends AbstractUpdateRecord
{

    /**
     * @param Container $model
     * @param ContainerObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Container $model, ContainerObject $object) {

        $model->reference = $object->getReference();
        $model->container_type = $object->getContainerType();
        $model->seal_reference = $object->getSealReference();

        return $this->handler($model);

    }
}
