<?php

namespace App\Classes\Modules\Vouchers\Services;


use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Vouchers\DataTransferObjects\VoucherCampaignObject;
use App\Models\VoucherCampaign;

class UpdatesVoucherCampaign extends AbstractUpdateRecord
{
    /**
     * @param VoucherCampaign $model
     * @param VoucherCampaignObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(VoucherCampaign $model, VoucherCampaignObject $object) {

        // $model->name = $object->getName();
        if($object->getDescription()){
            $model->description = $object->getDescription();
        }
        $model->limit_per_month = $object->getLimitPerMonth();

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