<?php

namespace App\Classes\Modules\Bookings\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Bookings\DataTransferObjects\UpdateBookingInvoiceStatusObject;
use App\Models\Booking;

class UpdatesBookingInvoiceStatus extends AbstractUpdateRecord
{

    /**
     * @param Booking $model
     * @param UpdateBookingInvoiceStatusObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Booking $model, UpdateBookingInvoiceStatusObject $object)
    {
        $model->invoice_status = $object->getInvoiceStatus(); //invoice_status first used on Export Sales Invoice Report
        return $this->handler($model);
    }
}
