45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\Crm\Entities;
|
|
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CrmCallAssessment extends Model
|
|
{
|
|
protected $table = 'crm_call_assessments';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'objections' => 'array',
|
|
'decision_maker_reached' => 'boolean',
|
|
'gatekeeper_blocked' => 'boolean',
|
|
];
|
|
|
|
public static function sentiments(): array
|
|
{
|
|
return [
|
|
'positive' => __('crm::lang.sentiment_positive'),
|
|
'neutral' => __('crm::lang.sentiment_neutral'),
|
|
'negative' => __('crm::lang.sentiment_negative'),
|
|
'hostile' => __('crm::lang.sentiment_hostile'),
|
|
];
|
|
}
|
|
|
|
public function callSession()
|
|
{
|
|
return $this->belongsTo(CrmCallSession::class, 'call_session_id');
|
|
}
|
|
|
|
public function companyContact()
|
|
{
|
|
return $this->belongsTo(CrmCompanyContact::class, 'company_contact_id');
|
|
}
|
|
|
|
public function assessedBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'assessed_by');
|
|
}
|
|
}
|