<?php

namespace Modules\Bitrix\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

use Modules\Main\Models\Deal\Deal;
use Modules\Main\Models\Complex;
class SendDeal extends BitrixSender
{
    use HasFactory;
    public function __construct(Deal $deal)
    {
        $this->addDataItem('complexName', $deal->complex->name);
        if ($plan7Data = $deal->plan7_data) {
            $this->addDataItem('plan7', json_decode($plan7Data));
        }
    }
}
