<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class LawmakersCorrespondence extends Model
{
    public static function boot()
    {
        parent::boot();

        self::creating(function($model){
        });

        self::created(function($model){
            auth()->user()->addActivityComplete(1025,$model);
        });

        self::updating(function($model){
            auth()->user()->addActivityComplete(1026,$model);
        });

        self::updated(function($model){
        });

        self::deleting(function($model){
            auth()->user()->addActivityComplete(1027,$model);
        });

        self::deleted(function($model){
        });
    }

    protected $fillable = [
        'id',
        'unique_code',
        'province_id',
        'province_fa',
        'constituency_id',
        'constituency_fa',
        'lawmaker_name',
        'project_name',
        'unit_id',
        'unit_fa',
        'amount',
        'total_credit',
        'national_credit',
        'province_credit',
        'licence_credit',
        'preaction_by_setad',
        'action_by_province',
        'needed_actions',
        'last_status',
        'last_status_id',
        'last_update_fa',
    ];
}