<?php

namespace Modules\Contracts\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Casts\AsArrayObject;


use Modules\Main\Models\Deal\Deal;
class Contract extends Model
{
    use HasFactory;
    const CREATED_AT = 'created_at';
    const UPDATED_AT = 'updated_at';
    protected $table = 'client_contract';
    protected $fillable = [
        'deal_id',
        'status',
        'comment',
        'price',
        'reward',
        'square',
        'floor',
        'room',//Номер квартиры
        'date',//дата ДДУ
        'reg_date',//Дата регистрации ДДУ
        'payment_type',//Вид оплаты
        'plan7_id',//ид помещения из plan7
        'base64_image',
        'add_info'
    ];
    protected $casts = [
        'add_info' => JsonCasting::class,
    ];
    public function deal()
    {
        return $this->belongsTo(Deal::class, 'deal_id');
    }
}