CRM/backend/app/Models/QualityReview.php

38 خطوط
924 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class QualityReview extends Model
{
protected $fillable = [
'call_id', 'reviewer_id', 'agent_id',
'greeting_score', 'product_intro_score', 'needs_discovery_score',
'objection_handling_score', 'closing_score', 'crm_accuracy_score',
'follow_up_quality_score', 'overall_score',
'feedback', 'tag', 'is_shared_with_agent',
];
protected function casts(): array
{
return ['is_shared_with_agent' => 'boolean'];
}
public function call(): BelongsTo
{
return $this->belongsTo(Call::class);
}
public function reviewer(): BelongsTo
{
return $this->belongsTo(User::class, 'reviewer_id');
}
public function agent(): BelongsTo
{
return $this->belongsTo(User::class, 'agent_id');
}
}